Files
devops-infra-helm-charts-gcp/helm-templates/coredns-1.13.1/templates/deployment.yaml
T
2026-08-26 03:39:42 +05:30

91 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: coredns
namespace: kube-system
labels:
k8s-app: coredns
kubernetes.io/name: "CoreDNS"
annotations:
prometheus.io/port: "9153"
prometheus.io/scrape: "true"
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
selector:
matchLabels:
k8s-app: coredns
template:
metadata:
labels:
k8s-app: coredns
{{ include "labels.common" . | indent 8 }}
annotations:
prometheus.io/port: "9153"
prometheus.io/scrape: "true"
spec:
priorityClassName: system-cluster-critical
serviceAccountName: coredns
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: coredns
image: coredns/coredns:1.13.1
imagePullPolicy: IfNotPresent
resources:
{{- toYaml .Values.resources | nindent 12 }}
args: [ "-conf", "/etc/coredns/Corefile" ]
volumeMounts:
- name: config-volume
mountPath: /etc/coredns
readOnly: true
ports:
- containerPort: 53
name: dns
protocol: UDP
- containerPort: 53
name: dns-tcp
protocol: TCP
- containerPort: 9153
name: metrics
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
livenessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 60
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
readinessProbe:
httpGet:
path: /ready
port: 8181
scheme: HTTP
dnsPolicy: Default
volumes:
- name: config-volume
configMap:
name: coredns
items:
- key: Corefile
path: Corefile