Skip to content

feat: global constraints #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: global constraints
  • Loading branch information
mikhail-klimko committed May 8, 2025
commit 48d9b94ce18b195096f1287dbb5c671f476731fc
6 changes: 3 additions & 3 deletions charts/gitops-runtime/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ dependencies:
version: 7.8.23-3-cap-v2.14.9-2025-04-23-4de04dd8
- name: argo-events
repository: https://codefresh-io.github.io/argo-helm
version: 2.4.7-1-cap-CR-28072
version: 2.4.7-2-cap-CR-28072
- name: argo-workflows
repository: https://codefresh-io.github.io/argo-helm
version: 0.45.2-v3.6.4-cap-CR-27392
version: 0.45.4-v3.6.4-cap-CR-27392
condition: argo-workflows.enabled
- name: argo-rollouts
repository: https://codefresh-io.github.io/argo-helm
version: 2.37.3-3-v1.7.2-cap-CR-28008
version: 2.37.3-4-v1.7.2-cap-CR-28008
condition: argo-rollouts.enabled
- name: sealed-secrets
repository: https://bitnami-labs.github.io/sealed-secrets/
Expand Down
253 changes: 253 additions & 0 deletions charts/gitops-runtime/tests/global_constraints_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ templates:
- hooks/pre-install/validate-values.yaml
- hooks/pre-uninstall/cleanup-resources.yaml
- hooks/pre-uninstall/delete-runtime-from-platform.yaml
- charts/argo-events/*
- charts/argo-rollouts/*
- charts/argo-workflows/*
values:
- ./values/mandatory-values.yaml
tests:
Expand Down Expand Up @@ -807,3 +810,253 @@ tests:
operator: Equal
value: another-value
effect: NoSchedule

- it: argo-events-controller should have nodeSelector from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-events/templates/argo-events-controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: some-value
extra-key: extra-value

- it: argo-events-controller should have nodeSelector from and .Values.argo-events and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-events/templates/argo-events-controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: another-value
foo: bar

- it: argo-events-controller should have tolerations from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-events/templates/argo-events-controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: some-key
operator: Equal
value: some-value
effect: NoSchedule

- it: argo-events-controller should have tolerations from .Values.argo-events and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-events/templates/argo-events-controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: another-key
operator: Equal
value: another-value
effect: NoSchedule

- it: argo-events-webhook should have nodeSelector from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-events/templates/argo-events-webhook/deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: some-value
extra-key: extra-value

- it: argo-events-webhook should have nodeSelector from and .Values.argo-events and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-events/templates/argo-events-webhook/deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: another-value
foo: bar

- it: argo-events-webhook should have tolerations from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-events/templates/argo-events-webhook/deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: some-key
operator: Equal
value: some-value
effect: NoSchedule

- it: argo-events-webhook should have tolerations from .Values.argo-events and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-events/templates/argo-events-webhook/deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: another-key
operator: Equal
value: another-value
effect: NoSchedule

- it: argo-rollouts controller should have nodeSelector from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-rollouts/templates/controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: some-value
extra-key: extra-value

- it: argo-rollouts controller should have nodeSelector from and .Values.argo-rollouts and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-rollouts/templates/controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: another-value
foo: bar

- it: argo-rollouts controller should have tolerations from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-rollouts/templates/controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: some-key
operator: Equal
value: some-value
effect: NoSchedule

- it: argo-rollouts controller should have tolerations from .Values.argo-rollouts and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-rollouts/templates/controller/deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: another-key
operator: Equal
value: another-value
effect: NoSchedule

- it: argo-workflow controller should have nodeSelector from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-workflows/templates/controller/workflow-controller-deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: some-value
extra-key: extra-value

- it: argo-workflow controller should have nodeSelector from and .Values.argo-workflows and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-workflows/templates/controller/workflow-controller-deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: another-value
foo: bar

- it: argo-workflow controller should have tolerations from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-workflows/templates/controller/workflow-controller-deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: some-key
operator: Equal
value: some-value
effect: NoSchedule

- it: argo-workflow controller should have tolerations from .Values.argo-workflows and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-workflows/templates/controller/workflow-controller-deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: another-key
operator: Equal
value: another-value
effect: NoSchedule

- it: argo-workflow server should have nodeSelector from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-workflows/templates/server/server-deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: some-value
extra-key: extra-value

- it: argo-workflow server should have nodeSelector from and .Values.argo-workflows and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-workflows/templates/server/server-deployment.yaml
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
some-key: another-value
foo: bar

- it: argo-workflow server should have tolerations from .Values.global
values:
- ./values/global-constraints-values.yaml
template: charts/argo-workflows/templates/server/server-deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: some-key
operator: Equal
value: some-value
effect: NoSchedule

- it: argo-workflow server should have tolerations from .Values.argo-workflows and NOT from .Values.global
values:
- ./values/global-constraints-values.yaml
- ./values/subcharts-constraints-values.yaml
template: charts/argo-workflows/templates/server/server-deployment.yaml
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: another-key
operator: Equal
value: another-value
effect: NoSchedule
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,24 @@ gitops-operator:
tunnel-client:
nodeSelector: *nodeSelector
tolerations: *tolerations

argo-events:
controller:
nodeSelector: *nodeSelector
tolerations: *tolerations
webhook:
nodeSelector: *nodeSelector
tolerations: *tolerations

argo-rollouts:
controller:
nodeSelector: *nodeSelector
tolerations: *tolerations

argo-workflows:
controller:
nodeSelector: *nodeSelector
tolerations: *tolerations
server:
nodeSelector: *nodeSelector
tolerations: *tolerations