-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cronjob to restart deployment in paddock
Signed-off-by: Marcel Hild <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
manifests/base/paddock/cronjobs/cronjob_restart_deployment.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,53 @@ | ||
kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
name: restart-deployment | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: restart-deployment | ||
rules: | ||
- apiGroups: ["apps", "extensions"] | ||
resources: ["deployments"] | ||
resourceNames: ["paddock"] | ||
verbs: ["get", "patch", "list", "watch"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: restart-deployment | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: restart-deployment | ||
subjects: | ||
- kind: ServiceAccount | ||
name: restart-deployment | ||
namespace: b4mad-racing | ||
--- | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: restart-paddock-deployment | ||
spec: | ||
successfulJobsHistoryLimit: 1 | ||
failedJobsHistoryLimit: 2 | ||
concurrencyPolicy: Forbid | ||
schedule: '0 2 * * *' | ||
jobTemplate: | ||
spec: | ||
backoffLimit: 2 | ||
activeDeadlineSeconds: 600 | ||
template: | ||
spec: | ||
serviceAccountName: restart-deployment | ||
restartPolicy: Never | ||
containers: | ||
- name: kubectl | ||
image: bitnami/kubectl | ||
command: | ||
- 'kubectl' | ||
- 'rollout' | ||
- 'restart' | ||
- 'deployment/paddock' |
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