Adding redeploy for corona-api

This commit is contained in:
Moritz Graf 2020-04-09 22:53:18 +02:00
parent 23421ef617
commit b0576b227b
2 changed files with 66 additions and 0 deletions

View File

@ -6,6 +6,16 @@ This folder holds all the services required for my private infrastructure. Follo
* Every namespace has a subfolder within this subdirectory.
* helm3
# Operations
Cleanup `Error` pods.
```sh
kubectl get pods | grep Error | cut -d' ' -f 1 | xargs kubectl delete pod
```
# Deployment
## namespaces
```sh

View File

@ -0,0 +1,56 @@
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: "hub-moritzgraf-de"
containers:
- name: redeploy-corona-api
image: hub.moritzgraf.de:5000/redeploy:latest
env:
- name: DEPLOYMENT
value: "corona-api"
restartPolicy: Never