From 4d920b98d624362c5f2f75d19872952e37aac264 Mon Sep 17 00:00:00 2001 From: Ojaswa Sharma Date: Wed, 20 Mar 2024 15:13:01 +0530 Subject: [PATCH 1/4] feat: add node options --- code-analysis/templates/andromeda.yaml | 14 ++++++++++++-- code-analysis/templates/bishamonten.yaml | 15 +++++++++++++++ code-analysis/templates/config.yaml | 4 ++++ code-analysis/templates/mastervendor.yaml | 17 ++++++++++++++++- code-analysis/templates/mongo.yaml | 15 +++++++++++++++ code-analysis/values.yaml | 14 +++++++++++++- 6 files changed, 75 insertions(+), 4 deletions(-) diff --git a/code-analysis/templates/andromeda.yaml b/code-analysis/templates/andromeda.yaml index 6c50e2a..ddd7cd5 100644 --- a/code-analysis/templates/andromeda.yaml +++ b/code-analysis/templates/andromeda.yaml @@ -256,20 +256,30 @@ spec: nodeSelector: kubernetes.io/hostname: {{ .Values.andromeda.node.hostname }} {{- end }} - {{- if .Values.andromeda.node.affinity.enable }} + {{- if or .Values.node.affinity.enable .Values.andromeda.node.affinity.enable }} affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: + {{- if or .Values.andromeda.node.affinity.enable }} - key: {{ .Values.andromeda.node.affinity.key }} operator: {{ .Values.andromeda.node.affinity.operator }} + {{- else if .Values.node.affinity.enable }} + - key: {{ .Values.node.affinity.key }} + operator: {{ .Values.node.affinity.operator }} + {{- end}} {{- end }} - {{- if .Values.andromeda.node.toleration.enable }} + {{- if or .Values.node.toleration.enable .Values.andromeda.node.affinity }} tolerations: - key: {{ .Values.andromeda.node.toleration.key }} operator: {{ .Values.andromeda.node.toleration.operator }} effect: {{ .Values.andromeda.node.toleration.effect }} + {{- else if .Values.node.toleration.enable }} + tolerations: + - key: {{ .Values.node.toleration.key }} + operator: {{ .Values.node.toleration.operator }} + effect: {{ .Values.node.toleration.effect }} {{- end }} containers: - name: andromeda diff --git a/code-analysis/templates/bishamonten.yaml b/code-analysis/templates/bishamonten.yaml index db6d9ca..5debf0d 100644 --- a/code-analysis/templates/bishamonten.yaml +++ b/code-analysis/templates/bishamonten.yaml @@ -61,6 +61,21 @@ spec: imagePullSecrets: - name: {{ .Values.base.imagePullSecret }} restartPolicy: {{ .Values.base.podRestartPolicy }} + {{- if or .Values.node.affinity.enable }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: {{ .Values.node.affinity.key }} + operator: {{ .Values.node.affinity.operator }} + {{- end }} + {{- if .Values.node.toleration.enable }} + tolerations: + - key: {{ .Values.node.toleration.key }} + operator: {{ .Values.node.toleration.operator }} + effect: {{ .Values.node.toleration.effect }} + {{- end }} containers: - name: bishamonten image: {{ tpl .Values.bishamonten.image.name . }}:{{ .Values.bishamonten.image.tag }} diff --git a/code-analysis/templates/config.yaml b/code-analysis/templates/config.yaml index cce930d..2695861 100644 --- a/code-analysis/templates/config.yaml +++ b/code-analysis/templates/config.yaml @@ -35,10 +35,14 @@ data: {{- if .Values.andromeda.node.affinity.enable }} K8S_AFFINITY_KEY: {{ .Values.andromeda.node.affinity.key }} + {{- else if .Values.node.affinity.enable }} + K8S_AFFINITY_KEY: {{ .Values.node.affinity.key }} {{- end }} {{- if .Values.andromeda.node.toleration.enable }} K8S_TOLERATION_KEY: {{ .Values.andromeda.node.toleration.key }} + {{- else if .Values.node.toleration.enable }} + K8S_TOLERATION_KEY: {{ .Values.node.toleration.key }} {{- end }} {{- range $key, $val := .Values.config.data }} diff --git a/code-analysis/templates/mastervendor.yaml b/code-analysis/templates/mastervendor.yaml index d32206f..e7c4037 100644 --- a/code-analysis/templates/mastervendor.yaml +++ b/code-analysis/templates/mastervendor.yaml @@ -27,6 +27,21 @@ spec: imagePullSecrets: - name: {{ .Values.base.imagePullSecret }} restartPolicy: {{ .Values.mastervendor.podRestartPolicy }} + {{- if or .Values.node.affinity.enable }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: {{ .Values.node.affinity.key }} + operator: {{ .Values.node.affinity.operator }} + {{- end }} + {{- if .Values.node.toleration.enable }} + tolerations: + - key: {{ .Values.node.toleration.key }} + operator: {{ .Values.node.toleration.operator }} + effect: {{ .Values.node.toleration.effect }} + {{- end }} containers: - name: mastervendor image: {{ tpl .Values.mastervendor.image.name . }}:{{ .Values.mastervendor.image.tag }} @@ -57,4 +72,4 @@ spec: {{- end }} {{- end}} {{- end}} -{{- end}} \ No newline at end of file +{{- end}} diff --git a/code-analysis/templates/mongo.yaml b/code-analysis/templates/mongo.yaml index 9bbd2f7..8f73589 100644 --- a/code-analysis/templates/mongo.yaml +++ b/code-analysis/templates/mongo.yaml @@ -85,6 +85,21 @@ spec: spec: restartPolicy: {{ .Values.base.podRestartPolicy }} terminationGracePeriodSeconds: 15 + {{- if or .Values.node.affinity.enable }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: {{ .Values.node.affinity.key }} + operator: {{ .Values.node.affinity.operator }} + {{- end }} + {{- if .Values.node.toleration.enable }} + tolerations: + - key: {{ .Values.node.toleration.key }} + operator: {{ .Values.node.toleration.operator }} + effect: {{ .Values.node.toleration.effect }} + {{- end }} initContainers: - name: init-mongo-encryption image: busybox diff --git a/code-analysis/values.yaml b/code-analysis/values.yaml index 6403410..3810dc6 100644 --- a/code-analysis/values.yaml +++ b/code-analysis/values.yaml @@ -60,6 +60,18 @@ updates: tag: latest +node: + affinity: + enable: false + key: "PRIVADO_ANDROMEDA_NODE_LABEL" + operator: Exists # only Exists supported + toleration: + enable: false + key: "PRIVADO_ANDROMEDA_NODE_TAINT" + operator: Exists # only Exists supported + effect: NoSchedule # only NoSchedule supported + + # specific values related to ingress ingress: name: privado-ingress @@ -145,7 +157,7 @@ andromeda: limits: cpu: memory: - node: + node: # overrides the global node configs hostname: "" # if customer has NFS storage attached then keep this field empty else keep node's "hostname" having larger resources affinity: enable: false From 385883e3f0629d556e358e5df928e4b0a0ce155e Mon Sep 17 00:00:00 2001 From: Ojaswa Sharma Date: Wed, 20 Mar 2024 15:17:54 +0530 Subject: [PATCH 2/4] fix: dangling or --- code-analysis/templates/andromeda.yaml | 4 ++-- code-analysis/templates/bishamonten.yaml | 2 +- code-analysis/templates/mastervendor.yaml | 2 +- code-analysis/templates/mongo.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code-analysis/templates/andromeda.yaml b/code-analysis/templates/andromeda.yaml index ddd7cd5..b9bf25b 100644 --- a/code-analysis/templates/andromeda.yaml +++ b/code-analysis/templates/andromeda.yaml @@ -262,7 +262,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - {{- if or .Values.andromeda.node.affinity.enable }} + {{- if .Values.andromeda.node.affinity.enable }} - key: {{ .Values.andromeda.node.affinity.key }} operator: {{ .Values.andromeda.node.affinity.operator }} {{- else if .Values.node.affinity.enable }} @@ -270,7 +270,7 @@ spec: operator: {{ .Values.node.affinity.operator }} {{- end}} {{- end }} - {{- if or .Values.node.toleration.enable .Values.andromeda.node.affinity }} + {{- if .Values.andromeda.node.affinity }} tolerations: - key: {{ .Values.andromeda.node.toleration.key }} operator: {{ .Values.andromeda.node.toleration.operator }} diff --git a/code-analysis/templates/bishamonten.yaml b/code-analysis/templates/bishamonten.yaml index 5debf0d..a9b114e 100644 --- a/code-analysis/templates/bishamonten.yaml +++ b/code-analysis/templates/bishamonten.yaml @@ -61,7 +61,7 @@ spec: imagePullSecrets: - name: {{ .Values.base.imagePullSecret }} restartPolicy: {{ .Values.base.podRestartPolicy }} - {{- if or .Values.node.affinity.enable }} + {{- if .Values.node.affinity.enable }} affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: diff --git a/code-analysis/templates/mastervendor.yaml b/code-analysis/templates/mastervendor.yaml index e7c4037..1f7a27e 100644 --- a/code-analysis/templates/mastervendor.yaml +++ b/code-analysis/templates/mastervendor.yaml @@ -27,7 +27,7 @@ spec: imagePullSecrets: - name: {{ .Values.base.imagePullSecret }} restartPolicy: {{ .Values.mastervendor.podRestartPolicy }} - {{- if or .Values.node.affinity.enable }} + {{- if .Values.node.affinity.enable }} affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: diff --git a/code-analysis/templates/mongo.yaml b/code-analysis/templates/mongo.yaml index 8f73589..3a0e007 100644 --- a/code-analysis/templates/mongo.yaml +++ b/code-analysis/templates/mongo.yaml @@ -85,7 +85,7 @@ spec: spec: restartPolicy: {{ .Values.base.podRestartPolicy }} terminationGracePeriodSeconds: 15 - {{- if or .Values.node.affinity.enable }} + {{- if .Values.node.affinity.enable }} affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: From 57ab294e6ac6954ac4a91905358ad9c0f4fb4e3b Mon Sep 17 00:00:00 2001 From: Ojaswa Sharma Date: Wed, 20 Mar 2024 15:23:06 +0530 Subject: [PATCH 3/4] fix: condition key --- code-analysis/templates/andromeda.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code-analysis/templates/andromeda.yaml b/code-analysis/templates/andromeda.yaml index b9bf25b..5a9c097 100644 --- a/code-analysis/templates/andromeda.yaml +++ b/code-analysis/templates/andromeda.yaml @@ -270,7 +270,7 @@ spec: operator: {{ .Values.node.affinity.operator }} {{- end}} {{- end }} - {{- if .Values.andromeda.node.affinity }} + {{- if .Values.andromeda.node.toleration.enable }} tolerations: - key: {{ .Values.andromeda.node.toleration.key }} operator: {{ .Values.andromeda.node.toleration.operator }} From a3d5953ce114c95a8e4bf4c9d177e0925fa03f4e Mon Sep 17 00:00:00 2001 From: Ojaswa Sharma Date: Mon, 8 Apr 2024 17:35:24 +0530 Subject: [PATCH 4/4] chore: upgrade version --- code-analysis/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code-analysis/Chart.yaml b/code-analysis/Chart.yaml index 2ae34bb..b33bbb1 100644 --- a/code-analysis/Chart.yaml +++ b/code-analysis/Chart.yaml @@ -16,7 +16,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: 0.1.2 +version: 0.1.3 # 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