diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0b4c70..29ddc0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - name: Extract chart version id: chart_version run: | - CHART_VERSION=$(cat charts/onechart/Chart.yaml | grep version:) + CHART_VERSION=$(cat charts/onechart/Chart.yaml | grep ^version:) CHART_VERSION=${CHART_VERSION#version: } echo $CHART_VERSION echo ::set-output name=chart_version::$CHART_VERSION diff --git a/Makefile b/Makefile index 0a0b1cf..5c32ed9 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,12 @@ kubeval: find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.18.0 test: + helm dependency update charts/onechart helm unittest charts/onechart + + helm dependency update charts/cron-job helm unittest charts/cron-job + helm unittest charts/namespaces package: @@ -45,8 +49,13 @@ package: helm repo index docs --url https://chart.onechart.dev debug: + helm dependency update charts/onechart helm template charts/onechart/ -f values.yaml --debug +debug-cron-job: + helm dependency update charts/cron-job + helm template charts/cron-job/ -f values-cron-job.yaml --debug + debug-ui: #gimlet chart configure -s charts/onechart/values.schema.json -u charts/onechart/helm-ui.json onechart/onechart /home/laszlo/projects/gimlet-cli/build/gimlet chart configure -s charts/onechart/values.schema.json -u charts/onechart/helm-ui.json onechart/onechart diff --git a/charts/common/.helmignore b/charts/common/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/common/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml new file mode 100644 index 0000000..eb40fb1 --- /dev/null +++ b/charts/common/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: common +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: library + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 diff --git a/charts/common/templates/_configmap.yaml b/charts/common/templates/_configmap.yaml new file mode 100644 index 0000000..babfd71 --- /dev/null +++ b/charts/common/templates/_configmap.yaml @@ -0,0 +1,15 @@ +{{- define "common.configmap.tpl" -}} +{{- if .Values.vars }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "common.robustName" .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "helm-chart.labels" . | nindent 4 }} +data: +{{- range $key, $val := .Values.vars }} + {{ $key }}: {{ $val | quote }} +{{- end }} +{{- end }} +{{- end -}} diff --git a/charts/common/templates/_envFromRef.yaml b/charts/common/templates/_envFromRef.yaml new file mode 100644 index 0000000..a640001 --- /dev/null +++ b/charts/common/templates/_envFromRef.yaml @@ -0,0 +1,21 @@ +{{- define "common.envFromRef.tpl" -}} +{{- if or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName }} +envFrom: &envFrom +{{- if .Values.vars }} + - configMapRef: + name: {{ template "common.robustName" .Release.Name }} +{{- end }} +{{- if .Values.secretEnabled }} + - secretRef: + name: {{ include "common.robustName" $.Release.Name }} +{{- end }} +{{- if .Values.secretName }} + - secretRef: + name: {{ .Values.secretName }} +{{- end }} +{{- if .Values.sealedSecrets }} + - secretRef: + name: {{ template "common.robustName" .Release.Name }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/onechart/templates/file-secret.yaml b/charts/common/templates/_fileSecret.yaml similarity index 84% rename from charts/onechart/templates/file-secret.yaml rename to charts/common/templates/_fileSecret.yaml index 2bbc0e3..b53db34 100644 --- a/charts/onechart/templates/file-secret.yaml +++ b/charts/common/templates/_fileSecret.yaml @@ -1,3 +1,4 @@ +{{- define "common.fileSecret.tpl" -}} {{- range .Values.fileSecrets }} --- kind: Secret @@ -11,3 +12,4 @@ data: {{ $key }}: {{ $val | b64enc }} {{- end }} {{- end }} +{{- end -}} diff --git a/charts/common/templates/_helpers.tpl b/charts/common/templates/_helpers.tpl new file mode 100644 index 0000000..efc1177 --- /dev/null +++ b/charts/common/templates/_helpers.tpl @@ -0,0 +1,10 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* +Create robustName that can be used as Kubernetes resource name, and as subdomain as well +\w – Latin letters, digits, underscore '_' . +\W – all but \w . +*/}} +{{- define "common.robustName" -}} +{{ regexReplaceAll "[^0-9A-Za-z_\\.]+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" | trimPrefix "-" }} +{{- end }} diff --git a/charts/common/templates/_pvc.yaml b/charts/common/templates/_pvc.yaml new file mode 100644 index 0000000..7ccd083 --- /dev/null +++ b/charts/common/templates/_pvc.yaml @@ -0,0 +1,18 @@ +{{- define "common.pvc.tpl" -}} +{{- range .Values.volumes }} +{{- $robustName := include "common.robustName" $.Release.Name }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ printf "%s-%s" $robustName .name }} + namespace: {{ $.Release.Namespace }} +spec: + accessModes: + - {{ .accessMode | default "ReadWriteOnce" }} + storageClassName: {{ .storageClass | default "local-path" }} + resources: + requests: + storage: {{ .size | default "1Gi" }} +{{- end }} +{{- end -}} diff --git a/charts/onechart/templates/sealed-file-secret.yaml b/charts/common/templates/_sealedFileSecret.yaml similarity index 91% rename from charts/onechart/templates/sealed-file-secret.yaml rename to charts/common/templates/_sealedFileSecret.yaml index 539d304..7a3a356 100644 --- a/charts/onechart/templates/sealed-file-secret.yaml +++ b/charts/common/templates/_sealedFileSecret.yaml @@ -1,3 +1,4 @@ +{{- define "common.sealedFileSecret.tpl" -}} {{- range .Values.sealedFileSecrets }} {{- $robustName := include "robustName" $.Release.Name }} --- @@ -22,3 +23,4 @@ spec: name: {{ printf "%s-%s" $.Release.Name .name }} namespace: {{ $.Release.Namespace }} {{- end }} +{{- end -}} diff --git a/charts/onechart/templates/sealed-secret.yaml b/charts/common/templates/_sealedSecret.yaml similarity index 84% rename from charts/onechart/templates/sealed-secret.yaml rename to charts/common/templates/_sealedSecret.yaml index c731f46..cea7611 100644 --- a/charts/onechart/templates/sealed-secret.yaml +++ b/charts/common/templates/_sealedSecret.yaml @@ -1,4 +1,5 @@ -{{- if .Values.sealedSecrets }} +{{- define "common.sealedSecret.tpl" -}} + {{- if .Values.sealedSecrets }} apiVersion: bitnami.com/v1alpha1 kind: SealedSecret metadata: @@ -17,4 +18,5 @@ spec: metadata: name: {{ template "robustName" .Release.Name }} namespace: {{ .Release.Namespace }} -{{- end }} \ No newline at end of file +{{- end }} +{{- end -}} diff --git a/charts/common/templates/_volumeMountsRef.yaml b/charts/common/templates/_volumeMountsRef.yaml new file mode 100644 index 0000000..5081d33 --- /dev/null +++ b/charts/common/templates/_volumeMountsRef.yaml @@ -0,0 +1,19 @@ +{{- define "common.volumeMountsRef.tpl" -}} +{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} +volumeMounts: &volumeMounts +{{- range .Values.volumes }} + - name: {{ .name }} + mountPath: {{ .path }} +{{- end }} +{{- range .Values.sealedFileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + readOnly: true +{{- end }} +{{- range .Values.fileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + readOnly: true +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/common/templates/_volumesRef.yaml b/charts/common/templates/_volumesRef.yaml new file mode 100644 index 0000000..cd027b4 --- /dev/null +++ b/charts/common/templates/_volumesRef.yaml @@ -0,0 +1,20 @@ +{{- define "common.volumesRef.tpl" -}} +{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} +volumes: + {{- range .Values.volumes }} + - name: {{ .name }} + persistentVolumeClaim: + claimName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- range .Values.sealedFileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- range .Values.fileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} +{{- end }} +{{- end -}} diff --git a/charts/cron-job/Chart.lock b/charts/cron-job/Chart.lock new file mode 100644 index 0000000..7ebac7e --- /dev/null +++ b/charts/cron-job/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../common + version: 0.1.0 +digest: sha256:636a65e9846bdff17cc4e65b0849061f783759a37aa51fb85ff6fd8ba5e68467 +generated: "2021-08-05T10:18:17.533366128+02:00" diff --git a/charts/cron-job/Chart.yaml b/charts/cron-job/Chart.yaml index ea92f9c..8191f7a 100644 --- a/charts/cron-job/Chart.yaml +++ b/charts/cron-job/Chart.yaml @@ -15,4 +15,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.2 +version: 0.2.0 + +dependencies: + - name: common + version: 0.1.0 + repository: file://../common diff --git a/charts/cron-job/charts/common-0.1.0.tgz b/charts/cron-job/charts/common-0.1.0.tgz new file mode 100644 index 0000000..7a1aa03 Binary files /dev/null and b/charts/cron-job/charts/common-0.1.0.tgz differ diff --git a/charts/cron-job/templates/configmap.yaml b/charts/cron-job/templates/configmap.yaml index 9c90051..3057866 100644 --- a/charts/cron-job/templates/configmap.yaml +++ b/charts/cron-job/templates/configmap.yaml @@ -1,13 +1 @@ -{{- if .Values.vars }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "helm-chart.labels" . | nindent 4 }} -data: -{{- range $key, $val := .Values.vars }} - {{ $key }}: {{ $val | quote }} -{{- end }} -{{- end }} +{{- include "common.configmap.tpl" . -}} diff --git a/charts/cron-job/templates/cronJob.yaml b/charts/cron-job/templates/cronJob.yaml index ddf5db3..19174b6 100644 --- a/charts/cron-job/templates/cronJob.yaml +++ b/charts/cron-job/templates/cronJob.yaml @@ -7,10 +7,9 @@ metadata: {{- include "helm-chart.labels" . | nindent 4 }} spec: schedule: {{ .Values.schedule | quote }} - successfulJobsHistoryLimit: 1 - failedJobsHistoryLimit: 1 - concurrencyPolicy: Forbid - startingDeadlineSeconds: 120 + {{- with .Values.constraints }} + {{- toYaml . | nindent 2 }} + {{- end }} jobTemplate: spec: template: @@ -30,29 +29,12 @@ spec: - {{ .Values.shell }} - -c - {{ .Values.command | quote }} - envFrom: - {{- if .Values.vars }} - - configMapRef: - name: {{ .Release.Name }} - {{- end }} - {{- if .Values.secret.enabled }} - - secretRef: - name: {{ .Release.Name }} - {{- end }} - volumeMounts: - {{- range .Values.volumes }} - - name: {{ .name }} - mountPath: {{ .path }} - {{- end }} + {{- include "common.envFromRef.tpl" . | nindent 14 }} + {{- include "common.volumeMountsRef.tpl" . | nindent 14 }} resources: {{- toYaml .Values.resources | nindent 16 }} - volumes: - {{- range .Values.volumes }} - - name: {{ .name }} - persistentVolumeClaim: - claimName: {{ printf "%s-%s" $.Release.Name .name }} - {{- end }} - {{ with .Values.nodeSelector }} + {{- include "common.volumesRef.tpl" . | nindent 10 }} + {{ with .Values.nodeSelector }} nodeSelector: {{ toYaml . | nindent 8 }} {{- end }} diff --git a/charts/cron-job/templates/fileSecret.yaml b/charts/cron-job/templates/fileSecret.yaml new file mode 100644 index 0000000..1d061dc --- /dev/null +++ b/charts/cron-job/templates/fileSecret.yaml @@ -0,0 +1 @@ +{{- include "common.fileSecret.tpl" . -}} diff --git a/charts/cron-job/templates/pvc.yaml b/charts/cron-job/templates/pvc.yaml index 50a9e4b..b462fad 100644 --- a/charts/cron-job/templates/pvc.yaml +++ b/charts/cron-job/templates/pvc.yaml @@ -1,15 +1 @@ -{{- range .Values.volumes }} ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ printf "%s-%s" $.Release.Name .name }} - namespace: {{ $.Release.Namespace }} -spec: - accessModes: - - {{ .accessMode | default "ReadWriteOnce" }} - storageClassName: {{ .storageClass | default "local-path" }} - resources: - requests: - storage: {{ .size | default "1Gi" }} -{{- end }} +{{- include "common.pvc.tpl" . -}} diff --git a/charts/cron-job/templates/sealedFileSecret.yaml b/charts/cron-job/templates/sealedFileSecret.yaml new file mode 100644 index 0000000..2e85b27 --- /dev/null +++ b/charts/cron-job/templates/sealedFileSecret.yaml @@ -0,0 +1 @@ +{{- include "common.sealedFileSecret.tpl" . -}} diff --git a/charts/cron-job/templates/sealedSecret.yaml b/charts/cron-job/templates/sealedSecret.yaml new file mode 100644 index 0000000..469a4c7 --- /dev/null +++ b/charts/cron-job/templates/sealedSecret.yaml @@ -0,0 +1 @@ +{{- include "common.sealedSecret.tpl" . -}} diff --git a/charts/cron-job/tests/cronjob_configmap_test.yaml b/charts/cron-job/tests/cronjob_configmap_test.yaml index 6a23403..7f41b51 100644 --- a/charts/cron-job/tests/cronjob_configmap_test.yaml +++ b/charts/cron-job/tests/cronjob_configmap_test.yaml @@ -13,7 +13,7 @@ tests: path: spec.jobTemplate.spec.template.spec.containers[0].envFrom content: configMapRef: - name: RELEASE-NAME + name: release-name - it: Should not reference configmap if vars are not set asserts: - isNull: diff --git a/charts/cron-job/tests/cronjob_costraints_test.yaml b/charts/cron-job/tests/cronjob_costraints_test.yaml new file mode 100644 index 0000000..f430172 --- /dev/null +++ b/charts/cron-job/tests/cronjob_costraints_test.yaml @@ -0,0 +1,17 @@ +suite: test cron job +templates: + - cronJob.yaml +tests: + - it: Should have default constraints + asserts: + - equal: + path: spec.successfulJobsHistoryLimit + value: 1 + - it: Should constraints be configurable + set: + constraints: + successfulJobsHistoryLimit: 2 + asserts: + - equal: + path: spec.successfulJobsHistoryLimit + value: 2 diff --git a/charts/cron-job/tests/cronjob_secret_test.yaml b/charts/cron-job/tests/cronjob_secret_test.yaml index 4ce2f30..7727fe6 100644 --- a/charts/cron-job/tests/cronjob_secret_test.yaml +++ b/charts/cron-job/tests/cronjob_secret_test.yaml @@ -5,16 +5,16 @@ templates: tests: - it: Should reference secret if secret is enabled set: - secret.enabled: true + secretEnabled: true asserts: - contains: path: spec.jobTemplate.spec.template.spec.containers[0].envFrom content: secretRef: - name: RELEASE-NAME + name: release-name - it: Should not reference secret if secret is disabled set: - secret.enabled: false + secretEnabled: false asserts: - isNull: path: spec.jobTemplate.spec.template.spec.containers[0].envFrom diff --git a/charts/cron-job/values.yaml b/charts/cron-job/values.yaml index 462dcc5..f0bca92 100644 --- a/charts/cron-job/values.yaml +++ b/charts/cron-job/values.yaml @@ -27,3 +27,9 @@ affinity: {} secret: enabled: false + +constraints: + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 + concurrencyPolicy: Forbid + startingDeadlineSeconds: 120 diff --git a/charts/onechart/Chart.lock b/charts/onechart/Chart.lock new file mode 100644 index 0000000..d05dc4b --- /dev/null +++ b/charts/onechart/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../common + version: 0.1.0 +digest: sha256:636a65e9846bdff17cc4e65b0849061f783759a37aa51fb85ff6fd8ba5e68467 +generated: "2021-08-05T10:39:10.053810673+02:00" diff --git a/charts/onechart/Chart.yaml b/charts/onechart/Chart.yaml index 1d07233..f45feec 100644 --- a/charts/onechart/Chart.yaml +++ b/charts/onechart/Chart.yaml @@ -15,4 +15,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.27.0 +version: 0.27.0-rc1 + +dependencies: + - name: common + version: 0.1.0 + repository: file://../common diff --git a/charts/onechart/charts/common-0.1.0.tgz b/charts/onechart/charts/common-0.1.0.tgz new file mode 100644 index 0000000..0e239d5 Binary files /dev/null and b/charts/onechart/charts/common-0.1.0.tgz differ diff --git a/charts/onechart/templates/configmap.yaml b/charts/onechart/templates/configmap.yaml index 0e4f554..3057866 100644 --- a/charts/onechart/templates/configmap.yaml +++ b/charts/onechart/templates/configmap.yaml @@ -1,13 +1 @@ -{{- if .Values.vars }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "robustName" .Release.Name }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "helm-chart.labels" . | nindent 4 }} -data: -{{- range $key, $val := .Values.vars }} - {{ $key }}: {{ $val | quote }} -{{- end }} -{{- end }} +{{- include "common.configmap.tpl" . -}} diff --git a/charts/onechart/templates/deployment.yaml b/charts/onechart/templates/deployment.yaml index 6ca51e3..b12912b 100644 --- a/charts/onechart/templates/deployment.yaml +++ b/charts/onechart/templates/deployment.yaml @@ -61,25 +61,7 @@ spec: - -c - {{ .Values.command | quote }} {{- end }} - {{- if or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName }} - envFrom: &envFrom - {{- if .Values.vars }} - - configMapRef: - name: {{ template "robustName" .Release.Name }} - {{- end }} - {{- if .Values.secretEnabled }} - - secretRef: - name: {{ include "robustName" $.Release.Name }} - {{- end }} - {{- if .Values.secretName }} - - secretRef: - name: {{ .Values.secretName }} - {{- end }} - {{- if .Values.sealedSecrets }} - - secretRef: - name: {{ template "robustName" .Release.Name }} - {{- end }} - {{- end }} + {{- include "common.envFromRef.tpl" . | nindent 10 }} ports: {{- if not .Values.ports }} - name: http @@ -102,23 +84,7 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} {{- end }} - {{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} - volumeMounts: &volumeMounts - {{- range .Values.volumes }} - - name: {{ .name }} - mountPath: {{ .path }} - {{- end }} - {{- range .Values.sealedFileSecrets }} - - name: {{ .name }} - mountPath: {{ .path }} - readOnly: true - {{- end }} - {{- range .Values.fileSecrets }} - - name: {{ .name }} - mountPath: {{ .path }} - readOnly: true - {{- end }} - {{- end }} + {{- include "common.volumeMountsRef.tpl" . | nindent 10 }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- if .Values.sidecar }} @@ -138,24 +104,7 @@ spec: volumeMounts: *volumeMounts {{- end }} {{- end }} - {{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} - volumes: - {{- range .Values.volumes }} - - name: {{ .name }} - persistentVolumeClaim: - claimName: {{ printf "%s-%s" $.Release.Name .name }} - {{- end }} - {{- range .Values.sealedFileSecrets }} - - name: {{ .name }} - secret: - secretName: {{ printf "%s-%s" $.Release.Name .name }} - {{- end }} - {{- range .Values.fileSecrets }} - - name: {{ .name }} - secret: - secretName: {{ printf "%s-%s" $.Release.Name .name }} - {{- end }} - {{- end }} + {{- include "common.volumesRef.tpl" . | nindent 6 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/onechart/templates/fileSecret.yaml b/charts/onechart/templates/fileSecret.yaml new file mode 100644 index 0000000..1d061dc --- /dev/null +++ b/charts/onechart/templates/fileSecret.yaml @@ -0,0 +1 @@ +{{- include "common.fileSecret.tpl" . -}} diff --git a/charts/onechart/templates/pvc.yaml b/charts/onechart/templates/pvc.yaml index 38758f7..b462fad 100644 --- a/charts/onechart/templates/pvc.yaml +++ b/charts/onechart/templates/pvc.yaml @@ -1,16 +1 @@ -{{- range .Values.volumes }} -{{- $robustName := include "robustName" $.Release.Name }} ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ printf "%s-%s" $robustName .name }} - namespace: {{ $.Release.Namespace }} -spec: - accessModes: - - {{ .accessMode | default "ReadWriteOnce" }} - storageClassName: {{ .storageClass | default "local-path" }} - resources: - requests: - storage: {{ .size | default "1Gi" }} -{{- end }} +{{- include "common.pvc.tpl" . -}} diff --git a/charts/onechart/templates/sealedFileSecret.yaml b/charts/onechart/templates/sealedFileSecret.yaml new file mode 100644 index 0000000..2e85b27 --- /dev/null +++ b/charts/onechart/templates/sealedFileSecret.yaml @@ -0,0 +1 @@ +{{- include "common.sealedFileSecret.tpl" . -}} diff --git a/charts/onechart/templates/sealedSecret.yaml b/charts/onechart/templates/sealedSecret.yaml new file mode 100644 index 0000000..469a4c7 --- /dev/null +++ b/charts/onechart/templates/sealedSecret.yaml @@ -0,0 +1 @@ +{{- include "common.sealedSecret.tpl" . -}} diff --git a/charts/onechart/tests/deployment_sealed_file_secrets2_test.yaml b/charts/onechart/tests/deployment_sealed_file_secrets2_test.yaml index 4382b8e..2a7c90f 100644 --- a/charts/onechart/tests/deployment_sealed_file_secrets2_test.yaml +++ b/charts/onechart/tests/deployment_sealed_file_secrets2_test.yaml @@ -1,6 +1,6 @@ suite: test deployment templates: - - sealed-file-secret.yaml + - sealedFileSecret.yaml tests: - it: Should generate a sealed secret with the file set: &values diff --git a/charts/onechart/tests/sealed_secret_test.yaml b/charts/onechart/tests/sealed_secret_test.yaml index fdc5429..35bf9e2 100644 --- a/charts/onechart/tests/sealed_secret_test.yaml +++ b/charts/onechart/tests/sealed_secret_test.yaml @@ -1,6 +1,6 @@ suite: test deployment templates: - - sealed-secret.yaml + - sealedSecret.yaml tests: - it: Should put sealed secrets in SealedSecret set: diff --git a/values-cron-job.yaml b/values-cron-job.yaml new file mode 100644 index 0000000..faf33bb --- /dev/null +++ b/values-cron-job.yaml @@ -0,0 +1,17 @@ +image: + repository: debian + tag: stable-slim + +schedule: "*/1 * * * *" +command: | + echo "I'm alive" +shell: "/bin/sh" + +vars: + MY_VAR: "value" + +volumes: + - name: data + path: /data + size: 10Gi + storageClass: default diff --git a/values.yaml b/values.yaml index b59c72f..6240a18 100644 --- a/values.yaml +++ b/values.yaml @@ -12,3 +12,12 @@ ingresses: gitRepository: github.com/laszlocph/demo-app gitSha: xyz + +vars: + MY_VAR: "value" + +volumes: + - name: data + path: /data + size: 10Gi + storageClass: default