c12s-kubespray/roles/network_plugin/contiv/templates/contiv-etcd.yml.j2
Robert Neumann 586ad89d50 Fix for unknown 'kubernetes.io' or 'k8s.io' labels specified with --node-labels (#4320)
* Fix the file path for all.yml and k8s-cluster.yml

* Fix --node-labels namespace error "unknown labels specified"

* Update templates and configs kubelet node-labels
2019-04-10 04:14:12 -07:00

70 lines
2.2 KiB
Django/Jinja

---
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
name: contiv-etcd
namespace: kube-system
labels:
k8s-app: contiv-etcd
spec:
selector:
matchLabels:
k8s-app: contiv-etcd
template:
metadata:
labels:
k8s-app: contiv-etcd
spec:
{% if kube_version is version('v1.11.1', '>=') %}
priorityClassName: system-node-critical
{% endif %}
hostNetwork: true
hostPID: true
nodeSelector:
node.kubernetes.io/master: ""
tolerations:
- operator: Exists
# Mark pod as critical for rescheduling (Will have no effect starting with kubernetes 1.12)
- key: CriticalAddonsOnly
operator: "Exists"
initContainers:
- name: contiv-etcd-init
image: {{ contiv_etcd_init_image_repo }}:{{ contiv_etcd_init_image_tag }}
imagePullPolicy: Always
env:
- name: ETCD_INIT_ARGSFILE
value: '{{ contiv_etcd_conf_dir }}/contiv-etcd-args'
- name: ETCD_INIT_LISTEN_PORT
value: '{{ contiv_etcd_listen_port }}'
- name: ETCD_INIT_PEER_PORT
value: '{{ contiv_etcd_peer_port }}'
- name: ETCD_INIT_CLUSTER
value: '{{ contiv_etcd_endpoints }}'
- name: ETCD_INIT_DATA_DIR
value: '{{ contiv_etcd_data_dir }}'
volumeMounts:
- name: contiv-etcd-conf-dir
mountPath: {{ contiv_etcd_conf_dir }}
containers:
- name: contiv-etcd
image: {{ contiv_etcd_image_repo }}:{{ contiv_etcd_image_tag }}
command:
- sh
- -c
- "/usr/local/bin/etcd $(cat $ETCD_INIT_ARGSFILE)"
env:
- name: ETCD_INIT_ARGSFILE
value: {{ contiv_etcd_conf_dir }}/contiv-etcd-args
volumeMounts:
- name: contiv-etcd-conf-dir
mountPath: {{ contiv_etcd_conf_dir }}
- name: contiv-etcd-data-dir
mountPath: {{ contiv_etcd_data_dir }}
volumes:
- name: contiv-etcd-data-dir
hostPath:
path: {{ contiv_etcd_data_dir }}
- name: contiv-etcd-conf-dir
hostPath:
path: {{ contiv_etcd_conf_dir }}