kubespray/roles/dnsmasq/templates/dnsmasq-deploy.yml.j2

73 lines
2.0 KiB
Plaintext
Raw Normal View History

2016-03-18 22:07:33 +08:00
---
apiVersion: extensions/v1beta1
kind: Deployment
2016-03-18 22:07:33 +08:00
metadata:
name: dnsmasq
namespace: "kube-system"
2016-03-18 22:07:33 +08:00
labels:
k8s-app: dnsmasq
kubernetes.io/cluster-service: "true"
2016-03-18 22:07:33 +08:00
spec:
replicas: {{ dnsmasq_min_replicas }}
selector:
matchLabels:
k8s-app: dnsmasq
strategy:
type: "Recreate"
2016-03-18 22:07:33 +08:00
template:
metadata:
labels:
k8s-app: dnsmasq
kubernetes.io/cluster-service: "true"
2017-06-17 01:25:46 +08:00
kubespray/dnsmasq-checksum: "{{ dnsmasq_stat.stat.checksum }}"
2016-03-18 22:07:33 +08:00
spec:
{% if kube_version is version('v1.11.1', '>=') %}
priorityClassName: system-cluster-critical
{% endif %}
tolerations:
- effect: NoSchedule
operator: Exists
nodeSelector:
beta.kubernetes.io/os: linux
2016-03-18 22:07:33 +08:00
containers:
- name: dnsmasq
image: "{{ dnsmasq_image_repo }}:{{ dnsmasq_image_tag }}"
imagePullPolicy: {{ k8s_image_pull_policy }}
2016-03-18 22:07:33 +08:00
command:
- dnsmasq
args:
- -k
- -C
- /etc/dnsmasq.d/01-kube-dns.conf
2016-03-18 22:07:33 +08:00
securityContext:
capabilities:
add:
- NET_ADMIN
resources:
limits:
cpu: {{ dns_cpu_limit }}
memory: {{ dns_memory_limit }}
requests:
cpu: {{ dns_cpu_requests }}
memory: {{ dns_memory_requests }}
2016-03-18 22:07:33 +08:00
ports:
- name: dns
containerPort: 53
protocol: UDP
- name: dns-tcp
containerPort: 53
protocol: TCP
volumeMounts:
- name: etcdnsmasqd
mountPath: /etc/dnsmasq.d
- name: etcdnsmasqdavailable
mountPath: /etc/dnsmasq.d-available
volumes:
- name: etcdnsmasqd
hostPath:
path: /etc/dnsmasq.d
- name: etcdnsmasqdavailable
hostPath:
path: /etc/dnsmasq.d-available
dnsPolicy: Default # Don't use cluster DNS.