Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

CronJob API version update to batch/v1 #129

Closed
britslampe opened this issue Oct 18, 2022 · 3 comments · Fixed by #164
Closed

CronJob API version update to batch/v1 #129

britslampe opened this issue Oct 18, 2022 · 3 comments · Fixed by #164

Comments

@britslampe
Copy link

The apiVersion for CronJobs in legacy/helmcharts/cli/templates/cronjob.yaml references the depreciated batch/v1beta1 version, which is no longer supported in v1.22+. Requesting an update to switch to using batch/v1 that is supported in active and maintained Kubernetes versions.

@britslampe
Copy link
Author

Adding reference to the cronjob.yaml in basic/templates/cronjob.yaml in https://github.com/uselagoon/build-deploy-tool/blob/main/legacy/helmcharts/basic/templates/cronjob.yaml

@shreddedbacon
Copy link
Member

shreddedbacon commented Oct 21, 2022

Will discuss with the team, but v1beta1 is available until kubernetes 1.25 https://kubernetes.io/docs/reference/using-api/deprecation-guide/#cronjob-v125

Since v1 was introduced in kubernetes 1.21, we need to do some changes and make sure people are running 1.21+ before we can change this.

@tobybellwood
Copy link
Member

Lagoon v2.12.x (released in Jan 2023) will support a minimum Kubernetes version of 1.21, so this change will be introduced then. For anyone needing backwards compatibility after that point 😱, they can always fork and add a semver comparison in there

{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: batch/v1
{{- else -}}
apiVersion: batch/v1beta1
{{- end }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants