Fix syntax errors, move clone script to a config map.
Showing
1 changed file
with
22 additions
and
12 deletions
1 | --- | ||
2 | apiVersion: v1 | ||
3 | kind: ConfigMap | ||
4 | metadata: | ||
5 | name: k8s-bootstrap | ||
6 | namespace: kube-system | ||
7 | data: | ||
8 | clone-start-of-day: | | ||
9 | #!/bin/sh | ||
10 | set -ex | ||
11 | GIT_SSH_COMMAND="ssh -i /tmp/cluster-ssh-key/ssh-private-key" | ||
12 | --- | ||
1 | apiVersion: batch/v1 | 13 | apiVersion: batch/v1 |
2 | kind: Job | 14 | kind: Job |
3 | metadata: | 15 | metadata: |
... | @@ -17,36 +29,34 @@ spec: | ... | @@ -17,36 +29,34 @@ spec: |
17 | key: node-role.kubernetes.io/master | 29 | key: node-role.kubernetes.io/master |
18 | 30 | ||
19 | volumes: | 31 | volumes: |
32 | - name: k8s-bootstrap | ||
33 | configMap: | ||
34 | name: k8s-bootstrap | ||
35 | defaultMode: 755 | ||
20 | - name: git-storage | 36 | - name: git-storage |
21 | emptyDir: {} | 37 | emptyDir: {} |
22 | - name: cluster-ssh-key | 38 | - name: cluster-ssh-key |
23 | secret: | 39 | secret: |
24 | name: cluster-ssh-key | 40 | secretName: cluster-ssh-key |
25 | defaultMode: 0600 | 41 | defaultMode: 0600 |
26 | 42 | ||
27 | initContainers: | 43 | initContainers: |
28 | - name: clone-k8s-start-of-day | 44 | - name: clone-k8s-start-of-day |
29 | image: bitnami/git | 45 | image: bitnami/git |
30 | volumeMounts: | 46 | volumeMounts: |
47 | - name: k8s-bootstrap | ||
48 | mountPath: /tmp/k8s-bootstrap | ||
31 | - name: cluster-ssh-key | 49 | - name: cluster-ssh-key |
32 | mountPath: /tmp/cluster-ssh-key | 50 | mountPath: /tmp/cluster-ssh-key |
33 | - name: git-storage | 51 | - name: git-storage |
34 | mountPath: /tmp/git-storage | 52 | mountPath: /tmp/git-storage |
35 | command: | | 53 | command: ["/tmp/k8s-bootstrap/clone-start-of-day"] |
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 | 54 | ||
42 | containers: | 55 | containers: |
43 | - name: show-status | 56 | - name: show-status |
44 | image: bash | 57 | image: bash |
45 | command: | | 58 | command: ["bash", "-ex", "ls -l /tmp/git-storage"] |
46 | #!/bin/sh | ||
47 | set -ex | ||
48 | ls -al /tmp/git-storage | ||
49 | volumeMounts: | 59 | volumeMounts: |
50 | - name: git-storage | 60 | - name: git-storage |
51 | mountPath: /tmp/git-storage | 61 | mountPath: /tmp/git-storage |
52 | 62 | --- | ... | ... |
-
Please register or sign in to post a comment