From b9aaad362188de918d95fcf32711771631ba1a2e Mon Sep 17 00:00:00 2001 From: Morre Date: Sat, 19 Feb 2022 20:47:15 +0100 Subject: [PATCH] chore(generic)!: drop support for CronJob --- charts/generic/Chart.yaml | 2 +- charts/generic/README.md | 14 ++- charts/generic/README.md.gotmpl | 10 +++ charts/generic/templates/cronjob.yaml | 110 ----------------------- charts/generic/templates/deployment.yaml | 2 - charts/generic/templates/service.yaml | 2 - charts/generic/values.yaml | 6 -- 7 files changed, 22 insertions(+), 124 deletions(-) delete mode 100644 charts/generic/templates/cronjob.yaml diff --git a/charts/generic/Chart.yaml b/charts/generic/Chart.yaml index 810645b3..7740907d 100644 --- a/charts/generic/Chart.yaml +++ b/charts/generic/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: generic description: A chart for generic applications. Use this if you need to deploy something without wanting to build a fully fledged new helm chart. type: application -version: 2.4.4 +version: 3.0.0 maintainers: - name: morre email: charts@mor.re diff --git a/charts/generic/README.md b/charts/generic/README.md index 07aafa4c..8afed335 100644 --- a/charts/generic/README.md +++ b/charts/generic/README.md @@ -1,6 +1,6 @@ # generic -![Version: 2.4.4](https://img.shields.io/badge/Version-2.4.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 3.0.0](https://img.shields.io/badge/Version-3.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A chart for generic applications. Use this if you need to deploy something without wanting to build a fully fledged new helm chart. @@ -12,6 +12,16 @@ A chart for generic applications. Use this if you need to deploy something witho ## Upgrading +### To 3.0.0 + +Support for CronJobs has been removed. If you used the `isCronjob: true` flag, please migrate to `morremeyer/cronjob` in version `2.0.0 <= x < 3.0.0`. + +:warning: If you need open ports on your CronJob pod, this is not supported in the cronjob chart. This is a design decision as CronJobs should not have any incoming traffic. + +The cronjob chart is almost fully compatible with all existing configuration you have (except for `ports`), you just have to do one migration step: + +1. Remove the `isCronjob: true` value + ### To 2.0.0 The format for configuration environment variables has changed and is now less verbose. @@ -64,7 +74,6 @@ If you have environment variables set from ConfigMaps or Secrets, check out `env | ingress.hosts[0].paths[0].path | string | `"/"` | | | ingress.tls | list | `[]` | | | initContainers | list | `[]` | | -| isCronjob | bool | `false` | Set to true to create a CronJob instead of a Deployment | | labels | object | `{}` | | | livenessProbe.httpGet.path | string | `"/"` | | | livenessProbe.httpGet.port | string | `"http"` | | @@ -84,7 +93,6 @@ If you have environment variables set from ConfigMaps or Secrets, check out `env | replicaCount | int | `1` | number of replicas | | resources | object | `{}` | | | restartPolicy | string | `"Always"` | | -| schedule | string | `"17 3 * * *"` | schedule for the cronjob. Only used if `isCronjob` is `true`. | | securityContext | object | `{}` | | | service.ip | string | `nil` | | | service.name | string | `"http"` | | diff --git a/charts/generic/README.md.gotmpl b/charts/generic/README.md.gotmpl index cc75f285..d21efdbe 100644 --- a/charts/generic/README.md.gotmpl +++ b/charts/generic/README.md.gotmpl @@ -10,6 +10,16 @@ ## Upgrading +### To 3.0.0 + +Support for CronJobs has been removed. If you used the `isCronjob: true` flag, please migrate to `morremeyer/cronjob` in version `2.0.0 <= x < 3.0.0`. + +:warning: If you need open ports on your CronJob pod, this is not supported in the cronjob chart. This is a design decision as CronJobs should not have any incoming traffic. + +The cronjob chart is almost fully compatible with all existing configuration you have (except for `ports`), you just have to do one migration step: + +1. Remove the `isCronjob: true` value + ### To 2.0.0 The format for configuration environment variables has changed and is now less verbose. diff --git a/charts/generic/templates/cronjob.yaml b/charts/generic/templates/cronjob.yaml deleted file mode 100644 index 8a0db0de..00000000 --- a/charts/generic/templates/cronjob.yaml +++ /dev/null @@ -1,110 +0,0 @@ -{{- if .Values.isCronjob -}} -apiVersion: batch/v1 -kind: CronJob -metadata: - name: {{ include "generic.fullname" . }} - labels: - {{- include "generic.labels" . | nindent 4 }} - {{- with .Values.labels }} - {{- toYaml . | nindent 4 }} - {{- end }} - annotations: - {{- with .Values.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- with .Values.successfulJobsHistoryLimit }} - successfulJobsHistoryLimit: {{ . }} - {{- end }} - {{- with .Values.failedJobsHistoryLimit }} - failedJobsHistoryLimit: {{ . }} - {{- end }} - schedule: "{{ .Values.schedule }}" - jobTemplate: - spec: - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: {{- toYaml . | nindent 12 }} - {{- end }} - labels: {{- include "generic.selectorLabels" . | nindent 12 }} - spec: - restartPolicy: {{ .Values.restartPolicy }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: {{- toYaml . | nindent 12 }} - {{- end }} - serviceAccountName: {{ include "generic.serviceAccountName" . }} - {{- with .Values.podSecurityContext }} - securityContext: {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.initContainers }} - initContainers: {{ toYaml . | nindent 12 }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - {{- with .Values.securityContext }} - securityContext: {{- toYaml . | nindent 16 }} - {{- end }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.command }} - command: {{ toYaml . | nindent 16 }} - {{- end }} - {{- with .Values.args }} - args: {{ toYaml . | nindent 16 }} - {{- end }} - {{- if or .Values.env .Values.envValueFrom }} - env: - {{- range $key, $value := .Values.env }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - {{- range $key, $value := .Values.envValueFrom }} - - name: {{ $key }} - valueFrom: {{- $value | toYaml | nindent 20 }} - {{- end }} - {{- end }} - {{- if or .Values.persistence.enabled .Values.additionalVolumeMounts }} - volumeMounts: - {{- if .Values.persistence.enabled }} - - name: data - mountPath: {{ .Values.persistence.mountPath }} - {{- end }} - {{- with .Values.additionalVolumeMounts }} - {{- toYaml . | nindent 16 }} - {{- end }} - {{- end }} - {{- with .Values.ports }} - ports: - {{- toYaml . | nindent 16 }} - {{- end }} - {{- with .Values.livenessProbe }} - livenessProbe: {{- toYaml . | nindent 16 }} - {{- end }} - {{- with .Values.readinessProbe }} - readinessProbe: {{- toYaml . | nindent 16 }} - {{- end }} - {{- with .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 16 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.affinity }} - affinity: {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: {{- toYaml . | nindent 12 }} - {{- end }} - {{- if or .Values.persistence.enabled .Values.additionalVolumes }} - volumes: - {{- if .Values.persistence.enabled }} - - name: data - persistentVolumeClaim: - claimName: {{ include "generic.fullname" . }} - {{- end }} - {{- with .Values.additionalVolumes }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- end }} -{{- end -}} diff --git a/charts/generic/templates/deployment.yaml b/charts/generic/templates/deployment.yaml index f01cce5c..d9dff418 100644 --- a/charts/generic/templates/deployment.yaml +++ b/charts/generic/templates/deployment.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.isCronjob -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -102,4 +101,3 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- end }} -{{- end -}} diff --git a/charts/generic/templates/service.yaml b/charts/generic/templates/service.yaml index 2d14bff5..c2670b90 100644 --- a/charts/generic/templates/service.yaml +++ b/charts/generic/templates/service.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.isCronjob -}} apiVersion: v1 kind: Service metadata: @@ -17,4 +16,3 @@ spec: {{- if and (eq .Values.service.type "ClusterIP") (.Values.service.ip) }} clusterIP: {{ .Values.service.ip }} {{- end }} -{{- end -}} diff --git a/charts/generic/values.yaml b/charts/generic/values.yaml index 89fabb3d..f10e34ba 100644 --- a/charts/generic/values.yaml +++ b/charts/generic/values.yaml @@ -1,15 +1,9 @@ -# -- Set to true to create a CronJob instead of a Deployment -isCronjob: false - # -- The number of successful finished jobs to retain. successfulJobsHistoryLimit: ~ # -- The number of failed finished jobs to retain. failedJobsHistoryLimit: ~ -# -- schedule for the cronjob. Only used if `isCronjob` is `true`. -schedule: "17 3 * * *" - # -- number of replicas replicaCount: 1