4473dc88 by Adam Heath

Start working on a helmfile runner.

1 parent 11c3813d
......@@ -9,8 +9,6 @@ data:
SSH_CONFIG: |
StrictHostKeyChecking no
LogLevel VERBOSE
#-i /tmp/cluster-ssh/ssh-private-key
---
apiVersion: v1
kind: ConfigMap
......@@ -22,11 +20,22 @@ data:
#!/bin/sh
set -ex
# FIXME: don't hard-code this.
ls -alR $HOME
ssh -v git@gitlab.brainfood.com exit || true
GIT_SSH_COMMAND="ssh -v"
export GIT_SSH_COMMAND
git clone git@gitlab.brainfood.com:brainfood/k8s-start-of-day.git /tmp/git-storage/k8s-start-of-day
cd /tmp/git-storage/k8s-start-of-day
if [ -e helmfile.yaml ]; then
echo helmfile > /tmp/git-storage/repo-type
elif [ -e kustomization.yaml ]; then
echo kustomize > /tmp/git-storage/repo-type
else [
echo unknown > /tmp/git-storage/repo-type
fi
check-mode: |
#!/bin/sh
set -ex
if [ $(cat /tmp/git-storage/repo-type) = $1 ]; then
shift
"$@"
fi
---
apiVersion: batch/v1
kind: Job
......@@ -97,6 +106,16 @@ spec:
mountPath: /tmp/git-storage
command: ["/tmp/k8s-bootstrap-scripts/clone-start-of-day"]
- name: try-helmfile
image: quay.io/roboll/helmfile
working_dir: /tmp/git-storage/k8s-start-of-day
command: ["/tmp/k8s-bootstrap-scripts/check-mode", "helmfile", "/usr/local/bin/helmfile"]
volumeMounts:
- name: git-storage
mountPath: /tmp/git-storage
- name: k8s-bootstrap-scripts
mountPath: /tmp/k8s-bootstrap-scripts
containers:
- name: show-status
image: bash
......