Skip to content

Commit

Permalink
CASMINST-4757 Add required pod antiaffinity (#43)
Browse files Browse the repository at this point in the history
* CASMINST-4757 Use preferred for pod anti affinity

* CASMINST-4757 Update anti affinity to use uuid

* CASMISNT-4757 Bump Chart to 1.10.10

* CASMISNT-4757 Bump Chart to 1.10.10
  • Loading branch information
kburns-hpe authored Jun 10, 2022
1 parent 9527b52 commit 76c6199
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions kubernetes/cray-opa/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#
apiVersion: v2
name: cray-opa
version: 1.10.2
version: 1.10.10
description: Cray Open Policy Agent
keywords:
- opa
Expand All @@ -32,7 +32,6 @@ sources:
- https://github.com/Cray-HPE/cray-opa
maintainers:
- name: kburns-hpe
- name: brantk-hpe
appVersion: 0.24.0
annotations:
artifacthub.io/license: MIT
15 changes: 9 additions & 6 deletions kubernetes/cray-opa/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/}}
{{- range $name, $options:= .Values.ingresses }}
{{ $uuid := uuidv4 }}
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -43,6 +44,7 @@ spec:
app.kubernetes.io/name: cray-opa-{{ $name }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
deployment/uuid: {{ $uuid }}
spec:
containers:
- image: {{ $.Values.image.repository }}:{{ $.Values.image.tag }}
Expand All @@ -51,7 +53,7 @@ spec:
env:
- name: POLICY_CONFIGMAP_VERSION
# Change to force opa pods to restart and re-read ConfigMap.
value: "8"
value: "10"
{{- if $.Values.opa.httpTimeout }}
- name: HTTP_SEND_TIMEOUT
value: {{ $.Values.opa.httpTimeout | quote }}
Expand Down Expand Up @@ -114,16 +116,17 @@ spec:
values:
- cray-opa-{{ $name }}
topologyKey: kubernetes.io/hostname
topologyKey: kubernetes.io/hostname
{{- end }}
{{- if eq $.Values.affinity.default "required" }}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- cray-opa-{{ $name }}
matchExpressions:
- key: deployment/uuid
operator: In
values:
- {{ $uuid }}
topologyKey: kubernetes.io/hostname
{{- end }}
{{ if $options.affinity }}
Expand Down

0 comments on commit 76c6199

Please sign in to comment.