Skip to content

Commit

Permalink
ci: add nodeSelector and tolerations for dedicated prod env node
Browse files Browse the repository at this point in the history
Signed-off-by: Rado <radoslav@dhis2.org>
  • Loading branch information
radnov committed Oct 7, 2024
1 parent b7f0ade commit e0d8002
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helm/data/values/prod/nodeSelector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeSelector:
- im-prod-dedicated: true
5 changes: 5 additions & 0 deletions helm/data/values/prod/tolerations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tolerations:
- key: im-prod-dedicated
operator: Equal
value: true
effect: NoSchedule
57 changes: 57 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
# corsAllowOrigins:
# - "https://{{ .UI_URL }}"

#.im-prod-tolerations-config: &im-prod-tolerations-config
# key: im-prod-dedicated
# operator: Equal
# value: true
# effect: NoSchedule
#
#.im-prod-node-selector-config: &im-prod-node-selector-config
# im-prod-dedicated: true

apiVersion: skaffold/v4beta6
kind: Config
metadata:
Expand Down Expand Up @@ -45,6 +54,9 @@ deploy:
targetPort: 5552
valuesFiles:
- helm/data/secrets/{{ .CLASSIFICATION }}/rabbitmq.yaml
# TODO: using value file/s is another option, but we have to create empty one/s for dev, too
# - helm/data/values/{{ .CLASSIFICATION }}/tolerations.yaml
# - helm/data/values/{{ .CLASSIFICATION }}/nodeSelector.yaml

- name: im-manager-redis-{{ .ENVIRONMENT }}
namespace: instance-manager-{{ .CLASSIFICATION }}
Expand All @@ -57,6 +69,9 @@ deploy:
architecture: standalone
auth:
enabled: false
# valuesFiles:
# - helm/data/values/{{ .CLASSIFICATION }}/tolerations.yaml
# - helm/data/values/{{ .CLASSIFICATION }}/nodeSelector.yaml

- name: im-manager-postgresql-{{ .ENVIRONMENT }}
namespace: instance-manager-{{ .CLASSIFICATION }}
Expand All @@ -69,6 +84,8 @@ deploy:
valuesFiles:
- helm/data/secrets/{{ .CLASSIFICATION }}/postgresql.yaml
- helm/data/values/{{ .CLASSIFICATION }}/postgresql.yaml
# - helm/data/values/{{ .CLASSIFICATION }}/tolerations.yaml
# - helm/data/values/{{ .CLASSIFICATION }}/nodeSelector.yaml

- name: im-manager-{{ .ENVIRONMENT }}
namespace: instance-manager-{{ .CLASSIFICATION }}
Expand Down Expand Up @@ -110,6 +127,8 @@ deploy:
valuesFiles:
- helm/data/secrets/{{ .CLASSIFICATION }}/values.yaml
- helm/data/values/{{ .CLASSIFICATION }}/values.yaml
# - helm/data/values/{{ .CLASSIFICATION }}/tolerations.yaml
# - helm/data/values/{{ .CLASSIFICATION }}/nodeSelector.yaml

profiles:
- name: dev
Expand Down Expand Up @@ -187,3 +206,41 @@ profiles:
name: im-group-implement
namespace: implement
<<: [ *im-group-chart-config, *im-group-prod-service-account-config ]

# TODO: can't refer to a release by name here
# TODO: can't use YAML anchor for patching both at the same time
# - op: add
# path: /deploy/helm/releases/0/setValues/tolerations
# value:
# <<: *im-prod-tolerations-config
# - op: add
# path: /deploy/helm/releases/0/setValues/nodeSelector
# value:
# <<: *im-prod-node-selector-config
#
# - op: add
# path: /deploy/helm/releases/1/setValues/tolerations
# value:
# <<: *im-prod-tolerations-config
# - op: add
# path: /deploy/helm/releases/1/setValues/nodeSelector
# value:
# <<: *im-prod-node-selector-config
#
# - op: add
# path: /deploy/helm/releases/2/setValues/primary/tolerations
# value:
# <<: *im-prod-tolerations-config
# - op: add
# path: /deploy/helm/releases/2/setValues/primary/nodeSelector
# value:
# <<: *im-prod-node-selector-config
#
# - op: add
# path: /deploy/helm/releases/3/setValues/tolerations
# value:
# <<: *im-prod-tolerations-config
# - op: add
# path: /deploy/helm/releases/3/setValues/nodeSelector
# value:
# <<: *im-prod-node-selector-config

0 comments on commit e0d8002

Please sign in to comment.