Skip to content

Commit

Permalink
Merge pull request #2 from Privado-Inc/feat/node-opts
Browse files Browse the repository at this point in the history
Feat: node opts
  • Loading branch information
ojaswa1942 authored Apr 8, 2024
2 parents 8e62b91 + a3d5953 commit fe97738
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code-analysis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion code-analysis/templates/andromeda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .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 }}
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
Expand Down
15 changes: 15 additions & 0 deletions code-analysis/templates/bishamonten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ spec:
imagePullSecrets:
- name: {{ .Values.base.imagePullSecret }}
restartPolicy: {{ .Values.base.podRestartPolicy }}
{{- if .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 }}
Expand Down
4 changes: 4 additions & 0 deletions code-analysis/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
17 changes: 16 additions & 1 deletion code-analysis/templates/mastervendor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ spec:
imagePullSecrets:
- name: {{ .Values.base.imagePullSecret }}
restartPolicy: {{ .Values.mastervendor.podRestartPolicy }}
{{- if .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 }}
Expand Down Expand Up @@ -57,4 +72,4 @@ spec:
{{- end }}
{{- end}}
{{- end}}
{{- end}}
{{- end}}
15 changes: 15 additions & 0 deletions code-analysis/templates/mongo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ spec:
spec:
restartPolicy: {{ .Values.base.podRestartPolicy }}
terminationGracePeriodSeconds: 15
{{- if .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
Expand Down
14 changes: 13 additions & 1 deletion code-analysis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe97738

Please sign in to comment.