Skip to content

Commit

Permalink
add affinity, nodeSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
aviramha committed Oct 1, 2024
1 parent fbd450e commit 7e758c1
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mirrord-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.8.5
version: 1.9.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 8 additions & 0 deletions mirrord-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ spec:
tolerations:
{{- toYaml .Values.operator.tolerations | nindent 8 }}
{{- end }}
{{- with .Values.operator.nodeSelector }}
nodeSelector:
{{- toYaml . | trim | nindent 8 }}
{{- end }}
{{- with .Values.operator.affinity }}
affinity:
{{- toYaml . | trim | nindent 8 }}
{{- end }}
containers:
- env:
- name: RUST_LOG
Expand Down
11 changes: 11 additions & 0 deletions mirrord-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ operator:
# value: "value1"
# effect: "NoSchedule"

# affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - topologyKey: kubernetes.io/hostname
# labelSelector:
# matchLabels:
# k8s-app: mirrord

# nodeSelector:
# kubernetes.io/os: linux

# Port for operator to listen on. If you can't listen on 443 due to privilege issues
# you can change this to 3000/8443 or whatever you want - just make sure that nodes
# can communicate on that port if it doesn't work then.
Expand Down
14 changes: 14 additions & 0 deletions test_values/operator_affinity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
operator:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
k8s-app: mirrord

license:
file:
secret: mirrord-operator-license
data:
license.pem: "DOESN'TNEEDTOBOOTSOITCANBEINVALID"
9 changes: 9 additions & 0 deletions test_values/operator_nodeselector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
license:
file:
secret: mirrord-operator-license
data:
license.pem: "DOESN'TNEEDTOBOOTSOITCANBEINVALID"

operator:
nodeSelector:
kubernetes.io/os: linux

0 comments on commit 7e758c1

Please sign in to comment.