From 7e758c1deddb40e4223125be055625cf73c5f62b Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Tue, 1 Oct 2024 19:27:35 +0300 Subject: [PATCH] add affinity, nodeSelector --- mirrord-operator/Chart.yaml | 2 +- mirrord-operator/templates/deployment.yaml | 8 ++++++++ mirrord-operator/values.yaml | 11 +++++++++++ test_values/operator_affinity.yaml | 14 ++++++++++++++ test_values/operator_nodeselector.yaml | 9 +++++++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 test_values/operator_affinity.yaml create mode 100644 test_values/operator_nodeselector.yaml diff --git a/mirrord-operator/Chart.yaml b/mirrord-operator/Chart.yaml index aba3d60..e8f74ec 100644 --- a/mirrord-operator/Chart.yaml +++ b/mirrord-operator/Chart.yaml @@ -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 diff --git a/mirrord-operator/templates/deployment.yaml b/mirrord-operator/templates/deployment.yaml index c7bd2dd..9f807fd 100644 --- a/mirrord-operator/templates/deployment.yaml +++ b/mirrord-operator/templates/deployment.yaml @@ -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 diff --git a/mirrord-operator/values.yaml b/mirrord-operator/values.yaml index 086e760..7936719 100644 --- a/mirrord-operator/values.yaml +++ b/mirrord-operator/values.yaml @@ -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. diff --git a/test_values/operator_affinity.yaml b/test_values/operator_affinity.yaml new file mode 100644 index 0000000..401d276 --- /dev/null +++ b/test_values/operator_affinity.yaml @@ -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" diff --git a/test_values/operator_nodeselector.yaml b/test_values/operator_nodeselector.yaml new file mode 100644 index 0000000..03fea22 --- /dev/null +++ b/test_values/operator_nodeselector.yaml @@ -0,0 +1,9 @@ +license: + file: + secret: mirrord-operator-license + data: + license.pem: "DOESN'TNEEDTOBOOTSOITCANBEINVALID" + +operator: + nodeSelector: + kubernetes.io/os: linux \ No newline at end of file