135 lines
4.0 KiB
YAML
135 lines
4.0 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: bootstrap-armada
|
|
namespace: kube-system
|
|
labels:
|
|
application: promenade
|
|
component: genesis
|
|
spec:
|
|
dnsPolicy: Default
|
|
hostNetwork: true
|
|
containers:
|
|
- name: armada
|
|
image: {{ config['Genesis:images.armada'] }}
|
|
securityContext:
|
|
runAsUser: 0
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
- |-
|
|
set -x
|
|
|
|
declare -i attempt=1
|
|
|
|
while true; do
|
|
sleep 10
|
|
if armada \
|
|
apply \
|
|
--target-manifest {{ config.get_path('Genesis:armada.target_manifest', 'cluster-bootstrap') }} \
|
|
$([[ $attempt -le $ARMADA_METRICS_MAX_ATTEMPTS ]] && echo --metrics-output "${ARMADA_METRICS_OUTPUT_DIR}/armada-bootstrap-${attempt}.prom") \
|
|
/etc/genesis/armada/assets/manifest.yaml &>> "${ARMADA_LOGFILE}"; then
|
|
break
|
|
fi
|
|
attempt+=1
|
|
done
|
|
touch /ipc/armada-done
|
|
sleep 10000
|
|
env:
|
|
- name: ARMADA_LOGFILE
|
|
value: /tmp/log/bootstrap-armada.log
|
|
- name: ARMADA_METRICS_OUTPUT_DIR
|
|
value: /tmp/metrics
|
|
- name: ARMADA_METRICS_MAX_ATTEMPTS
|
|
value: "{{ config.get_path('Genesis:armada.metrics.max_attempts', 10) }}"
|
|
{%- if config['KubernetesNetwork:proxy.url'] is defined %}
|
|
- name: HTTP_PROXY
|
|
value: {{ config['KubernetesNetwork:proxy.url'] }}
|
|
- name: HTTPS_PROXY
|
|
value: {{ config['KubernetesNetwork:proxy.url'] }}
|
|
- name: NO_PROXY
|
|
value: {{ config.get(kind='KubernetesNetwork') | fill_no_proxy }}
|
|
- name: http_proxy
|
|
value: {{ config['KubernetesNetwork:proxy.url'] }}
|
|
- name: https_proxy
|
|
value: {{ config['KubernetesNetwork:proxy.url'] }}
|
|
- name: no_proxy
|
|
value: {{ config.get(kind='KubernetesNetwork') | fill_no_proxy }}
|
|
{%- endif %}
|
|
volumeMounts:
|
|
- name: assets
|
|
mountPath: /etc/genesis/armada/assets
|
|
- name: auth
|
|
mountPath: /root/.kube
|
|
- name: ipc
|
|
mountPath: /ipc
|
|
- name: log
|
|
mountPath: /tmp/log
|
|
- name: metrics
|
|
mountPath: /tmp/metrics
|
|
- name: monitor
|
|
image: {{ config['HostSystem:images.monitoring_image'] }}
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |-
|
|
set -x
|
|
|
|
while ! [ -e /ipc/armada-done ]; do
|
|
sleep 5
|
|
done
|
|
|
|
rm -f /etc/kubernetes/manifests/bootstrap-armada.yaml
|
|
sleep 10000
|
|
volumeMounts:
|
|
- name: ipc
|
|
mountPath: /ipc
|
|
- name: manifest
|
|
mountPath: /etc/kubernetes/manifests
|
|
- name: kubectl-apiserver
|
|
image: {{ config['Genesis:images.kubernetes.apiserver'] }}
|
|
command:
|
|
{%- for argument in config.bootstrap_apiserver_prefix() %}
|
|
- "{{ argument }}"
|
|
{%- endfor %}
|
|
{% include "genesis-apiserver.yaml" with context %}
|
|
- --etcd-servers=https://localhost:12379
|
|
- --secure-port=6444
|
|
- --endpoint-reconciler-type=none
|
|
env:
|
|
- name: KUBECONFIG
|
|
value: /etc/kubernetes/admin/config
|
|
volumeMounts:
|
|
- name: auth
|
|
mountPath: /etc/kubernetes/admin
|
|
- name: config
|
|
mountPath: /etc/kubernetes/apiserver
|
|
readOnly: true
|
|
volumes:
|
|
- name: assets
|
|
hostPath:
|
|
path: /etc/genesis/armada/assets
|
|
- name: auth
|
|
hostPath:
|
|
path: /etc/genesis/armada/auth
|
|
- name: manifest
|
|
hostPath:
|
|
path: /etc/kubernetes/manifests
|
|
- name: ipc
|
|
emptyDir: {}
|
|
- name: log
|
|
hostPath:
|
|
path: /var/log/armada
|
|
- name: metrics
|
|
hostPath:
|
|
path: {{ config.get_path('Genesis:armada.metrics.output_dir', '/var/log/node-exporter-textfiles') }}
|
|
- name: config
|
|
hostPath:
|
|
path: /etc/genesis/apiserver
|
|
|
|
restartPolicy: Always
|
|
schedulerName: default-scheduler
|
|
securityContext: {}
|
|
terminationGracePeriodSeconds: 30
|