12769c25 by Adam Heath

Initial attempt at k8s-bootstrap.

1 parent c7947e09
1 apiVersion: batch/v1
2 kind: Job
3 metadata:
4 name: k8s-bootstrap
5 namespace: kube-system
6 spec:
7 template:
8 spec:
9 restartPolicy: OnFailure
10 securityContext:
11 runAsUser: 1234
12 runAsGroup: 1234
13 fsGroup: 1234
14
15 tolerations:
16 - effect: NoSchedule
17 key: node-role.kubernetes.io/master
18
19 volumes:
20 - name: git-storage
21 emptyDir: {}
22 - name: cluster-ssh-key
23 secret:
24 name: cluster-ssh-key
25 defaultMode: 0600
26
27 initContainers:
28 - name: clone-k8s-start-of-day
29 image: bitnami/git
30 volumeMounts:
31 - name: cluster-ssh-key
32 mountPath: /tmp/cluster-ssh-key
33 - name: git-storage
34 mountPath: /tmp/git-storage
35 command: |
36 #!/bin/sh
37 set -ex
38 GIT_SSH_COMMAND="ssh -i /tmp/cluster-ssh-key/ssh-private-key"
39 git clone git@gitlab.brainfood.com:brainfood/k8s-start-of-day.git /tmp/git-storage/k8s-start-of-day
40
41
42 containers:
43 - name: show-status
44 image: bash
45 command: |
46 #!/bin/sh
47 set -ex
48 ls -al /tmp/git-storage
49 volumeMounts:
50 - name: git-storage
51 mountPath: /tmp/git-storage
52