From afb2d839d017b85ea74c76aaaa036025a77d61b5 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 2 Feb 2023 14:48:45 +0200 Subject: [PATCH] controllers -> workload and plurar to singular --- library/common-test/ci/configmap-values.yaml | 2 +- .../ci/imagePullSecret-values.yaml | 4 +- library/common-test/ci/secret-values.yaml | 4 +- .../tests/configmap/data_test.yaml | 10 +- .../tests/configmap/metadata_test.yaml | 2 +- .../tests/configmap/name_test.yaml | 2 +- .../tests/configmap/validation_test.yaml | 12 +- .../tests/cronjob/metadata_test.yaml | 22 ++- .../common-test/tests/cronjob/spec_test.yaml | 10 +- .../tests/cronjob/validation_test.yaml | 12 +- .../tests/daemonset/metadata_test.yaml | 26 ++-- .../tests/daemonset/spec_test.yaml | 10 +- .../tests/daemonset/validation_test.yaml | 8 +- .../tests/deployment/metadata_test.yaml | 26 ++-- .../tests/deployment/spec_test.yaml | 10 +- .../tests/deployment/validation_test.yaml | 8 +- .../tests/imagePullSecret/data_test.yaml | 6 +- .../tests/imagePullSecret/metadata_test.yaml | 4 +- .../tests/imagePullSecret/name_test.yaml | 4 +- .../imagePullSecret/validation_test.yaml | 22 +-- .../common-test/tests/job/metadata_test.yaml | 22 ++- library/common-test/tests/job/spec_test.yaml | 10 +- .../tests/job/validation_test.yaml | 12 +- .../tests/pod/automount_sa_token_test.yaml | 16 +-- .../tests/pod/dns_config_test.yaml | 36 ++--- .../tests/pod/dns_policy_test.yaml | 24 ++-- .../tests/pod/enable_service_links_test.yaml | 16 +-- .../tests/pod/host-aliases_test.yaml | 16 +-- .../tests/pod/host_network_test.yaml | 16 +-- .../common-test/tests/pod/hostname_test.yaml | 12 +- .../tests/pod/image_pull_secret_test.yaml | 36 ++--- .../tests/pod/node_selector_test.yaml | 20 +-- .../tests/pod/priority_class_name_test.yaml | 16 +-- .../tests/pod/restart_policy_test.yaml | 40 +++--- .../tests/pod/runtime_class_name_test.yaml | 42 +++--- .../tests/pod/scheduler_name_test.yaml | 16 +-- .../tests/pod/service_account_name_test.yaml | 40 +++--- .../pod/termination_grace_period_test.yaml | 16 +-- .../tests/pod/tolerations_test.yaml | 40 +++--- .../common-test/tests/secret/data_test.yaml | 12 +- .../tests/secret/metadata_test.yaml | 2 +- .../common-test/tests/secret/name_test.yaml | 2 +- .../tests/secret/validation_test.yaml | 14 +- .../tests/serviceAccount/metadata_test.yaml | 2 +- .../tests/serviceAccount/name_test.yaml | 2 +- .../tests/serviceAccount/validation_test.yaml | 10 +- .../tests/statefulset/metadata_test.yaml | 26 ++-- .../tests/statefulset/spec_test.yaml | 10 +- .../tests/statefulset/validation_test.yaml | 8 +- .../{controller => workload}/names_test.yaml | 98 ++++++------- .../validation_test.yaml | 56 ++++---- library/common-test/values.yaml | 6 +- library/common/1.0.0/docs/configmap.md | 48 +++++++ library/common/1.0.0/docs/configmaps.md | 48 ------- library/common/1.0.0/docs/controllers.md | 133 ------------------ library/common/1.0.0/docs/cronjob.md | 36 ++--- library/common/1.0.0/docs/daemonset.md | 23 +-- library/common/1.0.0/docs/deployment.md | 22 +-- library/common/1.0.0/docs/imagePullSecret.md | 66 +++++++++ library/common/1.0.0/docs/imagePullSecrets.md | 66 --------- library/common/1.0.0/docs/job.md | 24 ++-- library/common/1.0.0/docs/secret.md | 50 +++++++ library/common/1.0.0/docs/secrets.md | 50 ------- library/common/1.0.0/docs/serviceAccount.md | 52 +++++++ library/common/1.0.0/docs/serviceAccounts.md | 52 ------- library/common/1.0.0/docs/statefulset.md | 22 +-- library/common/1.0.0/docs/workload.md | 132 +++++++++++++++++ .../1.0.0/templates/classes/_cronjob.tpl | 6 +- .../1.0.0/templates/classes/_daemonset.tpl | 6 +- .../1.0.0/templates/classes/_deployment.tpl | 6 +- .../common/1.0.0/templates/classes/_job.tpl | 6 +- .../1.0.0/templates/classes/_statefulset.tpl | 6 +- .../validation/_controllerValidation.tpl | 63 --------- ...gePullSecrets.tpl => _imagePullSecret.tpl} | 6 +- .../templates/lib/pod/_serviceAccountName.tpl | 2 +- .../lib/serviceAccount/_validation.tpl | 2 +- .../{controller => workload}/_cronjobSpec.tpl | 6 +- .../_daemonsetSpec.tpl | 4 +- .../_deployementSpec.tpl | 4 +- .../lib/{controller => workload}/_jobSpec.tpl | 4 +- .../lib/{controller => workload}/_pod.tpl | 6 +- .../_statefulsettSpec.tpl | 4 +- .../validation/_cronjobValidation.tpl | 6 +- .../validation/_daemonsetValidation.tpl | 4 +- .../validation/_deploymentValidation.tpl | 4 +- .../validation/_jobValidation.tpl | 4 +- .../validation/_statefusetValidation.tpl | 4 +- .../validation/_workloadValidation.tpl | 63 +++++++++ .../common/1.0.0/templates/loader/_apply.tpl | 12 +- .../1.0.0/templates/spawner/_configmap.tpl | 6 +- .../templates/spawner/_imagePullSecret.tpl | 6 +- .../1.0.0/templates/spawner/_secret.tpl | 6 +- .../templates/spawner/_serviceAccount.tpl | 6 +- .../{_controller.tpl => _workload.tpl} | 24 ++-- library/common/1.0.0/values.yaml | 42 +++--- 95 files changed, 1040 insertions(+), 1000 deletions(-) rename library/common-test/tests/{controller => workload}/names_test.yaml (69%) rename library/common-test/tests/{controller => workload}/validation_test.yaml (52%) create mode 100644 library/common/1.0.0/docs/configmap.md delete mode 100644 library/common/1.0.0/docs/configmaps.md delete mode 100644 library/common/1.0.0/docs/controllers.md create mode 100644 library/common/1.0.0/docs/imagePullSecret.md delete mode 100644 library/common/1.0.0/docs/imagePullSecrets.md create mode 100644 library/common/1.0.0/docs/secret.md delete mode 100644 library/common/1.0.0/docs/secrets.md create mode 100644 library/common/1.0.0/docs/serviceAccount.md delete mode 100644 library/common/1.0.0/docs/serviceAccounts.md create mode 100644 library/common/1.0.0/docs/workload.md delete mode 100644 library/common/1.0.0/templates/lib/controller/validation/_controllerValidation.tpl rename library/common/1.0.0/templates/lib/pod/{_imagePullSecrets.tpl => _imagePullSecret.tpl} (84%) rename library/common/1.0.0/templates/lib/{controller => workload}/_cronjobSpec.tpl (81%) rename library/common/1.0.0/templates/lib/{controller => workload}/_daemonsetSpec.tpl (85%) rename library/common/1.0.0/templates/lib/{controller => workload}/_deployementSpec.tpl (85%) rename library/common/1.0.0/templates/lib/{controller => workload}/_jobSpec.tpl (92%) rename library/common/1.0.0/templates/lib/{controller => workload}/_pod.tpl (90%) rename library/common/1.0.0/templates/lib/{controller => workload}/_statefulsettSpec.tpl (86%) rename library/common/1.0.0/templates/lib/{controller => workload}/validation/_cronjobValidation.tpl (79%) rename library/common/1.0.0/templates/lib/{controller => workload}/validation/_daemonsetValidation.tpl (85%) rename library/common/1.0.0/templates/lib/{controller => workload}/validation/_deploymentValidation.tpl (85%) rename library/common/1.0.0/templates/lib/{controller => workload}/validation/_jobValidation.tpl (88%) rename library/common/1.0.0/templates/lib/{controller => workload}/validation/_statefusetValidation.tpl (85%) create mode 100644 library/common/1.0.0/templates/lib/workload/validation/_workloadValidation.tpl rename library/common/1.0.0/templates/spawner/{_controller.tpl => _workload.tpl} (69%) diff --git a/library/common-test/ci/configmap-values.yaml b/library/common-test/ci/configmap-values.yaml index 9d4938f00c..a42c709568 100644 --- a/library/common-test/ci/configmap-values.yaml +++ b/library/common-test/ci/configmap-values.yaml @@ -10,7 +10,7 @@ service: protocol: HTTP port: 8080 -controllers: +workload: main: pod: containers: diff --git a/library/common-test/ci/imagePullSecret-values.yaml b/library/common-test/ci/imagePullSecret-values.yaml index 53ea1771ec..a0e8b8dcf8 100644 --- a/library/common-test/ci/imagePullSecret-values.yaml +++ b/library/common-test/ci/imagePullSecret-values.yaml @@ -10,7 +10,7 @@ service: protocol: HTTP port: 8080 -controllers: +workload: main: pod: containers: @@ -31,7 +31,7 @@ user: user pass: secret_pass email: mail@example.com -imagePullSecrets: +imagePullSecret: image-secret-name: enabled: true labels: {} diff --git a/library/common-test/ci/secret-values.yaml b/library/common-test/ci/secret-values.yaml index 80eefff028..ab4c3db282 100644 --- a/library/common-test/ci/secret-values.yaml +++ b/library/common-test/ci/secret-values.yaml @@ -10,7 +10,7 @@ service: protocol: HTTP port: 8080 -controllers: +workload: main: pod: containers: @@ -33,7 +33,7 @@ key4: value2 key5: 81 key6: false -secrets: +secret: kv-test: enabled: true data: diff --git a/library/common-test/tests/configmap/data_test.yaml b/library/common-test/tests/configmap/data_test.yaml index bc4422915b..6ff35063e7 100644 --- a/library/common-test/tests/configmap/data_test.yaml +++ b/library/common-test/tests/configmap/data_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should pass with key-value data set: - configmaps: + configmap: my-configmap1: enabled: true data: @@ -22,7 +22,7 @@ tests: - it: should pass with key-value data from tpl set: data: bar - configmaps: + configmap: my-configmap1: enabled: true data: @@ -36,7 +36,7 @@ tests: - it: should pass with scalar data set: - configmaps: + configmap: my-configmap1: enabled: true data: @@ -55,7 +55,7 @@ tests: - it: should pass with scalar data with tpl set: data: Some other text - configmaps: + configmap: my-configmap: enabled: true data: @@ -76,7 +76,7 @@ tests: data: | Some other text some_text - configmaps: + configmap: my-configmap1: enabled: true data: diff --git a/library/common-test/tests/configmap/metadata_test.yaml b/library/common-test/tests/configmap/metadata_test.yaml index 6b9d0530c0..c3a5084ab6 100644 --- a/library/common-test/tests/configmap/metadata_test.yaml +++ b/library/common-test/tests/configmap/metadata_test.yaml @@ -17,7 +17,7 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - configmaps: + configmap: my-configmap1: enabled: true labels: diff --git a/library/common-test/tests/configmap/name_test.yaml b/library/common-test/tests/configmap/name_test.yaml index 06b2cb010c..7419b24cae 100644 --- a/library/common-test/tests/configmap/name_test.yaml +++ b/library/common-test/tests/configmap/name_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should generate correct name set: - configmaps: + configmap: my-configmap1: enabled: true data: diff --git a/library/common-test/tests/configmap/validation_test.yaml b/library/common-test/tests/configmap/validation_test.yaml index 0df4242b3e..cecd9cd4ff 100644 --- a/library/common-test/tests/configmap/validation_test.yaml +++ b/library/common-test/tests/configmap/validation_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should fail with name longer than 63 characters set: - configmaps: + configmap: my-configmap-super-long-name-that-is-longer-than-63-characters: enabled: true data: @@ -15,7 +15,7 @@ tests: - it: should fail with name starting with underscore set: - configmaps: + configmap: _my-configmap: enabled: true data: @@ -26,7 +26,7 @@ tests: - it: should fail with labels not a dict set: - configmaps: + configmap: my-configmap: enabled: true labels: "not a dict" @@ -38,7 +38,7 @@ tests: - it: should fail with annotations not a dict set: - configmaps: + configmap: my-configmap: enabled: true annotations: "not a dict" @@ -50,7 +50,7 @@ tests: - it: should fail with data not a dict set: - configmaps: + configmap: my-configmap: enabled: true data: "not a dict" @@ -60,7 +60,7 @@ tests: - it: should fail with empty data set: - configmaps: + configmap: my-configmap: enabled: true data: {} diff --git a/library/common-test/tests/cronjob/metadata_test.yaml b/library/common-test/tests/cronjob/metadata_test.yaml index 0437237a2a..2c6cf9f95f 100644 --- a/library/common-test/tests/cronjob/metadata_test.yaml +++ b/library/common-test/tests/cronjob/metadata_test.yaml @@ -17,8 +17,8 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: CronJob @@ -86,14 +86,14 @@ tests: - it: should pass with 2 cronjob created with correct selector labels set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: CronJob schedule: "*/1 * * * *" podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: CronJob @@ -103,20 +103,28 @@ tests: - documentIndex: *cronJobDoc isKind: of: CronJob + - documentIndex: *cronJobDoc + equal: + path: metadata.name + value: release-name-common-test-other-workload-name - documentIndex: *cronJobDoc isSubset: path: spec.jobTemplate.spec.template.metadata.labels content: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test - documentIndex: &otherCronJobDoc 1 isKind: of: CronJob + - documentIndex: *otherCronJobDoc + equal: + path: metadata.name + value: release-name-common-test - documentIndex: *otherCronJobDoc isSubset: path: spec.jobTemplate.spec.template.metadata.labels content: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test diff --git a/library/common-test/tests/cronjob/spec_test.yaml b/library/common-test/tests/cronjob/spec_test.yaml index 0314da8fdf..1705fce747 100644 --- a/library/common-test/tests/cronjob/spec_test.yaml +++ b/library/common-test/tests/cronjob/spec_test.yaml @@ -2,10 +2,10 @@ suite: cronjob spec test templates: - common.yaml tests: - - it: should pass with controller enabled + - it: should pass with workload enabled set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: CronJob @@ -42,8 +42,8 @@ tests: set: cron: "*/5 * * * *" someTZ: America/New_York - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: CronJob diff --git a/library/common-test/tests/cronjob/validation_test.yaml b/library/common-test/tests/cronjob/validation_test.yaml index 13f686d191..77c1771fb0 100644 --- a/library/common-test/tests/cronjob/validation_test.yaml +++ b/library/common-test/tests/cronjob/validation_test.yaml @@ -4,8 +4,8 @@ templates: tests: - it: should fail with invalid concurrencyPolicy set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: CronJob @@ -17,8 +17,8 @@ tests: - it: should fail with empty schedule set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: CronJob @@ -30,8 +30,8 @@ tests: - it: should fail with invalid completionMode (make sure job validation kicks in) set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: CronJob diff --git a/library/common-test/tests/daemonset/metadata_test.yaml b/library/common-test/tests/daemonset/metadata_test.yaml index d3109ab056..753a8aafeb 100644 --- a/library/common-test/tests/daemonset/metadata_test.yaml +++ b/library/common-test/tests/daemonset/metadata_test.yaml @@ -17,8 +17,8 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: DaemonSet @@ -92,13 +92,13 @@ tests: - it: should pass with 2 daemonset created with correct selector labels set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: DaemonSet podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: DaemonSet @@ -107,34 +107,42 @@ tests: - documentIndex: *daemonSetDoc isKind: of: DaemonSet + - documentIndex: *daemonSetDoc + equal: + path: metadata.name + value: release-name-common-test-other-workload-name - documentIndex: *daemonSetDoc equal: path: spec.selector.matchLabels value: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/name: common-test app.kubernetes.io/instance: RELEASE-NAME - documentIndex: *daemonSetDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test - documentIndex: &otherDaemonSetDoc 1 isKind: of: DaemonSet + - documentIndex: *otherDaemonSetDoc + equal: + path: metadata.name + value: release-name-common-test - documentIndex: *otherDaemonSetDoc equal: path: spec.selector.matchLabels value: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/name: common-test app.kubernetes.io/instance: RELEASE-NAME - documentIndex: *otherDaemonSetDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test diff --git a/library/common-test/tests/daemonset/spec_test.yaml b/library/common-test/tests/daemonset/spec_test.yaml index 74be831223..fd325fc9c9 100644 --- a/library/common-test/tests/daemonset/spec_test.yaml +++ b/library/common-test/tests/daemonset/spec_test.yaml @@ -2,10 +2,10 @@ suite: daemonset spec test templates: - common.yaml tests: - - it: should pass with controller enabled + - it: should pass with workload enabled set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: DaemonSet @@ -27,8 +27,8 @@ tests: - it: should apply spec correctly set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: DaemonSet diff --git a/library/common-test/tests/daemonset/validation_test.yaml b/library/common-test/tests/daemonset/validation_test.yaml index f8a6278dc7..aa80c7e94f 100644 --- a/library/common-test/tests/daemonset/validation_test.yaml +++ b/library/common-test/tests/daemonset/validation_test.yaml @@ -4,8 +4,8 @@ templates: tests: - it: should fail with invalid strategy set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: DaemonSet @@ -17,8 +17,8 @@ tests: - it: should fail with rollingUpdate not a dict set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: DaemonSet diff --git a/library/common-test/tests/deployment/metadata_test.yaml b/library/common-test/tests/deployment/metadata_test.yaml index 696d1bf6c7..cf506f77d5 100644 --- a/library/common-test/tests/deployment/metadata_test.yaml +++ b/library/common-test/tests/deployment/metadata_test.yaml @@ -17,8 +17,8 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment @@ -92,13 +92,13 @@ tests: - it: should pass with 2 deployment created with correct selector labels set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: Deployment @@ -107,34 +107,42 @@ tests: - documentIndex: *deploymentDoc isKind: of: Deployment + - documentIndex: *deploymentDoc + equal: + path: metadata.name + value: release-name-common-test-other-workload-name - documentIndex: *deploymentDoc equal: path: spec.selector.matchLabels value: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/name: common-test app.kubernetes.io/instance: RELEASE-NAME - documentIndex: *deploymentDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test - documentIndex: &otherDeploymentDoc 1 isKind: of: Deployment + - documentIndex: *otherDeploymentDoc + equal: + path: metadata.name + value: release-name-common-test - documentIndex: *otherDeploymentDoc equal: path: spec.selector.matchLabels value: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/name: common-test app.kubernetes.io/instance: RELEASE-NAME - documentIndex: *otherDeploymentDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test diff --git a/library/common-test/tests/deployment/spec_test.yaml b/library/common-test/tests/deployment/spec_test.yaml index e65e7b5fb5..c5093f5a83 100644 --- a/library/common-test/tests/deployment/spec_test.yaml +++ b/library/common-test/tests/deployment/spec_test.yaml @@ -2,10 +2,10 @@ suite: deployment spec test templates: - common.yaml tests: - - it: should pass with controller enabled + - it: should pass with workload enabled set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment @@ -28,8 +28,8 @@ tests: - it: should apply spec correctly set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/deployment/validation_test.yaml b/library/common-test/tests/deployment/validation_test.yaml index ff23803847..2d08f3cc50 100644 --- a/library/common-test/tests/deployment/validation_test.yaml +++ b/library/common-test/tests/deployment/validation_test.yaml @@ -4,8 +4,8 @@ templates: tests: - it: should fail with invalid strategy set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment @@ -17,8 +17,8 @@ tests: - it: should fail with rollingUpdate not a dict set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/imagePullSecret/data_test.yaml b/library/common-test/tests/imagePullSecret/data_test.yaml index c73fc58ad8..cdf40653e6 100644 --- a/library/common-test/tests/imagePullSecret/data_test.yaml +++ b/library/common-test/tests/imagePullSecret/data_test.yaml @@ -1,10 +1,10 @@ -suite: imagePullSecrets data test +suite: imagePullSecret data test templates: - common.yaml tests: - it: should pass with data set: - imagePullSecrets: + imagePullSecret: my-secret1: enabled: true data: @@ -32,7 +32,7 @@ tests: user: user pass: secret_pass email: mail@example.com - imagePullSecrets: + imagePullSecret: my-secret1: enabled: true data: diff --git a/library/common-test/tests/imagePullSecret/metadata_test.yaml b/library/common-test/tests/imagePullSecret/metadata_test.yaml index 87acfe34f7..4eb3b99136 100644 --- a/library/common-test/tests/imagePullSecret/metadata_test.yaml +++ b/library/common-test/tests/imagePullSecret/metadata_test.yaml @@ -1,4 +1,4 @@ -suite: imagePullSecrets metadata test +suite: imagePullSecret metadata test templates: - common.yaml chart: @@ -17,7 +17,7 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - imagePullSecrets: + imagePullSecret: my-secret1: enabled: true labels: diff --git a/library/common-test/tests/imagePullSecret/name_test.yaml b/library/common-test/tests/imagePullSecret/name_test.yaml index 51430e70e3..4b6b0988f3 100644 --- a/library/common-test/tests/imagePullSecret/name_test.yaml +++ b/library/common-test/tests/imagePullSecret/name_test.yaml @@ -1,10 +1,10 @@ -suite: imagePullSecrets name test +suite: imagePullSecret name test templates: - common.yaml tests: - it: should generate correct name set: - imagePullSecrets: + imagePullSecret: my-pull-secret1: enabled: true data: diff --git a/library/common-test/tests/imagePullSecret/validation_test.yaml b/library/common-test/tests/imagePullSecret/validation_test.yaml index 550a2bcd65..6c1f61f87d 100644 --- a/library/common-test/tests/imagePullSecret/validation_test.yaml +++ b/library/common-test/tests/imagePullSecret/validation_test.yaml @@ -1,10 +1,10 @@ -suite: imagePullSecrets validation test +suite: imagePullSecret validation test templates: - common.yaml tests: - it: should fail with name longer than 63 characters set: - imagePullSecrets: + imagePullSecret: my-pull-secret-super-long-name-that-is-longer-than-63-characters: enabled: true data: &data @@ -18,7 +18,7 @@ tests: - it: should fail with name starting with underscore set: - imagePullSecrets: + imagePullSecret: _my-pull-secret: enabled: true data: *data @@ -28,7 +28,7 @@ tests: - it: should fail with labels not a dict set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true labels: "not a dict" @@ -39,7 +39,7 @@ tests: - it: should fail with annotations not a dict set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true annotations: "not a dict" @@ -50,7 +50,7 @@ tests: - it: should fail with data not a dict set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true data: "not a dict" @@ -60,7 +60,7 @@ tests: - it: should fail with empty data set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true data: {} @@ -70,7 +70,7 @@ tests: - it: should fail with empty registry key set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true type: "" @@ -85,7 +85,7 @@ tests: - it: should fail with empty username key set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true type: "" @@ -100,7 +100,7 @@ tests: - it: should fail with empty password key set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true type: "" @@ -115,7 +115,7 @@ tests: - it: should fail with empty email key set: - imagePullSecrets: + imagePullSecret: my-pull-secret: enabled: true type: "" diff --git a/library/common-test/tests/job/metadata_test.yaml b/library/common-test/tests/job/metadata_test.yaml index 40daad116e..b4dda69ddb 100644 --- a/library/common-test/tests/job/metadata_test.yaml +++ b/library/common-test/tests/job/metadata_test.yaml @@ -17,8 +17,8 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Job @@ -85,13 +85,13 @@ tests: - it: should pass with 2 job created with correct selector labels set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Job podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: Job @@ -100,20 +100,28 @@ tests: - documentIndex: *jobDoc isKind: of: Job + - documentIndex: *jobDoc + equal: + path: metadata.name + value: release-name-common-test-other-workload-name - documentIndex: *jobDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test - documentIndex: &otherJobDoc 1 isKind: of: Job + - documentIndex: *otherJobDoc + equal: + path: metadata.name + value: release-name-common-test - documentIndex: *otherJobDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test diff --git a/library/common-test/tests/job/spec_test.yaml b/library/common-test/tests/job/spec_test.yaml index 52c6272498..bef4f4145e 100644 --- a/library/common-test/tests/job/spec_test.yaml +++ b/library/common-test/tests/job/spec_test.yaml @@ -2,10 +2,10 @@ suite: job spec test templates: - common.yaml tests: - - it: should pass with controller enabled + - it: should pass with workload enabled set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Job @@ -29,8 +29,8 @@ tests: - it: should apply spec correctly set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Job diff --git a/library/common-test/tests/job/validation_test.yaml b/library/common-test/tests/job/validation_test.yaml index cc0ff197df..2a2f0d0a8b 100644 --- a/library/common-test/tests/job/validation_test.yaml +++ b/library/common-test/tests/job/validation_test.yaml @@ -4,8 +4,8 @@ templates: tests: - it: should fail with invalid completionMode set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Job @@ -17,8 +17,8 @@ tests: - it: should fail with completionMode to Indexed and no completions set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Job @@ -31,8 +31,8 @@ tests: - it: should fail with completionMode to Indexed and no parallelism set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Job diff --git a/library/common-test/tests/pod/automount_sa_token_test.yaml b/library/common-test/tests/pod/automount_sa_token_test.yaml index f4faf383ef..8511e16f36 100644 --- a/library/common-test/tests/pod/automount_sa_token_test.yaml +++ b/library/common-test/tests/pod/automount_sa_token_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: automountServiceAccountToken: false - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -25,8 +25,8 @@ tests: set: podOptions: automountServiceAccountToken: true - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -44,8 +44,8 @@ tests: set: podOptions: automountServiceAccountToken: true - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -61,8 +61,8 @@ tests: set: podOptions: automountServiceAccountToken: false - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/pod/dns_config_test.yaml b/library/common-test/tests/pod/dns_config_test.yaml index d41ae2e54c..798c0d6473 100644 --- a/library/common-test/tests/pod/dns_config_test.yaml +++ b/library/common-test/tests/pod/dns_config_test.yaml @@ -9,8 +9,8 @@ tests: nameservers: [] searches: [] options: [] - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -37,8 +37,8 @@ tests: - name: ndots value: "2" - name: edns0 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -69,8 +69,8 @@ tests: - example.org options: - name: edns0 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -108,8 +108,8 @@ tests: s1: example.com property: ndots value: 2 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -147,8 +147,8 @@ tests: set: podOptions: dnsPolicy: None - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -163,8 +163,8 @@ tests: set: podOptions: dnsPolicy: None - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -181,8 +181,8 @@ tests: set: podOptions: dnsPolicy: None - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -199,8 +199,8 @@ tests: - it: should fail with more than 3 nameservers set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -217,8 +217,8 @@ tests: - it: should fail with more than 6 Searches set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/pod/dns_policy_test.yaml b/library/common-test/tests/pod/dns_policy_test.yaml index 2e474ae76c..20acfe7b51 100644 --- a/library/common-test/tests/pod/dns_policy_test.yaml +++ b/library/common-test/tests/pod/dns_policy_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: dnsPolicy: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -25,8 +25,8 @@ tests: set: podOptions: dnsPolicy: Default - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -41,8 +41,8 @@ tests: set: podOptions: dnsPolicy: None - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -59,8 +59,8 @@ tests: policy: ClusterFirst podOptions: dnsPolicy: None - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -76,8 +76,8 @@ tests: set: podOptions: dnsPolicy: None - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -95,8 +95,8 @@ tests: set: podOptions: dnsPolicy: Invalid - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/pod/enable_service_links_test.yaml b/library/common-test/tests/pod/enable_service_links_test.yaml index 1ee9fe93b7..9ce37a6b27 100644 --- a/library/common-test/tests/pod/enable_service_links_test.yaml +++ b/library/common-test/tests/pod/enable_service_links_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: enableServiceLinks: false - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet @@ -25,8 +25,8 @@ tests: set: podOptions: enableServiceLinks: true - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet @@ -44,8 +44,8 @@ tests: set: podOptions: enableServiceLinks: true - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet @@ -61,8 +61,8 @@ tests: set: podOptions: enableServiceLinks: false - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet diff --git a/library/common-test/tests/pod/host-aliases_test.yaml b/library/common-test/tests/pod/host-aliases_test.yaml index 58303d609d..0d4634cb74 100644 --- a/library/common-test/tests/pod/host-aliases_test.yaml +++ b/library/common-test/tests/pod/host-aliases_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: hostAliases: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -32,8 +32,8 @@ tests: hostnames: - myotherserver.local - backups.local - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -64,8 +64,8 @@ tests: hostnames: - myotherserver.local - backups.local - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -104,8 +104,8 @@ tests: hostnames: - myserver.local - storage.local - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/pod/host_network_test.yaml b/library/common-test/tests/pod/host_network_test.yaml index 17595e416d..e4b5147cf2 100644 --- a/library/common-test/tests/pod/host_network_test.yaml +++ b/library/common-test/tests/pod/host_network_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: hostNetwork: false - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -25,8 +25,8 @@ tests: set: podOptions: hostNetwork: true - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -44,8 +44,8 @@ tests: set: podOptions: hostNetwork: true - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -61,8 +61,8 @@ tests: set: podOptions: hostNetwork: false - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/pod/hostname_test.yaml b/library/common-test/tests/pod/hostname_test.yaml index 1b72d5e72a..5ede7743aa 100644 --- a/library/common-test/tests/pod/hostname_test.yaml +++ b/library/common-test/tests/pod/hostname_test.yaml @@ -4,8 +4,8 @@ templates: tests: - it: should pass with empty hostname set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: StatefulSet @@ -20,8 +20,8 @@ tests: - it: should pass with hostname set set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: StatefulSet @@ -39,8 +39,8 @@ tests: - it: should pass with hostname from "pod" with tpl set: host: some-other-hostname - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: StatefulSet diff --git a/library/common-test/tests/pod/image_pull_secret_test.yaml b/library/common-test/tests/pod/image_pull_secret_test.yaml index 541514abdf..95b92d0b09 100644 --- a/library/common-test/tests/pod/image_pull_secret_test.yaml +++ b/library/common-test/tests/pod/image_pull_secret_test.yaml @@ -2,21 +2,21 @@ suite: pod imagePullSecret test templates: - common.yaml tests: - - it: should assign multiple imagePullSecrets to primary pod + - it: should assign multiple imagePullSecret to primary pod set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: CronJob schedule: "* * * * *" podSpec: {} - controller-name2: + workload-name2: enabled: true primary: false type: Deployment podSpec: {} - imagePullSecrets: + imagePullSecret: pull-secret1: enabled: true data: @@ -52,20 +52,20 @@ tests: isNull: path: spec.template.spec.imagePullSecrets - - it: should assign multiple imagePullSecrets to all pods + - it: should assign multiple imagePullSecret to all pods set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment podSpec: {} - controller-name2: + workload-name2: enabled: true primary: false type: Deployment podSpec: {} - imagePullSecrets: + imagePullSecret: pull-secret1: enabled: true data: @@ -102,20 +102,20 @@ tests: - name: release-name-common-test-pull-secret1 - name: release-name-common-test-pull-secret2 - - it: should assign imagePullSecrets to selected pods + - it: should assign imagePullSecret to selected pods set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet podSpec: {} - controller-name2: + workload-name2: enabled: true primary: false type: Deployment podSpec: {} - imagePullSecrets: + imagePullSecret: pull-secret1: enabled: true data: @@ -124,8 +124,8 @@ tests: password: pass email: mail targetSelector: - - controller-name1 - - controller-name2 + - workload-name1 + - workload-name2 pull-secret2: enabled: true data: @@ -134,7 +134,7 @@ tests: password: pass email: mail targetSelector: - - controller-name1 + - workload-name1 asserts: - documentIndex: &daemonSetDoc 2 isKind: diff --git a/library/common-test/tests/pod/node_selector_test.yaml b/library/common-test/tests/pod/node_selector_test.yaml index 84a5efe448..1596780177 100644 --- a/library/common-test/tests/pod/node_selector_test.yaml +++ b/library/common-test/tests/pod/node_selector_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: nodeSelector: {} - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: CronJob @@ -27,8 +27,8 @@ tests: nodeSelector: disk: ssd cpu: intel - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: CronJob @@ -48,8 +48,8 @@ tests: nodeSelector: disk: ssd cpu: intel - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: CronJob @@ -73,8 +73,8 @@ tests: nodeSelector: disk: ssd cpu: intel - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: CronJob @@ -96,8 +96,8 @@ tests: podOptions: nodeSelector: disk: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: CronJob diff --git a/library/common-test/tests/pod/priority_class_name_test.yaml b/library/common-test/tests/pod/priority_class_name_test.yaml index de777c1fbb..19e49ff7e6 100644 --- a/library/common-test/tests/pod/priority_class_name_test.yaml +++ b/library/common-test/tests/pod/priority_class_name_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: priorityClassName: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -24,8 +24,8 @@ tests: set: podOptions: priorityClassName: some-priority-class - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -40,8 +40,8 @@ tests: set: podOptions: priorityClassName: some-priority-class - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -58,8 +58,8 @@ tests: priorityClass: some-other-priority-class podOptions: priorityClassName: some-priority-class - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/pod/restart_policy_test.yaml b/library/common-test/tests/pod/restart_policy_test.yaml index 408b33ab72..0713aedd64 100644 --- a/library/common-test/tests/pod/restart_policy_test.yaml +++ b/library/common-test/tests/pod/restart_policy_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: restartPolicy: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -25,8 +25,8 @@ tests: set: podOptions: restartPolicy: Always - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -41,8 +41,8 @@ tests: set: podOptions: restartPolicy: Never - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -58,8 +58,8 @@ tests: set: podOptions: restartPolicy: Never - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Job @@ -79,8 +79,8 @@ tests: policy: OnFailure podOptions: restartPolicy: Never - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Job @@ -97,8 +97,8 @@ tests: set: podOptions: restartPolicy: Never - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -111,8 +111,8 @@ tests: set: podOptions: restartPolicy: Never - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet @@ -125,8 +125,8 @@ tests: set: podOptions: restartPolicy: Never - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: StatefulSet @@ -139,8 +139,8 @@ tests: set: podOptions: restartPolicy: invalid - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: StatefulSet @@ -153,8 +153,8 @@ tests: set: podOptions: restartPolicy: invalid - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: StatefulSet diff --git a/library/common-test/tests/pod/runtime_class_name_test.yaml b/library/common-test/tests/pod/runtime_class_name_test.yaml index fa8624a72d..4c5c364f34 100644 --- a/library/common-test/tests/pod/runtime_class_name_test.yaml +++ b/library/common-test/tests/pod/runtime_class_name_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: runtimeClassName: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -24,8 +24,8 @@ tests: set: podOptions: runtimeClassName: some-runtime-class - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -40,8 +40,8 @@ tests: set: podOptions: runtimeClassName: some-runtime-class - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -58,8 +58,8 @@ tests: runtimeClass: some-other-runtime-class podOptions: runtimeClassName: some-runtime-class - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -77,9 +77,9 @@ tests: - gpu: key: value targetSelector: - controller-name1: + workload-name1: - container-name1 - controller-name3: + workload-name3: - container-name1 global: ixChartContext: @@ -87,20 +87,20 @@ tests: nvidiaRuntimeClassName: ix-runtime podOptions: runtimeClassName: some-class - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment podSpec: runtimeClassName: some-other-class - controller-name2: + workload-name2: enabled: true primary: false type: DaemonSet podSpec: runtimeClassName: some-class - controller-name3: + workload-name3: enabled: true primary: false type: StatefulSet @@ -126,7 +126,7 @@ tests: path: spec.template.spec.runtimeClassName value: ix-runtime - - it: should pass with runtimeClassName from ixChartContext without targetSelector (on primary controller) + - it: should pass with runtimeClassName from ixChartContext without targetSelector (on primary workload) set: scaleGPU: - gpu: @@ -135,14 +135,14 @@ tests: ixChartContext: addNvidiaRuntimeClass: true nvidiaRuntimeClassName: ix-runtime - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Job podSpec: runtimeClassName: some-other-class - controller-name2: + workload-name2: enabled: true primary: false type: CronJob @@ -168,14 +168,14 @@ tests: scaleGPU: - gpu: {} targetSelector: - controller-name1: + workload-name1: - container-name1 global: ixChartContext: addNvidiaRuntimeClass: true nvidiaRuntimeClassName: ix-runtime - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Job diff --git a/library/common-test/tests/pod/scheduler_name_test.yaml b/library/common-test/tests/pod/scheduler_name_test.yaml index 4e3238b49f..a1b3135dd5 100644 --- a/library/common-test/tests/pod/scheduler_name_test.yaml +++ b/library/common-test/tests/pod/scheduler_name_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: schedulerName: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -24,8 +24,8 @@ tests: set: podOptions: schedulerName: some-scheduler - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -40,8 +40,8 @@ tests: set: podOptions: schedulerName: some-scheduler - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -58,8 +58,8 @@ tests: scheduler: some-other-scheduler podOptions: schedulerName: some-scheduler - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/pod/service_account_name_test.yaml b/library/common-test/tests/pod/service_account_name_test.yaml index 2673ce040f..2023ca44f4 100644 --- a/library/common-test/tests/pod/service_account_name_test.yaml +++ b/library/common-test/tests/pod/service_account_name_test.yaml @@ -4,19 +4,19 @@ templates: tests: - it: should assign serviceAccount to primary pod set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: CronJob schedule: "* * * * *" podSpec: {} - controller-name2: + workload-name2: enabled: true primary: false type: Deployment podSpec: {} - serviceAccounts: + serviceAccount: sa-name1: enabled: true asserts: @@ -41,18 +41,18 @@ tests: - it: should assign serviceAccount to all pods set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment podSpec: {} - controller-name2: + workload-name2: enabled: true primary: false type: Deployment podSpec: {} - serviceAccounts: + serviceAccount: sa-name1: enabled: true targetSelectAll: true @@ -74,23 +74,23 @@ tests: - it: should assign serviceAccount to selected pods set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet podSpec: {} - controller-name2: + workload-name2: enabled: true primary: false type: Deployment podSpec: {} - serviceAccounts: + serviceAccount: sa-name1: enabled: true targetSelector: - - controller-name1 - - controller-name2 + - workload-name1 + - workload-name2 asserts: - documentIndex: &daemonSetDoc 1 isKind: @@ -110,21 +110,21 @@ tests: # Failures - it: should fail with more than 1 SA assigned to a pod set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment podSpec: {} - serviceAccounts: + serviceAccount: sa-name1: enabled: true targetSelector: - - controller-name1 + - workload-name1 sa-name2: enabled: true targetSelector: - - controller-name1 + - workload-name1 asserts: - failedTemplate: - errorMessage: Expected at most 1 ServiceAccount to be assigned on a pod [controller-name1]. But [2] were assigned + errorMessage: Expected at most 1 ServiceAccount to be assigned on a pod [workload-name1]. But [2] were assigned diff --git a/library/common-test/tests/pod/termination_grace_period_test.yaml b/library/common-test/tests/pod/termination_grace_period_test.yaml index a3331dd237..108b99a53e 100644 --- a/library/common-test/tests/pod/termination_grace_period_test.yaml +++ b/library/common-test/tests/pod/termination_grace_period_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: terminationGracePeriodSeconds: "" - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet @@ -24,8 +24,8 @@ tests: set: podOptions: terminationGracePeriodSeconds: 100 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet @@ -40,8 +40,8 @@ tests: set: podOptions: terminationGracePeriodSeconds: 100 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet @@ -58,8 +58,8 @@ tests: period: 125 podOptions: terminationGracePeriodSeconds: 50 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: DaemonSet diff --git a/library/common-test/tests/pod/tolerations_test.yaml b/library/common-test/tests/pod/tolerations_test.yaml index a2f7c61370..f8e573c4b4 100644 --- a/library/common-test/tests/pod/tolerations_test.yaml +++ b/library/common-test/tests/pod/tolerations_test.yaml @@ -6,8 +6,8 @@ tests: set: podOptions: tolerations: [] - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -27,8 +27,8 @@ tests: - operator: Exists effect: NoExecute tolerationSeconds: 3600 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -49,8 +49,8 @@ tests: - operator: Exists effect: NoExecute tolerationSeconds: 3600 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -81,8 +81,8 @@ tests: - operator: Exists effect: NoExecute tolerationSeconds: 3600 - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -113,8 +113,8 @@ tests: # Failures - it: should fail with invalid operator set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -127,8 +127,8 @@ tests: - it: should fail with empty key and operator set to Equal set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -142,8 +142,8 @@ tests: - it: should fail with empty value and operator set to Equal set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -157,8 +157,8 @@ tests: - it: should fail with value set and operator set to Exists set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -172,8 +172,8 @@ tests: - it: should fail with effect set to Invalid set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment @@ -187,8 +187,8 @@ tests: - it: should fail with tolerationSeconds not a number set: - controllers: - controller-name1: + workload: + workload-name1: enabled: true primary: true type: Deployment diff --git a/library/common-test/tests/secret/data_test.yaml b/library/common-test/tests/secret/data_test.yaml index 9587cfd9ea..932d93fd9f 100644 --- a/library/common-test/tests/secret/data_test.yaml +++ b/library/common-test/tests/secret/data_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should pass with key-value data set: - secrets: + secret: my-secret1: enabled: true data: @@ -25,7 +25,7 @@ tests: - it: should pass with custom secret type set: - secrets: + secret: my-secret1: enabled: true type: SomeCustomType @@ -41,7 +41,7 @@ tests: - it: should pass with key-value data from tpl set: data: bar - secrets: + secret: my-secret1: enabled: true data: @@ -55,7 +55,7 @@ tests: - it: should pass with scalar data set: - secrets: + secret: my-secret1: enabled: true data: @@ -74,7 +74,7 @@ tests: - it: should pass with scalar data with tpl set: data: Some other text - secrets: + secret: my-secret: enabled: true data: @@ -95,7 +95,7 @@ tests: data: | Some other text some_text - secrets: + secret: my-secret: enabled: true data: diff --git a/library/common-test/tests/secret/metadata_test.yaml b/library/common-test/tests/secret/metadata_test.yaml index 31a33e7904..722d057666 100644 --- a/library/common-test/tests/secret/metadata_test.yaml +++ b/library/common-test/tests/secret/metadata_test.yaml @@ -17,7 +17,7 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - secrets: + secret: my-secret1: enabled: true labels: diff --git a/library/common-test/tests/secret/name_test.yaml b/library/common-test/tests/secret/name_test.yaml index 6ac4bf50f8..2c56e5cf0e 100644 --- a/library/common-test/tests/secret/name_test.yaml +++ b/library/common-test/tests/secret/name_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should generate correct name set: - secrets: + secret: my-secret1: enabled: true data: diff --git a/library/common-test/tests/secret/validation_test.yaml b/library/common-test/tests/secret/validation_test.yaml index 4f85f563d2..b146db798c 100644 --- a/library/common-test/tests/secret/validation_test.yaml +++ b/library/common-test/tests/secret/validation_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should fail with name longer than 63 characters set: - secrets: + secret: my-secret-super-long-name-that-is-longer-than-63-characters: enabled: true data: @@ -15,7 +15,7 @@ tests: - it: should fail with name starting with underscore set: - secrets: + secret: _my-secret: enabled: true data: @@ -26,7 +26,7 @@ tests: - it: should fail with labels not a dict set: - secrets: + secret: my-secret: enabled: true labels: "not a dict" @@ -38,7 +38,7 @@ tests: - it: should fail with annotations not a dict set: - secrets: + secret: my-secret: enabled: true annotations: "not a dict" @@ -50,7 +50,7 @@ tests: - it: should fail with data not a dict set: - secrets: + secret: my-secret: enabled: true data: "not a dict" @@ -60,7 +60,7 @@ tests: - it: should fail with empty data set: - secrets: + secret: my-secret: enabled: true data: {} @@ -70,7 +70,7 @@ tests: - it: should fail with empty type key set: - secrets: + secret: my-secret: enabled: true type: "" diff --git a/library/common-test/tests/serviceAccount/metadata_test.yaml b/library/common-test/tests/serviceAccount/metadata_test.yaml index b9ae9fd2d6..e2e4a3307e 100644 --- a/library/common-test/tests/serviceAccount/metadata_test.yaml +++ b/library/common-test/tests/serviceAccount/metadata_test.yaml @@ -17,7 +17,7 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - serviceAccounts: + serviceAccount: my-sa1: enabled: true labels: diff --git a/library/common-test/tests/serviceAccount/name_test.yaml b/library/common-test/tests/serviceAccount/name_test.yaml index 15d3911560..e05210471c 100644 --- a/library/common-test/tests/serviceAccount/name_test.yaml +++ b/library/common-test/tests/serviceAccount/name_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should generate correct name set: - serviceAccounts: + serviceAccount: my-sa1: enabled: true my-sa2: diff --git a/library/common-test/tests/serviceAccount/validation_test.yaml b/library/common-test/tests/serviceAccount/validation_test.yaml index 6fe17b2298..7b6df9d73b 100644 --- a/library/common-test/tests/serviceAccount/validation_test.yaml +++ b/library/common-test/tests/serviceAccount/validation_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should fail with name longer than 63 characters set: - serviceAccounts: + serviceAccount: my-service-account-super-long-name-that-is-longer-than-63-characters: enabled: true asserts: @@ -13,7 +13,7 @@ tests: - it: should fail with name starting with underscore set: - serviceAccounts: + serviceAccount: _my-sa: enabled: true data: @@ -24,7 +24,7 @@ tests: - it: should fail with labels not a dict set: - serviceAccounts: + serviceAccount: my-sa: enabled: true labels: "not a dict" @@ -34,7 +34,7 @@ tests: - it: should fail with annotations not a dict set: - serviceAccounts: + serviceAccount: my-sa: enabled: true annotations: "not a dict" @@ -44,7 +44,7 @@ tests: - it: should fail with more than 1 primary service accounts set: - serviceAccounts: + serviceAccount: my-sa: enabled: true primary: true diff --git a/library/common-test/tests/statefulset/metadata_test.yaml b/library/common-test/tests/statefulset/metadata_test.yaml index b57690132f..85a32d663f 100644 --- a/library/common-test/tests/statefulset/metadata_test.yaml +++ b/library/common-test/tests/statefulset/metadata_test.yaml @@ -17,8 +17,8 @@ tests: annotations: g_annotation1: global_annotation1 g_annotation2: "{{ .Values.annotation2 }}" - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: StatefulSet @@ -92,13 +92,13 @@ tests: - it: should pass with 2 daemonset created with correct selector labels set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: StatefulSet podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: StatefulSet @@ -107,34 +107,42 @@ tests: - documentIndex: *statefulSetDoc isKind: of: StatefulSet + - documentIndex: *statefulSetDoc + equal: + path: metadata.name + value: release-name-common-test-other-workload-name - documentIndex: *statefulSetDoc equal: path: spec.selector.matchLabels value: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/name: common-test app.kubernetes.io/instance: RELEASE-NAME - documentIndex: *statefulSetDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test + pod.name: release-name-common-test-other-workload-name app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test - documentIndex: &otherStatefulSetDoc 1 isKind: of: StatefulSet + - documentIndex: *otherStatefulSetDoc + equal: + path: metadata.name + value: release-name-common-test - documentIndex: *otherStatefulSetDoc equal: path: spec.selector.matchLabels value: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/name: common-test app.kubernetes.io/instance: RELEASE-NAME - documentIndex: *otherStatefulSetDoc isSubset: path: spec.template.metadata.labels content: - pod.name: release-name-common-test-other-controller-name + pod.name: release-name-common-test app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/name: common-test diff --git a/library/common-test/tests/statefulset/spec_test.yaml b/library/common-test/tests/statefulset/spec_test.yaml index ba83c72a00..74ae3f6976 100644 --- a/library/common-test/tests/statefulset/spec_test.yaml +++ b/library/common-test/tests/statefulset/spec_test.yaml @@ -2,10 +2,10 @@ suite: statefulset spec test templates: - common.yaml tests: - - it: should pass with controller enabled + - it: should pass with workload enabled set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: StatefulSet @@ -27,8 +27,8 @@ tests: - it: should apply spec correctly set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: StatefulSet diff --git a/library/common-test/tests/statefulset/validation_test.yaml b/library/common-test/tests/statefulset/validation_test.yaml index 3b44f252bd..b434489f3e 100644 --- a/library/common-test/tests/statefulset/validation_test.yaml +++ b/library/common-test/tests/statefulset/validation_test.yaml @@ -4,8 +4,8 @@ templates: tests: - it: should fail with invalid strategy set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: StatefulSet @@ -17,8 +17,8 @@ tests: - it: should fail with rollingUpdate not a dict set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: StatefulSet diff --git a/library/common-test/tests/controller/names_test.yaml b/library/common-test/tests/workload/names_test.yaml similarity index 69% rename from library/common-test/tests/controller/names_test.yaml rename to library/common-test/tests/workload/names_test.yaml index 33f4175fa4..7dcd31f65b 100644 --- a/library/common-test/tests/controller/names_test.yaml +++ b/library/common-test/tests/workload/names_test.yaml @@ -1,38 +1,78 @@ -suite: controller name test +suite: workload name test templates: - common.yaml tests: - - it: should generate correct controller name + - it: should generate correct workload name set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment podSpec: {} - daemonset-controller-name: + daemonset-workload-name: enabled: true primary: false type: DaemonSet podSpec: {} - stateful-controller-name: + stateful-workload-name: enabled: true primary: false type: StatefulSet podSpec: {} - cronjob-controller-name: + cronjob-workload-name: enabled: true primary: false type: CronJob schedule: "*/1 * * * *" podSpec: {} - job-controller-name: + job-workload-name: enabled: true primary: false type: Job podSpec: {} asserts: - - documentIndex: &deploymentDoc 0 + - documentIndex: &cronJobDoc 0 + isKind: + of: CronJob + - documentIndex: *cronJobDoc + isAPIVersion: + of: batch/v1 + - documentIndex: *cronJobDoc + equal: + path: metadata.name + value: release-name-common-test-cronjob-workload-name + - documentIndex: &daemonSetDoc 1 + isKind: + of: DaemonSet + - documentIndex: *daemonSetDoc + isAPIVersion: + of: apps/v1 + - documentIndex: *daemonSetDoc + equal: + path: metadata.name + value: release-name-common-test-daemonset-workload-name + - documentIndex: &jobDoc 2 + isKind: + of: Job + - documentIndex: *jobDoc + isAPIVersion: + of: batch/v1 + - documentIndex: *jobDoc + equal: + path: metadata.name + value: release-name-common-test-job-workload-name + - documentIndex: &statefulSetDoc 3 + isKind: + of: StatefulSet + - documentIndex: *statefulSetDoc + isAPIVersion: + of: apps/v1 + - documentIndex: *statefulSetDoc + equal: + path: metadata.name + value: release-name-common-test-stateful-workload-name + - documentIndex: &deploymentDoc 4 isKind: of: Deployment - documentIndex: *deploymentDoc @@ -42,43 +82,3 @@ tests: equal: path: metadata.name value: release-name-common-test - - documentIndex: &cronJobDoc 1 - isKind: - of: CronJob - - documentIndex: *cronJobDoc - isAPIVersion: - of: batch/v1 - - documentIndex: *cronJobDoc - equal: - path: metadata.name - value: release-name-common-test-cronjob-controller-name - - documentIndex: &daemonSetDoc 2 - isKind: - of: DaemonSet - - documentIndex: *daemonSetDoc - isAPIVersion: - of: apps/v1 - - documentIndex: *daemonSetDoc - equal: - path: metadata.name - value: release-name-common-test-daemonset-controller-name - - documentIndex: &jobDoc 3 - isKind: - of: Job - - documentIndex: *jobDoc - isAPIVersion: - of: batch/v1 - - documentIndex: *jobDoc - equal: - path: metadata.name - value: release-name-common-test-job-controller-name - - documentIndex: &statefulSetDoc 4 - isKind: - of: StatefulSet - - documentIndex: *statefulSetDoc - isAPIVersion: - of: apps/v1 - - documentIndex: *statefulSetDoc - equal: - path: metadata.name - value: release-name-common-test-stateful-controller-name diff --git a/library/common-test/tests/controller/validation_test.yaml b/library/common-test/tests/workload/validation_test.yaml similarity index 52% rename from library/common-test/tests/controller/validation_test.yaml rename to library/common-test/tests/workload/validation_test.yaml index baaf2da456..b0b79f282e 100644 --- a/library/common-test/tests/controller/validation_test.yaml +++ b/library/common-test/tests/workload/validation_test.yaml @@ -1,91 +1,91 @@ -suite: controller validation test +suite: workload validation test templates: - common.yaml tests: - it: should fail with name longer than 63 characters set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment podSpec: {} - other-controller-name-super-long-name-that-is-longer-than-63-characters: + other-workload-name-super-long-name-that-is-longer-than-63-characters: enabled: true primary: false type: Deployment podSpec: {} asserts: - failedTemplate: - errorMessage: Name [release-name-common-test-other-controller-name-super-long-name-that-is-longer-than-63-characters] is not valid. Must start and end with an alphanumeric character. It can contain '-'. And must be at most 63 characters. + errorMessage: Name [release-name-common-test-other-workload-name-super-long-name-that-is-longer-than-63-characters] is not valid. Must start and end with an alphanumeric character. It can contain '-'. And must be at most 63 characters. - it: should fail with name starting with underscore set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment podSpec: {} - _other-controller-name: + _other-workload-name: enabled: true primary: false type: Deployment podSpec: {} asserts: - failedTemplate: - errorMessage: Name [release-name-common-test-_other-controller-name] is not valid. Must start and end with an alphanumeric character. It can contain '-'. And must be at most 63 characters. + errorMessage: Name [release-name-common-test-_other-workload-name] is not valid. Must start and end with an alphanumeric character. It can contain '-'. And must be at most 63 characters. - it: should fail with invalid type set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: not-valid-type podSpec: {} asserts: - failedTemplate: - errorMessage: Controller - Expected to be one of [Deployment, StatefulSet, DaemonSet, Job, CronJob], but got [not-valid-type] + errorMessage: Workload - Expected to be one of [Deployment, StatefulSet, DaemonSet, Job, CronJob], but got [not-valid-type] - - it: should fail without primary enabled controller + - it: should fail without primary enabled workload set: - controllers: - controller-name: + workload: + workload-name: enabled: false primary: true type: Deployment podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: Deployment podSpec: {} asserts: - failedTemplate: - errorMessage: Controller - At least one enabled controller must be primary + errorMessage: Workload - At least one enabled workload must be primary - - it: should fail more than one primary enabled controller + - it: should fail more than one primary enabled workload set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: true type: Deployment podSpec: {} asserts: - failedTemplate: - errorMessage: Controller - Only one controller can be primary + errorMessage: Workload - Only one workload can be primary - it: should fail with labels not a dict set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment @@ -93,12 +93,12 @@ tests: podSpec: {} asserts: - failedTemplate: - errorMessage: Controller - Expected to be a dictionary, but got [string] + errorMessage: Workload - Expected to be a dictionary, but got [string] - it: should fail with annotations not a dict set: - controllers: - controller-name: + workload: + workload-name: enabled: true primary: true type: Deployment @@ -106,4 +106,4 @@ tests: podSpec: {} asserts: - failedTemplate: - errorMessage: Controller - Expected to be a dictionary, but got [string] + errorMessage: Workload - Expected to be a dictionary, but got [string] diff --git a/library/common-test/values.yaml b/library/common-test/values.yaml index 2f91c7228a..a6be06a4cc 100644 --- a/library/common-test/values.yaml +++ b/library/common-test/values.yaml @@ -1,7 +1,7 @@ # As we have by default enabled -# a "main" controller" for all charts +# a "main" workload" for all charts # We disable it so tests run with their defined -# controllers (Tests use a different named controller) -controllers: +# workload (Tests use a different named workload) +workload: main: enabled: false diff --git a/library/common/1.0.0/docs/configmap.md b/library/common/1.0.0/docs/configmap.md new file mode 100644 index 0000000000..3ebb5c9876 --- /dev/null +++ b/library/common/1.0.0/docs/configmap.md @@ -0,0 +1,48 @@ +# ConfigMap + +| Key | Type | Required | Helm Template | Default | Description | +| :------------------------------------- | :-------: | :------: | :-----------: | :-----: | :----------------------------------- | +| configmap | `dict` | ❌ | ❌ | `{}` | Define the configMaps as dicts | +| configmap.[configmap-name] | `dict` | ✅ | ❌ | `{}` | Holds configMap definition | +| configmap.[configmap-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the configMap | +| configmap.[configmap-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for configmap | +| configmap.[configmap-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for configmap | +| configmap.[configmap-name].data | `dict` | ✅ | ✅ | `{}` | Define the data of the configmap | + +--- + +Appears in: + +- `.Values.configmap` + +--- + +Naming scheme: + +- `$FullName-$ConfigmapName` (release-name-chart-name-configmapName) + +--- + +Examples: + +```yaml +configmap: + + configmap-name: + enabled: true + labels: + key: value + keytpl: "{{ .Values.some.value }}" + annotations: + key: value + keytpl: "{{ .Values.some.value }}" + data: + key: value + + other-configmap-name: + enabled: true + data: + key: | + multi line + text value +``` diff --git a/library/common/1.0.0/docs/configmaps.md b/library/common/1.0.0/docs/configmaps.md deleted file mode 100644 index a0645f09cf..0000000000 --- a/library/common/1.0.0/docs/configmaps.md +++ /dev/null @@ -1,48 +0,0 @@ -# ConfigMap - -| Key | Type | Required | Helm Template | Default | Description | -| :------------------------------------- | :-------: | :------: | :-----------: | :-----: | :----------------------------------- | -| configmaps | `dict` | ❌ | ❌ | `{}` | Define the configMaps as dicts | -| configmaps.[configmap-name] | `dict` | ✅ | ❌ | `{}` | Holds configMap definition | -| configmaps.[configmap-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the configMap | -| configmaps.[configmap-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for configmap | -| configmaps.[configmap-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for configmap | -| configmaps.[configmap-name].data | `dict` | ✅ | ✅ | `{}` | Define the data of the configmap | - ---- - -Appears in: - -- `.Values.configmaps` - ---- - -Naming scheme: - -- `$FullName-$ConfigmapName` (release-name-chart-name-configmapName) - ---- - -Examples: - -```yaml -configmaps: - - configmap-name: - enabled: true - labels: - key: value - keytpl: "{{ .Values.some.value }}" - annotations: - key: value - keytpl: "{{ .Values.some.value }}" - data: - key: value - - other-configmap-name: - enabled: true - data: - key: | - multi line - text value -``` diff --git a/library/common/1.0.0/docs/controllers.md b/library/common/1.0.0/docs/controllers.md deleted file mode 100644 index 598bb3f32e..0000000000 --- a/library/common/1.0.0/docs/controllers.md +++ /dev/null @@ -1,133 +0,0 @@ -# Controllers - -| Key | Type | Required | Helm Template | Default | Description | -| :---------------------------------------------------------------------- | :-------: | :------: | :-----------: | :-------------------------------------------------------------: | :----------------------------------------------------------------------------------- | -| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts | -| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition | -| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller | -| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary | -| controllers.[controller-name].labels | `dict` | ❌ | ❌ | `{}` | Additional labels for controller | -| controllers.[controller-name].labels.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional label | -| controllers.[controller-name].labels.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] of the additional label | -| controllers.[controller-name].annotations | `dict` | ❌ | ❌ | `{}` | Additional annotations for controller | -| controllers.[controller-name].annotations.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional annotation | -| controllers.[controller-name].annotations.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] of the additional annotation | -| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the kind of the controller (Deployment, DaemonSet, StatefulSet, CronJob, Job) | -| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition | -| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ❌ | `{}` | Additional Pod Labels | -| controllers.[controller-name].podSpec.labels.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional label | -| controllers.[controller-name].podSpec.labels.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] of the additional label | -| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations | -| controllers.[controller-name].podSpec.annotations.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional annotation | -| controllers.[controller-name].podSpec.annotations.[key-name].[value] | `string` | ❌ | ✅ | | [Value] of [key] of the additional annotation | -| controllers.[controller-name].podSpec.automountServiceAccountToken | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.automountServiceAccoutnToken }}` (false) | Pod's automountServiceAccountToken | -| controllers.[controller-name].podSpec.hostNetwork | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.hostNetwork }}` (false) | Pod's hostNetwork | -| controllers.[controller-name].podSpec.enableServiceLinks | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.enableServiceLinks }}` (false) | Pod's enableServiceLinks | -| controllers.[controller-name].podSpec.restartPolicy | `string` | ❌ | ✅ | `{{ .Values.podOptions.restartPolicy }}` (Always) | Pod's restartPolicy. (Always, Never, OnFailure) | -| controllers.[controller-name].podSpec.schedulerName | `string` | ❌ | ✅ | `{{ .Values.podOptions.schedulerName }}` ("") | Pod's schedulerName | -| controllers.[controller-name].podSpec.priorityClassName | `string` | ❌ | ✅ | `{{ .Values.podOptions.priorityClassName }}` ("") | Pod's priorityClassName | -| controllers.[controller-name].podSpec.hostname | `string` | ❌ | ✅ | `""` | Pod's hostname | -| controllers.[controller-name].podSpec.terminationGracePeriodSeconds | `int` | ❌ | ✅ | `{{ .Values.podOptions.terminationGracePeriodSeconds }}` (120) | Pod's terminationGracePeriodSeconds | -| controllers.[controller-name].podSpec.nodeSelector | `dict` | ❌ | ❌ | `{{ .Values.podOptions.nodeSelector }}` ({}) | Pod's nodeSelector | -| controllers.[controller-name].podSpec.nodeSelector.[key-name] | `string` | ❌ | ❌ | | [Key] for nodeSelector | -| controllers.[controller-name].podSpec.nodeSelector.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] for nodeSelector | -| controllers.[controller-name].podSpec.hostAliases | `list` | ❌ | ❌ | | Pod's host aliases | -| controllers.[controller-name].podSpec.hostAliases.ip | `string` | ❌ | ✅ | | Value for `ip` in hosts aliases | -| controllers.[controller-name].podSpec.hostAliases.hostnames | `list` | ❌ | ❌ | | Hostnames for the `ip` in hosts aliases | -| controllers.[controller-name].podSpec.hostAliases.hostnames.[host-name] | `string` | ❌ | ✅ | | [Value] for `hostnames` for the `ip` in hosts aliases | -| controllers.[controller-name].podSpec.dnsPolicy | `string` | ❌ | ✅ | `{{ .Values.podOptions.dnsPolicy }}` (ClusterFirst) | Pod's DNS Policy (ClusterFirst, ClusterFirstWithHostNet, Default, None). | -| controllers.[controller-name].podSpec.tolerations | `list` | ❌ | ❌ | `{{ .Values.podOptions.tolerations }}` ([]) | Pod's Tolerations | -| controllers.[controller-name].podSpec.tolerations.operator | `string` | ✅ | ✅ | | Toleration's `operator` (Equal, Exists) | -| controllers.[controller-name].podSpec.tolerations.key | `string` | ❌/✅ | ✅ | | Toleration's `key`. Required only when `operator` = `Equal` | -| controllers.[controller-name].podSpec.tolerations.value | `string` | ❌/✅ | ✅ | | Toleration's `value`. Required only when `operator` = `Equal` | -| controllers.[controller-name].podSpec.tolerations.effect | `string` | ❌ | ✅ | | Toleration's `effect`.(NoExecute, NoSchedule, PreferNoSchedule) | -| controllers.[controller-name].podSpec.tolerations.tolerationSeconds | `int` | ❌ | ❌ | | Toleration's `tolerationSeconds`. | -| controllers.[controller-name].podSpec.runtimeClassName | `string` | ✅ | ❌ | `{{ .Values.podOptions.runtimeClassName }}` ("") | Pod's runtimeClassName | - ---- - -Notes - -> `dnsPolicy` is set automatically to `ClusterFirstWithHostNet` when `hostNetwork` is `true` -> `runtimeClassName` will ignore any value set and use the `.Values.global.ixChartContext.nvidiaRuntimeClassName`, -> if a GPU is assigned to a container and Scale Middleware sets `.Values.global.ixChartContext.addNvidiaRuntimeClass` to `true`. -> Note that it will only set the `runtimeClassName` on the pod that this container belongs to. - ---- - -Appears in: - -- `.Values.controllers` - ---- - -Naming scheme: - -- Primary: `$FullName` (release-name-chart-name) -- Non-Primary: `$FullName-$ControllerName` (release-name-chart-name-controller-name) - ---- - -> Those are the common `keys` for all controllers. -> Additional keys, information and examples, see on the specific kind of controller - -- [Deployment](deployment.md) -- [DaemonSet](daemonset.md) -- [StatefulSet](statefulset.md) -- [CronJob](cronjob.md) -- [Job](job.md) - ---- - -Examples: - -```yaml -controllers: - controller-name: - enabled: true - primary: true - labels: - key: value - annotations: - key: value - podSpec: - labels: - key: value - annotations: - key: value - automountServiceAccountToken: true - hostNetwork: false - enableServiceLinks: false - schedulerName: some-scheduler - priorityClassName: some-priority-class-name - hostname: some-hostname - terminationGracePeriodSeconds: 100 - nodeSelector: - disk_type: ssd - hostAliases: - - ip: 10.10.10.100 - hostnames: - - myserver.local - - storage.local - - ip: 10.10.10.101 - hostnames: - - myotherserver.local - - backups.local - dnsPolicy: ClusterFirst - dnsConfig: - nameservers: - - 1.1.1.1 - - 1.0.0.1 - searches: - - ns1.svc.cluster-domain.example - - my.dns.search.suffix - options: - - name: ndots - value: "2" - - name: edns0 - tolerations: - - operator: Exists - effect: NoExecute - tolerationSeconds: 3600 - runtimeClassName: some-runtime-class -``` diff --git a/library/common/1.0.0/docs/cronjob.md b/library/common/1.0.0/docs/cronjob.md index 612a12649e..719aa4f618 100644 --- a/library/common/1.0.0/docs/cronjob.md +++ b/library/common/1.0.0/docs/cronjob.md @@ -1,33 +1,33 @@ # CronJob -| Key | Type | Required | Helm Template | Default | Description | -| :------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :---------------------------------------------------- | -| controllers.[controller-name].schedule | `string` | ✅ | ✅ | `""` | Define the schedule | -| controllers.[controller-name].timezone | `string` | ❌ | ✅ | `{{ .Values.TZ }}` | Define the timezone | -| controllers.[controller-name].concurrencyPolicy | `string` | ❌ | ✅ | `Forbid` | Define the concurrencyPolicy (Allow, Replace, Forbid) | -| controllers.[controller-name].failedJobsHistoryLimit | `int` | ❌ | ❌ | `1` | Define the failedJobsHistoryLimit | -| controllers.[controller-name].successfulJobsHistoryLimit | `int` | ❌ | ❌ | `3` | Define the successfulJobsHistoryLimit | -| controllers.[controller-name].startingDeadlineSeconds | `int` | ❌ | ❌ | | Define the startingDeadlineSeconds | -| controllers.[controller-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) | -| controllers.[controller-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit | -| controllers.[controller-name].completions | `int` | ❌ | ❌ | | Define the completions | -| controllers.[controller-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism | -| controllers.[controller-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished | -| controllers.[controller-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds | +| Key | Type | Required | Helm Template | Default | Description | +| :-------------------------------------------------- | :------: | :------: | :-----------: | :----------------: | :---------------------------------------------------- | +| workload.[workload-name].schedule | `string` | ✅ | ✅ | `""` | Define the schedule | +| workload.[workload-name].timezone | `string` | ❌ | ✅ | `{{ .Values.TZ }}` | Define the timezone | +| workload.[workload-name].concurrencyPolicy | `string` | ❌ | ✅ | `Forbid` | Define the concurrencyPolicy (Allow, Replace, Forbid) | +| workload.[workload-name].failedJobsHistoryLimit | `int` | ❌ | ❌ | `1` | Define the failedJobsHistoryLimit | +| workload.[workload-name].successfulJobsHistoryLimit | `int` | ❌ | ❌ | `3` | Define the successfulJobsHistoryLimit | +| workload.[workload-name].startingDeadlineSeconds | `int` | ❌ | ❌ | | Define the startingDeadlineSeconds | +| workload.[workload-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) | +| workload.[workload-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit | +| workload.[workload-name].completions | `int` | ❌ | ❌ | | Define the completions | +| workload.[workload-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism | +| workload.[workload-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished | +| workload.[workload-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds | --- Notes: -View common `keys` of `controllers` in [Controllers Documentation](controllers.md). +View common `keys` of `workload` in [workload Documentation](workload.md). --- Examples: ```yaml -controllers: - controller-name: +workload: + workload-name: enabled: true primary: true type: CronJob @@ -46,7 +46,7 @@ controllers: podSpec: restartPolicy: OnFailure - other-controller-name: + other-workload-name: enabled: true primary: false type: CronJob diff --git a/library/common/1.0.0/docs/daemonset.md b/library/common/1.0.0/docs/daemonset.md index cdcb036a90..df3f7a0c6b 100644 --- a/library/common/1.0.0/docs/daemonset.md +++ b/library/common/1.0.0/docs/daemonset.md @@ -1,26 +1,27 @@ # DaemonSet -| Key | Type | Required | Helm Template | Default | Description | -| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :-------------------------------------------------------------------------- | -| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the controller (OnDelete, RollingUpdate) | -| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate | -| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate | -| controllers.[controller-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate | +| Key | Type | Required | Helm Template | Default | Description | +| :---------------------------------------------------- | :------: | :------: | :-----------: | :-------------: | :------------------------------------------------------------------- | +| workload.[workload-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the workload (OnDelete, RollingUpdate) | +| workload.[workload-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate | +| workload.[workload-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate | +| workload.[workload-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate | --- + Notes: -View common `keys` of `controllers` in [Controllers Documentation](controllers.md). +View common `keys` of `workload` in [workload Documentation](workload.md). -> Value of `controllers.[controller-name].podSpec.restartPolicy` can only be `Always` for this type of controller +> Value of `workload.[workload-name].podSpec.restartPolicy` can only be `Always` for this type of workload --- Examples: ```yaml -controllers: - controller-name: +workload: + workload-name: enabled: true primary: true type: DaemonSet @@ -32,7 +33,7 @@ controllers: maxSurge: 1 podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: DaemonSet diff --git a/library/common/1.0.0/docs/deployment.md b/library/common/1.0.0/docs/deployment.md index f47ba51779..69b33a3da3 100644 --- a/library/common/1.0.0/docs/deployment.md +++ b/library/common/1.0.0/docs/deployment.md @@ -1,27 +1,27 @@ # Deployment -| Key | Type | Required | Helm Template | Default | Description | -| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :-------------------------------------------------------------------------- | -| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `Recreate` | Define the strategy of the controller (Recreate, RollingUpdate) | -| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate | -| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate | -| controllers.[controller-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate | +| Key | Type | Required | Helm Template | Default | Description | +| :---------------------------------------------------- | :------: | :------: | :-----------: | :--------: | :------------------------------------------------------------------- | +| workload.[workload-name].strategy | `string` | ❌ | ❌ | `Recreate` | Define the strategy of the workload (Recreate, RollingUpdate) | +| workload.[workload-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate | +| workload.[workload-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate | +| workload.[workload-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate | --- Notes: -View common `keys` of `controllers` in [Controllers Documentation](controllers.md). +View common `keys` of `workload` in [workload Documentation](workload.md). -> Value of `controllers.[controller-name].podSpec.restartPolicy` can only be `Always` for this type of controller +> Value of `workload.[workload-name].podSpec.restartPolicy` can only be `Always` for this type of workload --- Examples: ```yaml -controllers: - controller-name: +workload: + workload-name: enabled: true primary: true type: Deployment @@ -33,7 +33,7 @@ controllers: maxSurge: 1 podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: Deployment diff --git a/library/common/1.0.0/docs/imagePullSecret.md b/library/common/1.0.0/docs/imagePullSecret.md new file mode 100644 index 0000000000..dc897252ab --- /dev/null +++ b/library/common/1.0.0/docs/imagePullSecret.md @@ -0,0 +1,66 @@ +# Image Pull Secret + +| Key | Type | Required | Helm Template | Default | Description | +| :------------------------------------------------- | :-------: | :------: | :-----------: | :-----: | :---------------------------------------------- | +| imagePullSecret | `dict` | ❌ | ❌ | `{}` | Define the image pull secret as dicts | +| imagePullSecret.[pull-secret-name] | `dict` | ✅ | ❌ | `{}` | Holds configMap definition | +| imagePullSecret.[pull-secret-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the image pull secret | +| imagePullSecret.[pull-secret-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for image pull secret | +| imagePullSecret.[pull-secret-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for image pull secret | +| imagePullSecret.[pull-secret-name].data | `dict` | ✅ | ✅ | `{}` | Define the data of the image pull secret | +| imagePullSecret.[pull-secret-name].data.registry | `string` | ✅ | ✅ | `""` | Define the registry of the image pull secret | +| imagePullSecret.[pull-secret-name].data.username | `string` | ✅ | ✅ | `""` | Define the username of the image pull secret | +| imagePullSecret.[pull-secret-name].data.password | `string` | ✅ | ✅ | `""` | Define the password of the image pull secret | +| imagePullSecret.[pull-secret-name].data.email | `string` | ✅ | ✅ | `""` | Define the email of the image pull secret | +| imagePullSecret.[pull-secret-name].targetSelectAll | `boolean` | ❌ | ❌ | | Whether to assign the secret to all pods or not | +| imagePullSecret.[pull-secret-name].targetSelector | `list` | ❌ | ❌ | `[]` | Define the pod(s) to assign the secret | + +> When `targetSelectAll` is `true`, it will assign the secret to all pods (`targetSelector` is ignored in this case) +> When `targetSelector` is a list, each entry is a string, referencing the pod(s) name that will be assigned. +> When `targetSelector` is a empty, it will assign the secret to the primary pod + +--- + +Appears in: + +- `.Values.imagePullSecret` + +--- + +Naming scheme: + +- `$FullName-$ImagePullSecretName` (release-name-chart-name-imagePullSecretName) + +--- + +Examples: + +```yaml +imagePullSecret: + + pull-secret-name: + enabled: true + labels: + key: value + keytpl: "{{ .Values.some.value }}" + annotations: + key: value + keytpl: "{{ .Values.some.value }}" + data: + registry: quay.io + username: my_user + password: my_pass + email: my_mail@example.com + targetSelectAll: true + + other-pull-secret-name: + enabled: true + data: + registry: "{{ .Values.my_registry }}" + username: "{{ .Values.my_user }}" + password: "{{ .Values.my_pass }}" + email: "{{ .Values.my_mail }}" + targetSelector: + - workload-name1 + - workload-name2 +``` diff --git a/library/common/1.0.0/docs/imagePullSecrets.md b/library/common/1.0.0/docs/imagePullSecrets.md deleted file mode 100644 index c751253141..0000000000 --- a/library/common/1.0.0/docs/imagePullSecrets.md +++ /dev/null @@ -1,66 +0,0 @@ -# Image Pull Secrets - -| Key | Type | Required | Helm Template | Default | Description | -| :-------------------------------------------------- | :-------: | :------: | :-----------: | :-----: | :---------------------------------------------- | -| imagePullSecrets | `dict` | ❌ | ❌ | `{}` | Define the image pull secrets as dicts | -| imagePullSecrets.[pull-secret-name] | `dict` | ✅ | ❌ | `{}` | Holds configMap definition | -| imagePullSecrets.[pull-secret-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the image pull secret | -| imagePullSecrets.[pull-secret-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for image pull secret | -| imagePullSecrets.[pull-secret-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for image pull secret | -| imagePullSecrets.[pull-secret-name].data | `dict` | ✅ | ✅ | `{}` | Define the data of the image pull secret | -| imagePullSecrets.[pull-secret-name].data.registry | `string` | ✅ | ✅ | `""` | Define the registry of the image pull secret | -| imagePullSecrets.[pull-secret-name].data.username | `string` | ✅ | ✅ | `""` | Define the username of the image pull secret | -| imagePullSecrets.[pull-secret-name].data.password | `string` | ✅ | ✅ | `""` | Define the password of the image pull secret | -| imagePullSecrets.[pull-secret-name].data.email | `string` | ✅ | ✅ | `""` | Define the email of the image pull secret | -| imagePullSecrets.[pull-secret-name].targetSelectAll | `boolean` | ❌ | ❌ | | Whether to assign the secret to all pods or not | -| imagePullSecrets.[pull-secret-name].targetSelector | `list` | ❌ | ❌ | `[]` | Define the pod(s) to assign the secret | - -> When `targetSelectAll` is `true`, it will assign the secret to all pods (`targetSelector` is ignored in this case) -> When `targetSelector` is a list, each entry is a string, referencing the pod(s) name that will be assigned. -> When `targetSelector` is a empty, it will assign the secret to the primary pod - ---- - -Appears in: - -- `.Values.imagePullSecrets` - ---- - -Naming scheme: - -- `$FullName-$ImagePullSecretName` (release-name-chart-name-imagePullSecretName) - ---- - -Examples: - -```yaml -imagePullSecrets: - - pull-secret-name: - enabled: true - labels: - key: value - keytpl: "{{ .Values.some.value }}" - annotations: - key: value - keytpl: "{{ .Values.some.value }}" - data: - registry: quay.io - username: my_user - password: my_pass - email: my_mail@example.com - targetSelectAll: true - - other-pull-secret-name: - enabled: true - data: - registry: "{{ .Values.my_registry }}" - username: "{{ .Values.my_user }}" - password: "{{ .Values.my_pass }}" - email: "{{ .Values.my_mail }}" - targetSelector: - - controller-name1 - - controller-name2 -``` diff --git a/library/common/1.0.0/docs/job.md b/library/common/1.0.0/docs/job.md index 7e9c292d70..69a4cad5d9 100644 --- a/library/common/1.0.0/docs/job.md +++ b/library/common/1.0.0/docs/job.md @@ -1,27 +1,27 @@ # Job -| Key | Type | Required | Helm Template | Default | Description | -| :---------------------------------------------------- | :------: | :------: | :-----------: | :----------: | :---------------------------------------------- | -| controllers.[controller-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) | -| controllers.[controller-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit | -| controllers.[controller-name].completions | `int` | ❌ | ❌ | | Define the completions | -| controllers.[controller-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism | -| controllers.[controller-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished | -| controllers.[controller-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds | +| Key | Type | Required | Helm Template | Default | Description | +| :----------------------------------------------- | :------: | :------: | :-----------: | :----------: | :---------------------------------------------- | +| workload.[workload-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) | +| workload.[workload-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit | +| workload.[workload-name].completions | `int` | ❌ | ❌ | | Define the completions | +| workload.[workload-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism | +| workload.[workload-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished | +| workload.[workload-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds | --- Notes: -View common `keys` of `controllers` in [Controllers Documentation](controllers.md). +View common `keys` of `workload` in [workload Documentation](workload.md). --- Examples: ```yaml -controllers: - controller-name: +workload: + workload-name: enabled: true primary: true type: Job @@ -34,7 +34,7 @@ controllers: podSpec: restartPolicy: Never - other-controller-name: + other-workload-name: enabled: true primary: false type: Job diff --git a/library/common/1.0.0/docs/secret.md b/library/common/1.0.0/docs/secret.md new file mode 100644 index 0000000000..a43fe4f381 --- /dev/null +++ b/library/common/1.0.0/docs/secret.md @@ -0,0 +1,50 @@ +# Secret + +| Key | Type | Required | Helm Template | Default | Description | +| :------------------------------- | :-------: | :------: | :-----------: | :------: | :-------------------------------- | +| secret | `dict` | ❌ | ❌ | `{}` | Define the secret as dicts | +| secret.[secret-name] | `dict` | ✅ | ❌ | `{}` | Holds secret definition | +| secret.[secret-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the secret | +| secret.[secret-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for secret | +| secret.[secret-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for secret | +| secret.[secret-name].type | `string` | ❌ | ✅ | `Opaque` | Custom secret type | +| secret.[secret-name].data | `dict` | ✅ | ✅ | `{}` | Define the data of the secret | + +--- + +Appears in: + +- `.Values.secret` + +--- + +Naming scheme: + +- `$FullName-$SecretName` (release-name-chart-name-SecretName) + +--- + +Examples: + +```yaml +secret: + + secret-name: + enabled: true + type: CustomSecretType + labels: + key: value + keytpl: "{{ .Values.some.value }}" + annotations: + key: value + keytpl: "{{ .Values.some.value }}" + data: + key: value + + other-secret-name: + enabled: true + data: + key: | + multi line + text value +``` diff --git a/library/common/1.0.0/docs/secrets.md b/library/common/1.0.0/docs/secrets.md deleted file mode 100644 index 1e3fdc3126..0000000000 --- a/library/common/1.0.0/docs/secrets.md +++ /dev/null @@ -1,50 +0,0 @@ -# Secret - -| Key | Type | Required | Helm Template | Default | Description | -| :-------------------------------- | :-------: | :------: | :-----------: | :------: | :-------------------------------- | -| secrets | `dict` | ❌ | ❌ | `{}` | Define the secrets as dicts | -| secrets.[secret-name] | `dict` | ✅ | ❌ | `{}` | Holds secret definition | -| secrets.[secret-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the secret | -| secrets.[secret-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for secret | -| secrets.[secret-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for secret | -| secrets.[secret-name].type | `string` | ❌ | ✅ | `Opaque` | Custom secret type | -| secrets.[secret-name].data | `dict` | ✅ | ✅ | `{}` | Define the data of the secret | - ---- - -Appears in: - -- `.Values.secrets` - ---- - -Naming scheme: - -- `$FullName-$SecretName` (release-name-chart-name-SecretName) - ---- - -Examples: - -```yaml -secrets: - - secret-name: - enabled: true - type: CustomSecretType - labels: - key: value - keytpl: "{{ .Values.some.value }}" - annotations: - key: value - keytpl: "{{ .Values.some.value }}" - data: - key: value - - other-secret-name: - enabled: true - data: - key: | - multi line - text value -``` diff --git a/library/common/1.0.0/docs/serviceAccount.md b/library/common/1.0.0/docs/serviceAccount.md new file mode 100644 index 0000000000..ef84900ca3 --- /dev/null +++ b/library/common/1.0.0/docs/serviceAccount.md @@ -0,0 +1,52 @@ +# Service Account + +| Key | Type | Required | Helm Template | Default | Description | +| :--------------------------------------- | :-------: | :------: | :-----------: | :-----: | :------------------------------------------------------ | +| serviceAccount | `dict` | ❌ | ❌ | `{}` | Define the serviceAccount as dicts | +| serviceAccount.[sa-name] | `dict` | ✅ | ❌ | `{}` | Holds secret definition | +| serviceAccount.[sa-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the secret | +| serviceAccount.[sa-name].primary | `boolean` | ❌ | ❌ | `false` | Sets the service account as primary | +| serviceAccount.[sa-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for secret | +| serviceAccount.[sa-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for secret | +| serviceAccount.[sa-name].targetSelectAll | `boolean` | ❌ | ❌ | | Whether to assign the serviceAccount to all pods or not | +| serviceAccount.[sa-name].targetSelector | `list` | ❌ | ❌ | `[]` | Define the pod(s) to assign the serviceAccount | + +> When `targetSelectAll` is `true`, it will assign the serviceAccount to all pods (`targetSelector` is ignored in this case) +> When `targetSelector` is a list, each entry is a string, referencing the pod(s) name that will be assigned. +> When `targetSelector` is a empty, it will assign the serviceAccount to the primary pod + +--- + +Appears in: + +- `.Values.serviceAccount` + +--- + +Naming scheme: + +- Primary: `$FullName` (release-name-chart-name) +- Non-Primary: `$FullName-$ServiceAccountName` (release-name-chart-name-ServiceAccountName) + +--- + +Examples: + +```yaml +serviceAccount: + sa-name: + enabled: true + labels: + key: value + keytpl: "{{ .Values.some.value }}" + annotations: + key: value + keytpl: "{{ .Values.some.value }}" + targetSelectAll: true + + other-sa-name: + enabled: true + targetSelector: + - pod-name + - other-pod-name +``` diff --git a/library/common/1.0.0/docs/serviceAccounts.md b/library/common/1.0.0/docs/serviceAccounts.md deleted file mode 100644 index 1ba11ccf76..0000000000 --- a/library/common/1.0.0/docs/serviceAccounts.md +++ /dev/null @@ -1,52 +0,0 @@ -# Service Account - -| Key | Type | Required | Helm Template | Default | Description | -| :---------------------------------------- | :-------: | :------: | :-----------: | :-----: | :------------------------------------------------------ | -| serviceAccounts | `dict` | ❌ | ❌ | `{}` | Define the serviceAccounts as dicts | -| serviceAccounts.[sa-name] | `dict` | ✅ | ❌ | `{}` | Holds secret definition | -| serviceAccounts.[sa-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the secret | -| serviceAccounts.[sa-name].primary | `boolean` | ❌ | ❌ | `false` | Sets the service account as primary | -| serviceAccounts.[sa-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for secret | -| serviceAccounts.[sa-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for secret | -| serviceAccounts.[sa-name].targetSelectAll | `boolean` | ❌ | ❌ | | Whether to assign the serviceAccount to all pods or not | -| serviceAccounts.[sa-name].targetSelector | `list` | ❌ | ❌ | `[]` | Define the pod(s) to assign the serviceAccount | - -> When `targetSelectAll` is `true`, it will assign the serviceAccount to all pods (`targetSelector` is ignored in this case) -> When `targetSelector` is a list, each entry is a string, referencing the pod(s) name that will be assigned. -> When `targetSelector` is a empty, it will assign the serviceAccount to the primary pod - ---- - -Appears in: - -- `.Values.serviceAccounts` - ---- - -Naming scheme: - -- Primary: `$FullName` (release-name-chart-name) -- Non-Primary: `$FullName-$ServiceAccountName` (release-name-chart-name-ServiceAccountName) - ---- - -Examples: - -```yaml -serviceAccounts: - sa-name: - enabled: true - labels: - key: value - keytpl: "{{ .Values.some.value }}" - annotations: - key: value - keytpl: "{{ .Values.some.value }}" - targetSelectAll: true - - other-sa-name: - enabled: true - targetSelector: - - pod-name - - other-pod-name -``` diff --git a/library/common/1.0.0/docs/statefulset.md b/library/common/1.0.0/docs/statefulset.md index ab7b9ead41..209a0ac692 100644 --- a/library/common/1.0.0/docs/statefulset.md +++ b/library/common/1.0.0/docs/statefulset.md @@ -1,27 +1,27 @@ # DaemonSet -| Key | Type | Required | Helm Template | Default | Description | -| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :-------------------------------------------------------------------------- | -| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the controller (OnDelete, RollingUpdate) | -| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate | -| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate | -| controllers.[controller-name].rollingUpdate.partition | `int` | ❌ | ❌ | | Define the partition, Only when strategy is RollingUpdate | +| Key | Type | Required | Helm Template | Default | Description | +| :---------------------------------------------------- | :------: | :------: | :-----------: | :-------------: | :------------------------------------------------------------------- | +| workload.[workload-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the workload (OnDelete, RollingUpdate) | +| workload.[workload-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate | +| workload.[workload-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate | +| workload.[workload-name].rollingUpdate.partition | `int` | ❌ | ❌ | | Define the partition, Only when strategy is RollingUpdate | --- Notes: -View common `keys` of `controllers` in [Controllers Documentation](controllers.md). +View common `keys` of `workload` in [workload Documentation](workload.md). -> Value of `controllers.[controller-name].podSpec.restartPolicy` can only be `Always` for this type of controller +> Value of `workload.[workload-name].podSpec.restartPolicy` can only be `Always` for this type of workload --- Examples: ```yaml -controllers: - controller-name: +workload: + workload-name: enabled: true primary: true type: StatefulSet @@ -33,7 +33,7 @@ controllers: partition: 1 podSpec: {} - other-controller-name: + other-workload-name: enabled: true primary: false type: StatefulSet diff --git a/library/common/1.0.0/docs/workload.md b/library/common/1.0.0/docs/workload.md new file mode 100644 index 0000000000..6e80dd4873 --- /dev/null +++ b/library/common/1.0.0/docs/workload.md @@ -0,0 +1,132 @@ +# workload + +| Key | Type | Required | Helm Template | Default | Description | +| :----------------------------------------------------------------- | :-------: | :------: | :-----------: | :-------------------------------------------------------------: | :--------------------------------------------------------------------------------- | +| workload | `dict` | ❌ | ❌ | `{}` | Define the workload as dicts | +| workload.[workload-name] | `dict` | ✅ | ❌ | `{}` | Holds workload definition | +| workload.[workload-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the workload | +| workload.[workload-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the workload as primary | +| workload.[workload-name].labels | `dict` | ❌ | ❌ | `{}` | Additional labels for workload | +| workload.[workload-name].labels.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional label | +| workload.[workload-name].labels.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] of the additional label | +| workload.[workload-name].annotations | `dict` | ❌ | ❌ | `{}` | Additional annotations for workload | +| workload.[workload-name].annotations.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional annotation | +| workload.[workload-name].annotations.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] of the additional annotation | +| workload.[workload-name].type | `string` | ✅ | ❌ | `""` | Define the kind of the workload (Deployment, DaemonSet, StatefulSet, CronJob, Job) | +| workload.[workload-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition | +| workload.[workload-name].podSpec.labels | `dict` | ❌ | ❌ | `{}` | Additional Pod Labels | +| workload.[workload-name].podSpec.labels.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional label | +| workload.[workload-name].podSpec.labels.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] of the additional label | +| workload.[workload-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations | +| workload.[workload-name].podSpec.annotations.[key-name] | `string` | ❌ | ❌ | | [Key] of the additional annotation | +| workload.[workload-name].podSpec.annotations.[key-name].[value] | `string` | ❌ | ✅ | | [Value] of [key] of the additional annotation | +| workload.[workload-name].podSpec.automountServiceAccountToken | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.automountServiceAccoutnToken }}` (false) | Pod's automountServiceAccountToken | +| workload.[workload-name].podSpec.hostNetwork | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.hostNetwork }}` (false) | Pod's hostNetwork | +| workload.[workload-name].podSpec.enableServiceLinks | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.enableServiceLinks }}` (false) | Pod's enableServiceLinks | +| workload.[workload-name].podSpec.restartPolicy | `string` | ❌ | ✅ | `{{ .Values.podOptions.restartPolicy }}` (Always) | Pod's restartPolicy. (Always, Never, OnFailure) | +| workload.[workload-name].podSpec.schedulerName | `string` | ❌ | ✅ | `{{ .Values.podOptions.schedulerName }}` ("") | Pod's schedulerName | +| workload.[workload-name].podSpec.priorityClassName | `string` | ❌ | ✅ | `{{ .Values.podOptions.priorityClassName }}` ("") | Pod's priorityClassName | +| workload.[workload-name].podSpec.hostname | `string` | ❌ | ✅ | `""` | Pod's hostname | +| workload.[workload-name].podSpec.terminationGracePeriodSeconds | `int` | ❌ | ✅ | `{{ .Values.podOptions.terminationGracePeriodSeconds }}` (120) | Pod's terminationGracePeriodSeconds | +| workload.[workload-name].podSpec.nodeSelector | `dict` | ❌ | ❌ | `{{ .Values.podOptions.nodeSelector }}` ({}) | Pod's nodeSelector | +| workload.[workload-name].podSpec.nodeSelector.[key-name] | `string` | ❌ | ❌ | | [Key] for nodeSelector | +| workload.[workload-name].podSpec.nodeSelector.[key-name].[value] | `string` | ❌ | ✅ | | [Value] for [key] for nodeSelector | +| workload.[workload-name].podSpec.hostAliases | `list` | ❌ | ❌ | | Pod's host aliases | +| workload.[workload-name].podSpec.hostAliases.ip | `string` | ❌ | ✅ | | Value for `ip` in hosts aliases | +| workload.[workload-name].podSpec.hostAliases.hostnames | `list` | ❌ | ❌ | | Hostnames for the `ip` in hosts aliases | +| workload.[workload-name].podSpec.hostAliases.hostnames.[host-name] | `string` | ❌ | ✅ | | [Value] for `hostnames` for the `ip` in hosts aliases | +| workload.[workload-name].podSpec.dnsPolicy | `string` | ❌ | ✅ | `{{ .Values.podOptions.dnsPolicy }}` (ClusterFirst) | Pod's DNS Policy (ClusterFirst, ClusterFirstWithHostNet, Default, None). | +| workload.[workload-name].podSpec.tolerations | `list` | ❌ | ❌ | `{{ .Values.podOptions.tolerations }}` ([]) | Pod's Tolerations | +| workload.[workload-name].podSpec.tolerations.operator | `string` | ✅ | ✅ | | Toleration's `operator` (Equal, Exists) | +| workload.[workload-name].podSpec.tolerations.key | `string` | ❌/✅ | ✅ | | Toleration's `key`. Required only when `operator` = `Equal` | +| workload.[workload-name].podSpec.tolerations.value | `string` | ❌/✅ | ✅ | | Toleration's `value`. Required only when `operator` = `Equal` | +| workload.[workload-name].podSpec.tolerations.effect | `string` | ❌ | ✅ | | Toleration's `effect`.(NoExecute, NoSchedule, PreferNoSchedule) | +| workload.[workload-name].podSpec.tolerations.tolerationSeconds | `int` | ❌ | ❌ | | Toleration's `tolerationSeconds`. | +| workload.[workload-name].podSpec.runtimeClassName | `string` | ✅ | ❌ | `{{ .Values.podOptions.runtimeClassName }}` ("") | Pod's runtimeClassName | + +--- + +Notes + +> `dnsPolicy` is set automatically to `ClusterFirstWithHostNet` when `hostNetwork` is `true` > `runtimeClassName` will ignore any value set and use the `.Values.global.ixChartContext.nvidiaRuntimeClassName`, +> if a GPU is assigned to a container and Scale Middleware sets `.Values.global.ixChartContext.addNvidiaRuntimeClass` to `true`. +> Note that it will only set the `runtimeClassName` on the pod that this container belongs to. + +--- + +Appears in: + +- `.Values.workload` + +--- + +Naming scheme: + +- Primary: `$FullName` (release-name-chart-name) +- Non-Primary: `$FullName-$WorkloadName` (release-name-chart-name-workload-name) + +--- + +> Those are the common `keys` for all workload. +> Additional keys, information and examples, see on the specific kind of workload + +- [Deployment](deployment.md) +- [DaemonSet](daemonset.md) +- [StatefulSet](statefulset.md) +- [CronJob](cronjob.md) +- [Job](job.md) + +--- + +Examples: + +```yaml +workload: + workload-name: + enabled: true + primary: true + labels: + key: value + annotations: + key: value + podSpec: + labels: + key: value + annotations: + key: value + automountServiceAccountToken: true + hostNetwork: false + enableServiceLinks: false + schedulerName: some-scheduler + priorityClassName: some-priority-class-name + hostname: some-hostname + terminationGracePeriodSeconds: 100 + nodeSelector: + disk_type: ssd + hostAliases: + - ip: 10.10.10.100 + hostnames: + - myserver.local + - storage.local + - ip: 10.10.10.101 + hostnames: + - myotherserver.local + - backups.local + dnsPolicy: ClusterFirst + dnsConfig: + nameservers: + - 1.1.1.1 + - 1.0.0.1 + searches: + - ns1.svc.cluster-domain.example + - my.dns.search.suffix + options: + - name: ndots + value: "2" + - name: edns0 + tolerations: + - operator: Exists + effect: NoExecute + tolerationSeconds: 3600 + runtimeClassName: some-runtime-class +``` diff --git a/library/common/1.0.0/templates/classes/_cronjob.tpl b/library/common/1.0.0/templates/classes/_cronjob.tpl index 7caf769246..4892689075 100644 --- a/library/common/1.0.0/templates/classes/_cronjob.tpl +++ b/library/common/1.0.0/templates/classes/_cronjob.tpl @@ -10,7 +10,7 @@ objectData: The object data to be used to render the CronJob. {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} - {{- include "ix.v1.common.lib.controller.cronjobValidation" (dict "objectData" $objectData) }} + {{- include "ix.v1.common.lib.workload.cronjobValidation" (dict "objectData" $objectData) }} --- apiVersion: batch/v1 kind: CronJob @@ -27,7 +27,7 @@ metadata: {{- . | nindent 4 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.cronjobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} + {{- include "ix.v1.common.lib.workload.cronjobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} template: metadata: {{- $labels := (mustMerge ($objectData.podSpec.labels | default dict) @@ -46,5 +46,5 @@ spec: {{- . | nindent 12 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 10 }} + {{- include "ix.v1.common.lib.workload.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 10 }} {{- end -}} diff --git a/library/common/1.0.0/templates/classes/_daemonset.tpl b/library/common/1.0.0/templates/classes/_daemonset.tpl index 80bbdbf5fe..f1880156c3 100644 --- a/library/common/1.0.0/templates/classes/_daemonset.tpl +++ b/library/common/1.0.0/templates/classes/_daemonset.tpl @@ -10,7 +10,7 @@ objectData: The object data to be used to render the DaemonSet. {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} - {{- include "ix.v1.common.lib.controller.daemonsetValidation" (dict "objectData" $objectData) }} + {{- include "ix.v1.common.lib.workload.daemonsetValidation" (dict "objectData" $objectData) }} --- apiVersion: apps/v1 kind: DaemonSet @@ -27,7 +27,7 @@ metadata: {{- . | nindent 4 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.daemonsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} + {{- include "ix.v1.common.lib.workload.daemonsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} selector: matchLabels: {{- include "ix.v1.common.lib.metadata.selectorLabels" (dict "rootCtx" $rootCtx "podName" $objectData.name) | nindent 6 }} @@ -49,5 +49,5 @@ spec: {{- . | nindent 8 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} + {{- include "ix.v1.common.lib.workload.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} {{- end -}} diff --git a/library/common/1.0.0/templates/classes/_deployment.tpl b/library/common/1.0.0/templates/classes/_deployment.tpl index e5afc1b1c1..895dc067ff 100644 --- a/library/common/1.0.0/templates/classes/_deployment.tpl +++ b/library/common/1.0.0/templates/classes/_deployment.tpl @@ -10,7 +10,7 @@ objectData: The object data to be used to render the Deployment. {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} - {{- include "ix.v1.common.lib.controller.deploymentValidation" (dict "objectData" $objectData) }} + {{- include "ix.v1.common.lib.workload.deploymentValidation" (dict "objectData" $objectData) }} --- apiVersion: apps/v1 kind: Deployment @@ -27,7 +27,7 @@ metadata: {{- . | nindent 4 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.deploymentSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} + {{- include "ix.v1.common.lib.workload.deploymentSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} selector: matchLabels: {{- include "ix.v1.common.lib.metadata.selectorLabels" (dict "rootCtx" $rootCtx "podName" $objectData.name) | nindent 6 }} @@ -49,5 +49,5 @@ spec: {{- . | nindent 8 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} + {{- include "ix.v1.common.lib.workload.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} {{- end -}} diff --git a/library/common/1.0.0/templates/classes/_job.tpl b/library/common/1.0.0/templates/classes/_job.tpl index bbd037da61..18569075f0 100644 --- a/library/common/1.0.0/templates/classes/_job.tpl +++ b/library/common/1.0.0/templates/classes/_job.tpl @@ -10,7 +10,7 @@ objectData: The object data to be used to render the Job. {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} - {{- include "ix.v1.common.lib.controller.jobValidation" (dict "objectData" $objectData) }} + {{- include "ix.v1.common.lib.workload.jobValidation" (dict "objectData" $objectData) }} --- apiVersion: batch/v1 kind: Job @@ -27,7 +27,7 @@ metadata: {{- . | nindent 4 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} + {{- include "ix.v1.common.lib.workload.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} template: metadata: {{- $labels := (mustMerge ($objectData.podSpec.labels | default dict) @@ -46,5 +46,5 @@ spec: {{- . | nindent 8 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} + {{- include "ix.v1.common.lib.workload.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} {{- end -}} diff --git a/library/common/1.0.0/templates/classes/_statefulset.tpl b/library/common/1.0.0/templates/classes/_statefulset.tpl index 792fd44f61..1cb6cc87ec 100644 --- a/library/common/1.0.0/templates/classes/_statefulset.tpl +++ b/library/common/1.0.0/templates/classes/_statefulset.tpl @@ -10,7 +10,7 @@ objectData: The object data to be used to render the StatefulSet. {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} - {{- include "ix.v1.common.lib.controller.statefulsetValidation" (dict "objectData" $objectData) }} + {{- include "ix.v1.common.lib.workload.statefulsetValidation" (dict "objectData" $objectData) }} --- apiVersion: apps/v1 kind: StatefulSet @@ -27,7 +27,7 @@ metadata: {{- . | nindent 4 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.statefulsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} + {{- include "ix.v1.common.lib.workload.statefulsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 2 }} selector: matchLabels: {{- include "ix.v1.common.lib.metadata.selectorLabels" (dict "rootCtx" $rootCtx "podName" $objectData.name) | nindent 6 }} @@ -49,5 +49,5 @@ spec: {{- . | nindent 8 }} {{- end }} spec: - {{- include "ix.v1.common.lib.controller.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} + {{- include "ix.v1.common.lib.workload.pod" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 6 }} {{- end -}} diff --git a/library/common/1.0.0/templates/lib/controller/validation/_controllerValidation.tpl b/library/common/1.0.0/templates/lib/controller/validation/_controllerValidation.tpl deleted file mode 100644 index 06b072057b..0000000000 --- a/library/common/1.0.0/templates/lib/controller/validation/_controllerValidation.tpl +++ /dev/null @@ -1,63 +0,0 @@ -{{/* Controllers Basic Validation */}} -{{/* Call this template: -{{ include "ix.v1.common.lib.controllers.primaryValidation" $ -}} -*/}} -{{- define "ix.v1.common.lib.controllers.primaryValidation" -}} - - {{/* Initialize values */}} - {{- $hasPrimary := false -}} - {{- $hasEnabled := false -}} - - {{/* Go over controllers */}} - {{- range $name, $controller := .Values.controllers -}} - - {{- if not (mustHas $controller.type (list "Deployment" "StatefulSet" "DaemonSet" "Job" "CronJob")) -}} - {{- fail (printf "Controller - Expected to be one of [Deployment, StatefulSet, DaemonSet, Job, CronJob], but got [%s]" $controller.type) -}} - {{- end -}} - - {{/* If controller is enabled */}} - {{- if $controller.enabled -}} - {{- $hasEnabled = true -}} - - {{/* And controller is primary */}} - {{- if and (hasKey $controller "primary") ($controller.primary) -}} - - {{/* Fail if there is already a primary controller */}} - {{- if $hasPrimary -}} - {{- fail "Controller - Only one controller can be primary" -}} - {{- end -}} - - {{- $hasPrimary = true -}} - - {{- end -}} - {{- end -}} - - {{- end -}} - - {{/* Require at least one primary controller, if any enabled */}} - {{- if and $hasEnabled (not $hasPrimary) -}} - {{- fail "Controller - At least one enabled controller must be primary" -}} - {{- end -}} - -{{- end -}} - -{{/* Controller Basic Validation */}} -{{/* Call this template: -{{ include "ix.v1.common.lib.controller.basicValidation" (dict "objectData" $objectData) -}} -rootCtx: The root context of the template. It is used to access the global context. -objectData: - labels: The labels of the object. - annotations: The annotations of the object. -*/}} -{{- define "ix.v1.common.lib.controller.basicValidation" -}} - {{- $objectData := .objectData -}} - - {{- if and $objectData.labels (not (kindIs "map" $objectData.labels)) -}} - {{- fail (printf "Controller - Expected to be a dictionary, but got [%v]" (kindOf $objectData.labels)) -}} - {{- end -}} - - {{- if and $objectData.annotations (not (kindIs "map" $objectData.annotations)) -}} - {{- fail (printf "Controller - Expected to be a dictionary, but got [%v]" (kindOf $objectData.annotations)) -}} - {{- end -}} - -{{- end -}} diff --git a/library/common/1.0.0/templates/lib/pod/_imagePullSecrets.tpl b/library/common/1.0.0/templates/lib/pod/_imagePullSecret.tpl similarity index 84% rename from library/common/1.0.0/templates/lib/pod/_imagePullSecrets.tpl rename to library/common/1.0.0/templates/lib/pod/_imagePullSecret.tpl index 7d01f94731..b09bdbf4cc 100644 --- a/library/common/1.0.0/templates/lib/pod/_imagePullSecrets.tpl +++ b/library/common/1.0.0/templates/lib/pod/_imagePullSecret.tpl @@ -1,16 +1,16 @@ {{/* Returns Image Pull Secret List */}} {{/* Call this template: -{{ include "ix.v1.common.lib.pod.imagePullSecrets" (dict "rootCtx" $ "objectData" $objectData) }} +{{ include "ix.v1.common.lib.pod.imagePullSecret" (dict "rootCtx" $ "objectData" $objectData) }} rootCtx: The root context of the template. It is used to access the global context. objectData: The object data to be used to render the Pod. */}} -{{- define "ix.v1.common.lib.pod.imagePullSecrets" -}} +{{- define "ix.v1.common.lib.pod.imagePullSecret" -}} {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} {{- $imgPullSecrets := list -}} - {{- range $name, $imgPull := $rootCtx.Values.imagePullSecrets -}} + {{- range $name, $imgPull := $rootCtx.Values.imagePullSecret -}} {{- $pullName := (printf "%s-%s" (include "ix.v1.common.lib.chart.names.fullname" $rootCtx) $name) -}} {{- if $imgPull.enabled -}} diff --git a/library/common/1.0.0/templates/lib/pod/_serviceAccountName.tpl b/library/common/1.0.0/templates/lib/pod/_serviceAccountName.tpl index 0dae50b251..9573e5686a 100644 --- a/library/common/1.0.0/templates/lib/pod/_serviceAccountName.tpl +++ b/library/common/1.0.0/templates/lib/pod/_serviceAccountName.tpl @@ -11,7 +11,7 @@ objectData: The object data to be used to render the Pod. {{- $saName := "default" -}} {{- $saNameCount := 0 -}} - {{- range $name, $serviceAccount := $rootCtx.Values.serviceAccounts -}} + {{- range $name, $serviceAccount := $rootCtx.Values.serviceAccount -}} {{- $name = (printf "%s-%s" (include "ix.v1.common.lib.chart.names.fullname" $rootCtx) $name) -}} {{- if $serviceAccount.enabled -}} diff --git a/library/common/1.0.0/templates/lib/serviceAccount/_validation.tpl b/library/common/1.0.0/templates/lib/serviceAccount/_validation.tpl index 5d67016e03..3b0d6d2275 100644 --- a/library/common/1.0.0/templates/lib/serviceAccount/_validation.tpl +++ b/library/common/1.0.0/templates/lib/serviceAccount/_validation.tpl @@ -34,7 +34,7 @@ objectData: {{/* Initialize values */}} {{- $hasPrimary := false -}} - {{- range $name, $serviceAccount := .Values.serviceAccounts -}} + {{- range $name, $serviceAccount := .Values.serviceAccount -}} {{/* If service account is enabled */}} {{- if $serviceAccount.enabled -}} diff --git a/library/common/1.0.0/templates/lib/controller/_cronjobSpec.tpl b/library/common/1.0.0/templates/lib/workload/_cronjobSpec.tpl similarity index 81% rename from library/common/1.0.0/templates/lib/controller/_cronjobSpec.tpl rename to library/common/1.0.0/templates/lib/workload/_cronjobSpec.tpl index a4fd6c668e..e3e0f4444d 100644 --- a/library/common/1.0.0/templates/lib/controller/_cronjobSpec.tpl +++ b/library/common/1.0.0/templates/lib/workload/_cronjobSpec.tpl @@ -1,6 +1,6 @@ {{/* CronJob Spec */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.cronjobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.cronjobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: schedule: The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. @@ -11,7 +11,7 @@ objectData: timezone: The timezone name. Defaults to .Values.TZ. +jobSpec data */}} -{{- define "ix.v1.common.lib.controller.cronjobSpec" -}} +{{- define "ix.v1.common.lib.workload.cronjobSpec" -}} {{- $objectData := .objectData -}} {{- $rootCtx := .rootCtx -}} timeZone: {{ (tpl ($objectData.timezone | default $rootCtx.Values.TZ) $rootCtx) | quote }} @@ -22,5 +22,5 @@ successfulJobsHistoryLimit: {{ $objectData.successfulJobsHistoryLimit | default startingDeadlineSeconds: {{ $objectData.startingDeadlineSeconds | default nil }} jobTemplate: spec: - {{- include "ix.v1.common.lib.controller.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 4 }} + {{- include "ix.v1.common.lib.workload.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 4 }} {{- end -}} diff --git a/library/common/1.0.0/templates/lib/controller/_daemonsetSpec.tpl b/library/common/1.0.0/templates/lib/workload/_daemonsetSpec.tpl similarity index 85% rename from library/common/1.0.0/templates/lib/controller/_daemonsetSpec.tpl rename to library/common/1.0.0/templates/lib/workload/_daemonsetSpec.tpl index 3a4ad745cc..e87dfe86a3 100644 --- a/library/common/1.0.0/templates/lib/controller/_daemonsetSpec.tpl +++ b/library/common/1.0.0/templates/lib/workload/_daemonsetSpec.tpl @@ -1,13 +1,13 @@ {{/* DaemonSet Spec */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.daemonsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.daemonsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: replicas: The number of replicas. revisionHistoryLimit: The number of old ReplicaSets to retain to allow rollback. strategy: The daemonset strategy to use to replace existing pods with new ones. */}} -{{- define "ix.v1.common.lib.controller.daemonsetSpec" -}} +{{- define "ix.v1.common.lib.workload.daemonsetSpec" -}} {{- $objectData := .objectData -}} {{- $rootCtx := .rootCtx -}} revisionHistoryLimit: {{ $objectData.revisionHistoryLimit | default 3 }} diff --git a/library/common/1.0.0/templates/lib/controller/_deployementSpec.tpl b/library/common/1.0.0/templates/lib/workload/_deployementSpec.tpl similarity index 85% rename from library/common/1.0.0/templates/lib/controller/_deployementSpec.tpl rename to library/common/1.0.0/templates/lib/workload/_deployementSpec.tpl index 066986f347..fabc680946 100644 --- a/library/common/1.0.0/templates/lib/controller/_deployementSpec.tpl +++ b/library/common/1.0.0/templates/lib/workload/_deployementSpec.tpl @@ -1,13 +1,13 @@ {{/* Deployment Spec */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.deploymentSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.deploymentSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: replicas: The number of replicas. revisionHistoryLimit: The number of old ReplicaSets to retain to allow rollback. strategy: The deployment strategy to use to replace existing pods with new ones. */}} -{{- define "ix.v1.common.lib.controller.deploymentSpec" -}} +{{- define "ix.v1.common.lib.workload.deploymentSpec" -}} {{- $objectData := .objectData -}} {{- $rootCtx := .rootCtx -}} replicas: {{ $objectData.replicas | default 1 }} diff --git a/library/common/1.0.0/templates/lib/controller/_jobSpec.tpl b/library/common/1.0.0/templates/lib/workload/_jobSpec.tpl similarity index 92% rename from library/common/1.0.0/templates/lib/controller/_jobSpec.tpl rename to library/common/1.0.0/templates/lib/workload/_jobSpec.tpl index 32fb804c16..e8bb0d36f2 100644 --- a/library/common/1.0.0/templates/lib/controller/_jobSpec.tpl +++ b/library/common/1.0.0/templates/lib/workload/_jobSpec.tpl @@ -1,6 +1,6 @@ {{/* Job Spec */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: backoffLimit: The number of retries before marking this job failed. Defaults to 6. @@ -10,7 +10,7 @@ objectData: ttlSecondsAfterFinished: TTLSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature. completionMode: CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. */}} -{{- define "ix.v1.common.lib.controller.jobSpec" -}} +{{- define "ix.v1.common.lib.workload.jobSpec" -}} {{- $objectData := .objectData -}} {{- $rootCtx := .rootCtx -}} backoffLimit: {{ $objectData.backoffLimit | default 5 }} diff --git a/library/common/1.0.0/templates/lib/controller/_pod.tpl b/library/common/1.0.0/templates/lib/workload/_pod.tpl similarity index 90% rename from library/common/1.0.0/templates/lib/controller/_pod.tpl rename to library/common/1.0.0/templates/lib/workload/_pod.tpl index df7ad67c26..587b4ec0ca 100644 --- a/library/common/1.0.0/templates/lib/controller/_pod.tpl +++ b/library/common/1.0.0/templates/lib/workload/_pod.tpl @@ -1,16 +1,16 @@ {{/* Pod Spec */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.pod" (dict "rootCtx" $ "objectData" $objectData) }} +{{ include "ix.v1.common.lib.workload.pod" (dict "rootCtx" $ "objectData" $objectData) }} rootCtx: The root context of the template. It is used to access the global context. objectData: The object data to be used to render the Pod. */}} -{{- define "ix.v1.common.lib.controller.pod" -}} +{{- define "ix.v1.common.lib.workload.pod" -}} {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} serviceAccountName: {{ include "ix.v1.common.lib.pod.serviceAccountName" (dict "rootCtx" $rootCtx "objectData" $objectData) }} automountServiceAccountToken: {{ include "ix.v1.common.lib.pod.automountServiceAccountToken" (dict "rootCtx" $rootCtx "objectData" $objectData) }} runtimeClassName: {{ include "ix.v1.common.lib.pod.runtimeClassName" (dict "rootCtx" $rootCtx "objectData" $objectData) }} - {{- with (include "ix.v1.common.lib.pod.imagePullSecrets" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }} + {{- with (include "ix.v1.common.lib.pod.imagePullSecret" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }} imagePullSecrets: {{- . | nindent 2 }} {{- end }} diff --git a/library/common/1.0.0/templates/lib/controller/_statefulsettSpec.tpl b/library/common/1.0.0/templates/lib/workload/_statefulsettSpec.tpl similarity index 86% rename from library/common/1.0.0/templates/lib/controller/_statefulsettSpec.tpl rename to library/common/1.0.0/templates/lib/workload/_statefulsettSpec.tpl index 843e2ad5b7..64f1f58ff3 100644 --- a/library/common/1.0.0/templates/lib/controller/_statefulsettSpec.tpl +++ b/library/common/1.0.0/templates/lib/workload/_statefulsettSpec.tpl @@ -1,13 +1,13 @@ {{/* StatefulSet Spec */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.statefulsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.statefulsetSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: replicas: The number of replicas. revisionHistoryLimit: The number of old ReplicaSets to retain to allow rollback. strategy: The statefulset strategy to use to replace existing pods with new ones. */}} -{{- define "ix.v1.common.lib.controller.statefulsetSpec" -}} +{{- define "ix.v1.common.lib.workload.statefulsetSpec" -}} {{- $objectData := .objectData -}} {{- $rootCtx := .rootCtx -}} replicas: {{ $objectData.replicas | default 1 }} diff --git a/library/common/1.0.0/templates/lib/controller/validation/_cronjobValidation.tpl b/library/common/1.0.0/templates/lib/workload/validation/_cronjobValidation.tpl similarity index 79% rename from library/common/1.0.0/templates/lib/controller/validation/_cronjobValidation.tpl rename to library/common/1.0.0/templates/lib/workload/validation/_cronjobValidation.tpl index b18d025567..aa3961768b 100644 --- a/library/common/1.0.0/templates/lib/controller/validation/_cronjobValidation.tpl +++ b/library/common/1.0.0/templates/lib/workload/validation/_cronjobValidation.tpl @@ -1,13 +1,13 @@ {{/* CronJob Validation */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.cronjobValidation" (dict "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.cronjobValidation" (dict "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: completionMode: The completionMode of the object. completions: The completions of the object. parallelism: The parallelism of the object. */}} -{{- define "ix.v1.common.lib.controller.cronjobValidation" -}} +{{- define "ix.v1.common.lib.workload.cronjobValidation" -}} {{- $objectData := .objectData -}} {{- if $objectData.concurrencyPolicy -}} @@ -24,6 +24,6 @@ objectData: {{- end -}} {{/* CronJob contains a job inside, so we validate job values too */}} - {{- include "ix.v1.common.lib.controller.jobValidation" (dict "objectData" $objectData) -}} + {{- include "ix.v1.common.lib.workload.jobValidation" (dict "objectData" $objectData) -}} {{- end -}} {{/* TODO: Extend validation for other values of cronjob */}} diff --git a/library/common/1.0.0/templates/lib/controller/validation/_daemonsetValidation.tpl b/library/common/1.0.0/templates/lib/workload/validation/_daemonsetValidation.tpl similarity index 85% rename from library/common/1.0.0/templates/lib/controller/validation/_daemonsetValidation.tpl rename to library/common/1.0.0/templates/lib/workload/validation/_daemonsetValidation.tpl index 06133206ac..d0892067cf 100644 --- a/library/common/1.0.0/templates/lib/controller/validation/_daemonsetValidation.tpl +++ b/library/common/1.0.0/templates/lib/workload/validation/_daemonsetValidation.tpl @@ -1,12 +1,12 @@ {{/* DaemonSet Validation */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.daemonsetValidation" (dict "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.daemonsetValidation" (dict "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: strategy: The strategy of the object. rollingUpdate: The rollingUpdate of the object. */}} -{{- define "ix.v1.common.lib.controller.daemonsetValidation" -}} +{{- define "ix.v1.common.lib.workload.daemonsetValidation" -}} {{- $objectData := .objectData -}} {{- if $objectData.strategy -}} diff --git a/library/common/1.0.0/templates/lib/controller/validation/_deploymentValidation.tpl b/library/common/1.0.0/templates/lib/workload/validation/_deploymentValidation.tpl similarity index 85% rename from library/common/1.0.0/templates/lib/controller/validation/_deploymentValidation.tpl rename to library/common/1.0.0/templates/lib/workload/validation/_deploymentValidation.tpl index deaa0896d9..df39f74b40 100644 --- a/library/common/1.0.0/templates/lib/controller/validation/_deploymentValidation.tpl +++ b/library/common/1.0.0/templates/lib/workload/validation/_deploymentValidation.tpl @@ -1,12 +1,12 @@ {{/* Deployment Validation */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.deploymentValidation" (dict "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.deploymentValidation" (dict "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: strategy: The strategy of the object. rollingUpdate: The rollingUpdate of the object. */}} -{{- define "ix.v1.common.lib.controller.deploymentValidation" -}} +{{- define "ix.v1.common.lib.workload.deploymentValidation" -}} {{- $objectData := .objectData -}} {{- if $objectData.strategy -}} diff --git a/library/common/1.0.0/templates/lib/controller/validation/_jobValidation.tpl b/library/common/1.0.0/templates/lib/workload/validation/_jobValidation.tpl similarity index 88% rename from library/common/1.0.0/templates/lib/controller/validation/_jobValidation.tpl rename to library/common/1.0.0/templates/lib/workload/validation/_jobValidation.tpl index d18f7dcd50..02df2947fa 100644 --- a/library/common/1.0.0/templates/lib/controller/validation/_jobValidation.tpl +++ b/library/common/1.0.0/templates/lib/workload/validation/_jobValidation.tpl @@ -1,13 +1,13 @@ {{/* Job Validation */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.jobValidation" (dict "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.jobValidation" (dict "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: completionMode: The completionMode of the object. completions: The completions of the object. parallelism: The parallelism of the object. */}} -{{- define "ix.v1.common.lib.controller.jobValidation" -}} +{{- define "ix.v1.common.lib.workload.jobValidation" -}} {{- $objectData := .objectData -}} {{- if $objectData.completionMode -}} diff --git a/library/common/1.0.0/templates/lib/controller/validation/_statefusetValidation.tpl b/library/common/1.0.0/templates/lib/workload/validation/_statefusetValidation.tpl similarity index 85% rename from library/common/1.0.0/templates/lib/controller/validation/_statefusetValidation.tpl rename to library/common/1.0.0/templates/lib/workload/validation/_statefusetValidation.tpl index ca5602d368..21b2492701 100644 --- a/library/common/1.0.0/templates/lib/controller/validation/_statefusetValidation.tpl +++ b/library/common/1.0.0/templates/lib/workload/validation/_statefusetValidation.tpl @@ -1,12 +1,12 @@ {{/* StatefulSet Validation */}} {{/* Call this template: -{{ include "ix.v1.common.lib.controller.statefulsetValidation" (dict "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.workload.statefulsetValidation" (dict "objectData" $objectData) -}} rootCtx: The root context of the template. It is used to access the global context. objectData: strategy: The strategy of the object. rollingUpdate: The rollingUpdate of the object. */}} -{{- define "ix.v1.common.lib.controller.statefulsetValidation" -}} +{{- define "ix.v1.common.lib.workload.statefulsetValidation" -}} {{- $objectData := .objectData -}} {{- if $objectData.strategy -}} diff --git a/library/common/1.0.0/templates/lib/workload/validation/_workloadValidation.tpl b/library/common/1.0.0/templates/lib/workload/validation/_workloadValidation.tpl new file mode 100644 index 0000000000..3934aeacf5 --- /dev/null +++ b/library/common/1.0.0/templates/lib/workload/validation/_workloadValidation.tpl @@ -0,0 +1,63 @@ +{{/* Workload Basic Validation */}} +{{/* Call this template: +{{ include "ix.v1.common.lib.workload.primaryValidation" $ -}} +*/}} +{{- define "ix.v1.common.lib.workload.primaryValidation" -}} + + {{/* Initialize values */}} + {{- $hasPrimary := false -}} + {{- $hasEnabled := false -}} + + {{/* Go over workload */}} + {{- range $name, $workload := .Values.workload -}} + + {{- if not (mustHas $workload.type (list "Deployment" "StatefulSet" "DaemonSet" "Job" "CronJob")) -}} + {{- fail (printf "Workload - Expected to be one of [Deployment, StatefulSet, DaemonSet, Job, CronJob], but got [%s]" $workload.type) -}} + {{- end -}} + + {{/* If workload is enabled */}} + {{- if $workload.enabled -}} + {{- $hasEnabled = true -}} + + {{/* And workload is primary */}} + {{- if and (hasKey $workload "primary") ($workload.primary) -}} + + {{/* Fail if there is already a primary workload */}} + {{- if $hasPrimary -}} + {{- fail "Workload - Only one workload can be primary" -}} + {{- end -}} + + {{- $hasPrimary = true -}} + + {{- end -}} + {{- end -}} + + {{- end -}} + + {{/* Require at least one primary workload, if any enabled */}} + {{- if and $hasEnabled (not $hasPrimary) -}} + {{- fail "Workload - At least one enabled workload must be primary" -}} + {{- end -}} + +{{- end -}} + +{{/* Workload Basic Validation */}} +{{/* Call this template: +{{ include "ix.v1.common.lib.workload.basicValidation" (dict "objectData" $objectData) -}} +rootCtx: The root context of the template. It is used to access the global context. +objectData: + labels: The labels of the object. + annotations: The annotations of the object. +*/}} +{{- define "ix.v1.common.lib.workload.basicValidation" -}} + {{- $objectData := .objectData -}} + + {{- if and $objectData.labels (not (kindIs "map" $objectData.labels)) -}} + {{- fail (printf "Workload - Expected to be a dictionary, but got [%v]" (kindOf $objectData.labels)) -}} + {{- end -}} + + {{- if and $objectData.annotations (not (kindIs "map" $objectData.annotations)) -}} + {{- fail (printf "Workload - Expected to be a dictionary, but got [%v]" (kindOf $objectData.annotations)) -}} + {{- end -}} + +{{- end -}} diff --git a/library/common/1.0.0/templates/loader/_apply.tpl b/library/common/1.0.0/templates/loader/_apply.tpl index 933ae95be8..8439ce752c 100644 --- a/library/common/1.0.0/templates/loader/_apply.tpl +++ b/library/common/1.0.0/templates/loader/_apply.tpl @@ -2,18 +2,18 @@ {{- define "ix.v1.common.loader.apply" -}} {{/* Render ConfigMap(s) */}} - {{- include "ix.v1.common.spawner.configmaps" . | nindent 0 -}} + {{- include "ix.v1.common.spawner.configmap" . | nindent 0 -}} {{/* Render Secret(s) */}} - {{- include "ix.v1.common.spawner.secrets" . | nindent 0 -}} + {{- include "ix.v1.common.spawner.secret" . | nindent 0 -}} {{/* Render Image Pull Secrets(s) */}} - {{- include "ix.v1.common.spawner.imagePullSecrets" . | nindent 0 -}} + {{- include "ix.v1.common.spawner.imagePullSecret" . | nindent 0 -}} {{/* Render Service Accounts(s) */}} - {{- include "ix.v1.common.spawner.serviceAccounts" . | nindent 0 -}} + {{- include "ix.v1.common.spawner.serviceAccount" . | nindent 0 -}} - {{/* Render Controller(s) */}} - {{- include "ix.v1.common.spawner.controllers" . | nindent 0 -}} + {{/* Render Workload(s) */}} + {{- include "ix.v1.common.spawner.workload" . | nindent 0 -}} {{- end -}} diff --git a/library/common/1.0.0/templates/spawner/_configmap.tpl b/library/common/1.0.0/templates/spawner/_configmap.tpl index bb4693e4e9..3ee521b798 100644 --- a/library/common/1.0.0/templates/spawner/_configmap.tpl +++ b/library/common/1.0.0/templates/spawner/_configmap.tpl @@ -1,11 +1,11 @@ {{/* Configmap Spawwner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.configmaps" $ -}} +{{ include "ix.v1.common.spawner.configmap" $ -}} */}} -{{- define "ix.v1.common.spawner.configmaps" -}} +{{- define "ix.v1.common.spawner.configmap" -}} - {{- range $name, $configmap := .Values.configmaps -}} + {{- range $name, $configmap := .Values.configmap -}} {{- if $configmap.enabled -}} diff --git a/library/common/1.0.0/templates/spawner/_imagePullSecret.tpl b/library/common/1.0.0/templates/spawner/_imagePullSecret.tpl index 97fb830355..95c43f0865 100644 --- a/library/common/1.0.0/templates/spawner/_imagePullSecret.tpl +++ b/library/common/1.0.0/templates/spawner/_imagePullSecret.tpl @@ -1,11 +1,11 @@ {{/* Image Pull Secrets Spawner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.imagePullSecrets" $ -}} +{{ include "ix.v1.common.spawner.imagePullSecret" $ -}} */}} -{{- define "ix.v1.common.spawner.imagePullSecrets" -}} +{{- define "ix.v1.common.spawner.imagePullSecret" -}} - {{- range $name, $imgPullSecret := .Values.imagePullSecrets -}} + {{- range $name, $imgPullSecret := .Values.imagePullSecret -}} {{- if $imgPullSecret.enabled -}} diff --git a/library/common/1.0.0/templates/spawner/_secret.tpl b/library/common/1.0.0/templates/spawner/_secret.tpl index 01691b4765..b1cfdfc0c6 100644 --- a/library/common/1.0.0/templates/spawner/_secret.tpl +++ b/library/common/1.0.0/templates/spawner/_secret.tpl @@ -1,11 +1,11 @@ {{/* Secret Spawwner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.secrets" $ -}} +{{ include "ix.v1.common.spawner.secret" $ -}} */}} -{{- define "ix.v1.common.spawner.secrets" -}} +{{- define "ix.v1.common.spawner.secret" -}} - {{- range $name, $secret := .Values.secrets -}} + {{- range $name, $secret := .Values.secret -}} {{- if $secret.enabled -}} diff --git a/library/common/1.0.0/templates/spawner/_serviceAccount.tpl b/library/common/1.0.0/templates/spawner/_serviceAccount.tpl index a44f883b05..05c1cb6975 100644 --- a/library/common/1.0.0/templates/spawner/_serviceAccount.tpl +++ b/library/common/1.0.0/templates/spawner/_serviceAccount.tpl @@ -1,14 +1,14 @@ {{/* Service Account Spawner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.serviceAccounts" $ -}} +{{ include "ix.v1.common.spawner.serviceAccount" $ -}} */}} -{{- define "ix.v1.common.spawner.serviceAccounts" -}} +{{- define "ix.v1.common.spawner.serviceAccount" -}} {{/* Primary validation for enabled service accounts. */}} {{- include "ix.v1.common.lib.serviceAccount.primaryValidation" $ -}} - {{- range $name, $serviceAccount := .Values.serviceAccounts -}} + {{- range $name, $serviceAccount := .Values.serviceAccount -}} {{- if $serviceAccount.enabled -}} diff --git a/library/common/1.0.0/templates/spawner/_controller.tpl b/library/common/1.0.0/templates/spawner/_workload.tpl similarity index 69% rename from library/common/1.0.0/templates/spawner/_controller.tpl rename to library/common/1.0.0/templates/spawner/_workload.tpl index 772b36efa0..d4c716a265 100644 --- a/library/common/1.0.0/templates/spawner/_controller.tpl +++ b/library/common/1.0.0/templates/spawner/_workload.tpl @@ -1,21 +1,21 @@ -{{/* Controller Spawner */}} +{{/* Workload Spawner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.controllers" $ -}} +{{ include "ix.v1.common.spawner.workload" $ -}} */}} -{{- define "ix.v1.common.spawner.controllers" -}} +{{- define "ix.v1.common.spawner.workload" -}} - {{/* Primary validation for enabled controllers. */}} - {{- include "ix.v1.common.lib.controllers.primaryValidation" $ -}} + {{/* Primary validation for enabled workload. */}} + {{- include "ix.v1.common.lib.workload.primaryValidation" $ -}} - {{- range $name, $controller := .Values.controllers -}} + {{- range $name, $workload := .Values.workload -}} - {{- if $controller.enabled -}} + {{- if $workload.enabled -}} - {{/* Create a copy of the controller */}} - {{- $objectData := (mustDeepCopy $controller) -}} + {{/* Create a copy of the workload */}} + {{- $objectData := (mustDeepCopy $workload) -}} - {{/* Generate the name of the controller */}} + {{/* Generate the name of the workload */}} {{- $objectName := include "ix.v1.common.lib.chart.names.fullname" $ -}} {{- if not $objectData.primary -}} {{- $objectName = printf "%s-%s" (include "ix.v1.common.lib.chart.names.fullname" $) $name -}} @@ -23,9 +23,9 @@ {{/* Perform validations */}} {{- include "ix.v1.common.lib.chart.names.validation" (dict "name" $objectName) -}} - {{- include "ix.v1.common.lib.controller.basicValidation" (dict "objectData" $objectData) -}} + {{- include "ix.v1.common.lib.workload.basicValidation" (dict "objectData" $objectData) -}} - {{/* Set the name of the controller */}} + {{/* Set the name of the workload */}} {{- $_ := set $objectData "name" $objectName -}} {{/* Short name is the one that defined on the chart, used on selectors */}} diff --git a/library/common/1.0.0/values.yaml b/library/common/1.0.0/values.yaml index d4cc6cc591..7ddaddf1a1 100644 --- a/library/common/1.0.0/values.yaml +++ b/library/common/1.0.0/values.yaml @@ -39,7 +39,7 @@ image: pullPolicy: IfNotPresent # -- Service Account: -serviceAccounts: +serviceAccount: sa-name: # -- Enables the service account enabled: false @@ -375,34 +375,34 @@ notes: # Documentation # Bug reports -# -- Controllers -controllers: - # -- Controller name +# -- workload +workload: + # -- Workload name main: - # -- Enables the controller + # -- Enables the workload enabled: true - # -- Primary controller + # -- Primary workload primary: true - # -- Controller type + # -- Workload type type: Deployment - # -- Controller labels + # -- Workload labels # labels: {} - # # -- Controller annotations + # # -- Workload annotations # annotations: {} - # # -- Controller replicas (Deployment and StatefulSet only) + # # -- Workload replicas (Deployment and StatefulSet only) # replicas: 1 - # # -- Controller revision history limit + # # -- Workload revision history limit # revisionHistoryLimit: 3 # # Strategy - # # -- Controller strategy type + # # -- Workload strategy type # strategy: Recreate - # # -- Controller strategy rolling update + # # -- Workload strategy rolling update # rollingUpdate: - # # -- Controller strategy rolling update max unavailable + # # -- Workload strategy rolling update max unavailable # maxUnavailable: 1 - # # -- Controller strategy rolling update max surge + # # -- Workload strategy rolling update max surge # maxSurge: 1 - # # -- Controller strategy rolling update partition (StatefulSet only) + # # -- Workload strategy rolling update partition (StatefulSet only) # partition: 0 # # -- CronJob @@ -539,7 +539,7 @@ controllers: portal: {} # -- Image Pull Secrets -imagePullSecrets: +imagePullSecret: # -- Image Pull Secret name image-secret-name: # -- Enables the Image Pull Secret @@ -562,8 +562,8 @@ imagePullSecrets: targetSelector: - pod-name -# -- ConfigMaps (docs/configmaps.md) -configmaps: {} +# -- ConfigMaps (docs/configmap.md) +configmap: {} # # -- ConfigMap name # conf-name: # # -- Enables the ConfigMap @@ -575,8 +575,8 @@ configmaps: {} # # -- ConfigMap data # data: {} -# -- Secrets (docs/secrets.md) -secrets: {} +# -- Secrets (docs/secret.md) +secret: {} # # -- Secret name # secret-name: # # -- Enables the secret