-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control-service: Cronjob API backwards compatibility (#1580)
Currently there is no backwards compatibility support when a user switches to the V1 Kubernetes Cronjob API (from the currently default V1beta1). This results in situations, where if there are deployed data jobs which use the v1beta1 API, and a switch is made to the V1 API, these jobs are suddenly shown as `NOT DEPLOYED`, and cannot be properly managed. This change adds backwards compatibility support in the Kubernetes Service, to allow for a switch to V1 Cronjob API in clusters, where V1beta1 API cronjobs are deployed. Testing Done: Unit and Integration tests (new and existing). Signed-off-by: Andon Andonov <[email protected]> --------- Signed-off-by: Andon Andonov <[email protected]> Co-authored-by: github-actions <> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
72a6098
commit e538bc7
Showing
5 changed files
with
270 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...rvice/projects/pipelines_control_service/src/main/resources/v1-k8s-data-job-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
annotations: # merged with additional annotations from TPCS | ||
name: cronjob-template-name # overridden by TPCS | ||
spec: | ||
concurrencyPolicy: Forbid | ||
failedJobsHistoryLimit: 2 | ||
schedule: "*/10 * * * *" # overridden by TPCS | ||
startingDeadlineSeconds: 1800 | ||
successfulJobsHistoryLimit: 1 | ||
suspend: false # overridden by TPCS | ||
jobTemplate: | ||
metadata: | ||
annotations: # merged with additional annotations from TPCS | ||
labels: # merged with additional labels from TPCS | ||
spec: | ||
activeDeadlineSeconds: 43200 | ||
backoffLimit: 3 | ||
template: | ||
metadata: | ||
labels: # merged with additional labels from TPCS | ||
spec: | ||
containers: # overridden by TPCS | ||
- command: | ||
- /bin/sh | ||
- -c | ||
- date; echo '************** Cronjob Template ******************' | ||
name: cronjob-template-container-name | ||
image: busybox | ||
imagePullPolicy: IfNotPresent | ||
restartPolicy: OnFailure | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
fsGroup: 1000 | ||
ttlSecondsAfterFinished: 600 |
Oops, something went wrong.