112 lines
3.0 KiB
YAML
112 lines
3.0 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: armada-loader
|
|
namespace: kube-system
|
|
labels:
|
|
app: promenade
|
|
component: armada-loader
|
|
spec:
|
|
hostNetwork: true
|
|
containers:
|
|
- name: loader
|
|
image: {{ config['Versions']['images']['armada'] }}
|
|
imagePullPolicy: IfNotPresent
|
|
{%- if config['Network']['http_proxy'] is defined
|
|
or config['Network']['https_proxy'] is defined
|
|
or config['Network']['no_proxy'] is defined %}
|
|
env:
|
|
{%- endif %}
|
|
{%- if config['Network']['http_proxy'] is defined %}
|
|
- name: HTTP_PROXY
|
|
value: {{ config['Network']['http_proxy'] }}
|
|
- name: http_proxy
|
|
value: {{ config['Network']['http_proxy'] }}
|
|
{%- endif %}
|
|
{%- if config['Network']['https_proxy'] is defined %}
|
|
- name: HTTPS_PROXY
|
|
value: {{ config['Network']['https_proxy'] }}
|
|
- name: https_proxy
|
|
value: {{ config['Network']['https_proxy'] }}
|
|
{%- endif %}
|
|
{%- if config['Network']['no_proxy'] is defined %}
|
|
- name: NO_PROXY
|
|
value: {{ config['Network']['no_proxy'] }}
|
|
- name: no_proxy
|
|
value: {{ config['Network']['no_proxy'] }}
|
|
{%- endif %}
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
- |-
|
|
set -x
|
|
|
|
cd /etc/kubernetes/armada-loader/assets
|
|
if [ -s promenade-armada.yaml ]; then
|
|
while true; do
|
|
sleep 10
|
|
if armada --debug apply --tiller-host 127.0.0.1 promenade-armada.yaml ; then
|
|
break
|
|
fi
|
|
done
|
|
fi
|
|
|
|
if [ -s external-armada.yaml ]; then
|
|
while true; do
|
|
sleep 10
|
|
if armada --debug apply --tiller-host 127.0.0.1 external-armada.yaml ; then
|
|
break
|
|
fi
|
|
done
|
|
fi
|
|
|
|
touch /shared/armada.done
|
|
|
|
# Sleep so that kubelet doesn't restart this pod before it kills it
|
|
sleep 10000
|
|
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /etc/kubernetes/armada-loader
|
|
readOnly: true
|
|
- name: config
|
|
mountPath: /armada/.kube
|
|
readOnly: true
|
|
- name: shared
|
|
mountPath: /shared
|
|
|
|
- name: monitor
|
|
image: busybox:latest
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |-
|
|
set -x
|
|
|
|
while [ ! -f /shared/armada.done ] ; do
|
|
sleep 1
|
|
done
|
|
|
|
rm -f /etc/kubernetes/kubelet/manifests/armada-loader.yaml
|
|
|
|
# Sleep so that kubelet doesn't restart this pod before it kills it
|
|
sleep 10000
|
|
|
|
volumeMounts:
|
|
- name: shared
|
|
mountPath: /shared
|
|
- name: manifests
|
|
mountPath: /etc/kubernetes/kubelet/manifests
|
|
|
|
volumes:
|
|
- name: config
|
|
hostPath:
|
|
path: /etc/kubernetes/armada-loader
|
|
- name: manifests
|
|
hostPath:
|
|
path: /etc/kubernetes/kubelet/manifests
|
|
- name: shared
|
|
emptyDir: {}
|