
Add ability to set resources for components. Change-Id: I9c4b57fbba3a744d28118133303f9159d1595782
196 lines
5.9 KiB
YAML
196 lines
5.9 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
|
|
|
|
if [ ! -e "${ARMADA_LOGFILE}" ]; then
|
|
touch "${ARMADA_LOGFILE}"
|
|
fi
|
|
tail -f "${ARMADA_LOGFILE}" &
|
|
|
|
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 %}
|
|
{%- if config['Genesis:armada.resources'] is defined %}
|
|
resources:
|
|
{{ config.get_path('Genesis:armada.resources', {}) | toyaml | trim | indent(8, true) }}
|
|
{%- 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
|
|
{%- if config['Genesis:enable_operator'] is sameas true %}
|
|
- command:
|
|
- /bin/sh
|
|
- -c
|
|
- |-
|
|
set -x
|
|
|
|
if [ ! -e "${ARMADA_OPERATOR_LOGFILE}" ]; then
|
|
touch "${ARMADA_OPERATOR_LOGFILE}"
|
|
fi
|
|
tail -f "${ARMADA_OPERATOR_LOGFILE}" &
|
|
|
|
/manager \
|
|
--health-probe-bind-address=:8081 \
|
|
--metrics-bind-address=127.0.0.1:8080 \
|
|
--leader-elect \
|
|
--leader-elect-namespace=ucp 2>&1 | tee -a "${ARMADA_OPERATOR_LOGFILE}"
|
|
env:
|
|
- name: ARMADA_OPERATOR_LOGFILE
|
|
value: /tmp/log/bootstrap-armada-operator.log
|
|
- name: KUBECONFIG
|
|
value: /root/.kube/config
|
|
image: {{ config['Genesis:images.armada-operator'] }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: 8081
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 20
|
|
name: manager
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /readyz
|
|
port: 8081
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
securityContext:
|
|
runAsUser: 0
|
|
{%- if config['Genesis:armada.manager.resources'] is defined %}
|
|
resources:
|
|
{{ config.get_path('Genesis:armada.manager.resources', {}) | toyaml | trim | indent(8, true) }}
|
|
{%- endif %}
|
|
volumeMounts:
|
|
- name: auth
|
|
mountPath: /root/.kube
|
|
- name: log
|
|
mountPath: /tmp/log
|
|
{%- endif %}
|
|
- 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
|
|
{%- if config['Genesis:armada.monitor.resources'] is defined %}
|
|
resources:
|
|
{{ config.get_path('Genesis:armada.monitor.resources', {}) | toyaml | trim | indent(8, true) }}
|
|
{%- endif %}
|
|
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
|