79 lines
1.8 KiB
YAML
79 lines
1.8 KiB
YAML
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
creationTimestamp: null
|
|
name: redeploy
|
|
namespace: datalab
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
namespace: datalab
|
|
name: redeploy
|
|
rules:
|
|
- apiGroups: ["apps"]
|
|
resources: ["deployments"]
|
|
verbs: ["get",list","patch"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
# This role binding allows "jane" to read pods in the "default" namespace.
|
|
# You need to already have a Role named "pod-reader" in that namespace.
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: redeploy-pods
|
|
namespace: datalab
|
|
subjects:
|
|
# You can specify more than one "subject"
|
|
- kind: ServiceAccount
|
|
name: redeploy
|
|
roleRef:
|
|
# "roleRef" specifies the binding to a Role / ClusterRole
|
|
kind: Role #this must be Role or ClusterRole
|
|
name: redeploy
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
---
|
|
apiVersion: batch/v1beta1
|
|
kind: CronJob
|
|
metadata:
|
|
name: redeploy-corona-api
|
|
namespace: datalab
|
|
spec:
|
|
schedule: "0 1 * * *"
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
serviceAccountName: redeploy
|
|
imagePullSecrets:
|
|
- name: "registry-haumdaucher-de"
|
|
containers:
|
|
- name: redeploy-corona-api
|
|
image: registry.haumdaucher.de/redeploy:latest
|
|
env:
|
|
- name: DEPLOYMENT
|
|
value: "corona-api"
|
|
restartPolicy: Never
|
|
|
|
---
|
|
apiVersion: batch/v1beta1
|
|
kind: CronJob
|
|
metadata:
|
|
name: redeploy-corona
|
|
namespace: datalab
|
|
spec:
|
|
schedule: "15 1 * * *"
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
serviceAccountName: redeploy
|
|
imagePullSecrets:
|
|
- name: "hub-moritzgraf-de"
|
|
containers:
|
|
- name: redeploy-corona
|
|
image: hub.moritzgraf.de:5000/redeploy:latest
|
|
env:
|
|
- name: DEPLOYMENT
|
|
value: "corona"
|
|
restartPolicy: Never |