4473dc88 by Adam Heath

Start working on a helmfile runner.

1 parent 11c3813d
...@@ -9,8 +9,6 @@ data: ...@@ -9,8 +9,6 @@ data:
9 SSH_CONFIG: | 9 SSH_CONFIG: |
10 StrictHostKeyChecking no 10 StrictHostKeyChecking no
11 LogLevel VERBOSE 11 LogLevel VERBOSE
12
13 #-i /tmp/cluster-ssh/ssh-private-key
14 --- 12 ---
15 apiVersion: v1 13 apiVersion: v1
16 kind: ConfigMap 14 kind: ConfigMap
...@@ -22,11 +20,22 @@ data: ...@@ -22,11 +20,22 @@ data:
22 #!/bin/sh 20 #!/bin/sh
23 set -ex 21 set -ex
24 # FIXME: don't hard-code this. 22 # FIXME: don't hard-code this.
25 ls -alR $HOME
26 ssh -v git@gitlab.brainfood.com exit || true
27 GIT_SSH_COMMAND="ssh -v"
28 export GIT_SSH_COMMAND
29 git clone git@gitlab.brainfood.com:brainfood/k8s-start-of-day.git /tmp/git-storage/k8s-start-of-day 23 git clone git@gitlab.brainfood.com:brainfood/k8s-start-of-day.git /tmp/git-storage/k8s-start-of-day
24 cd /tmp/git-storage/k8s-start-of-day
25 if [ -e helmfile.yaml ]; then
26 echo helmfile > /tmp/git-storage/repo-type
27 elif [ -e kustomization.yaml ]; then
28 echo kustomize > /tmp/git-storage/repo-type
29 else [
30 echo unknown > /tmp/git-storage/repo-type
31 fi
32 check-mode: |
33 #!/bin/sh
34 set -ex
35 if [ $(cat /tmp/git-storage/repo-type) = $1 ]; then
36 shift
37 "$@"
38 fi
30 --- 39 ---
31 apiVersion: batch/v1 40 apiVersion: batch/v1
32 kind: Job 41 kind: Job
...@@ -97,6 +106,16 @@ spec: ...@@ -97,6 +106,16 @@ spec:
97 mountPath: /tmp/git-storage 106 mountPath: /tmp/git-storage
98 command: ["/tmp/k8s-bootstrap-scripts/clone-start-of-day"] 107 command: ["/tmp/k8s-bootstrap-scripts/clone-start-of-day"]
99 108
109 - name: try-helmfile
110 image: quay.io/roboll/helmfile
111 working_dir: /tmp/git-storage/k8s-start-of-day
112 command: ["/tmp/k8s-bootstrap-scripts/check-mode", "helmfile", "/usr/local/bin/helmfile"]
113 volumeMounts:
114 - name: git-storage
115 mountPath: /tmp/git-storage
116 - name: k8s-bootstrap-scripts
117 mountPath: /tmp/k8s-bootstrap-scripts
118
100 containers: 119 containers:
101 - name: show-status 120 - name: show-status
102 image: bash 121 image: bash
......