Adding affinity and PDB to dns.

This commit is contained in:
Michal Schott 2019-05-29 14:24:45 +02:00
parent 1f1b9fcece
commit 0d133fa52a
No known key found for this signature in database
GPG Key ID: 27CB5207854E69DA
2 changed files with 49 additions and 0 deletions

View File

@ -98,6 +98,18 @@ spec:
labels:
k8s-app: kube-dns
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values:
- kube-dns
topologyKey: kubernetes.io/hostname
priorityClassName: system-cluster-critical
serviceAccountName: coredns
tolerations:
@ -188,3 +200,16 @@ spec:
- name: metrics
port: 9153
protocol: TCP
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: kube-dns
spec:
selector:
matchLabels:
k8s-app: kube-dns
minAvailable: 1

View File

@ -107,6 +107,18 @@ spec:
prometheus.io/scrape: 'true'
prometheus.io/port: '10055'
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values:
- kube-dns
topologyKey: kubernetes.io/hostname
dnsPolicy: Default # Don't use cluster DNS.
serviceAccountName: kube-dns
volumes:
@ -308,3 +320,15 @@ subjects:
- kind: ServiceAccount
name: kube-dns-autoscaler
namespace: kube-system
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: kube-dns
spec:
selector:
matchLabels:
k8s-app: kube-dns
minAvailable: 1