Path: blob/main/install/preview/manifests/coredns.yaml
2498 views
# Copyright (c) 2022 Gitpod GmbH. All rights reserved.1# Licensed under the GNU Affero General Public License (AGPL).2# See License.AGPL.txt in the project root for license information.34apiVersion: v15kind: ServiceAccount6metadata:7name: coredns8namespace: kube-system9---10apiVersion: rbac.authorization.k8s.io/v1beta111kind: ClusterRole12metadata:13labels:14kubernetes.io/bootstrapping: rbac-defaults15name: system:coredns16rules:17- apiGroups:18- ""19resources:20- endpoints21- services22- pods23- namespaces24verbs:25- list26- watch27- apiGroups:28- discovery.k8s.io29resources:30- endpointslices31verbs:32- list33- watch34---35apiVersion: rbac.authorization.k8s.io/v1beta136kind: ClusterRoleBinding37metadata:38annotations:39rbac.authorization.kubernetes.io/autoupdate: "true"40labels:41kubernetes.io/bootstrapping: rbac-defaults42name: system:coredns43roleRef:44apiGroup: rbac.authorization.k8s.io45kind: ClusterRole46name: system:coredns47subjects:48- kind: ServiceAccount49name: coredns50namespace: kube-system51---52apiVersion: v153kind: ConfigMap54metadata:55name: coredns56namespace: kube-system57data:58gitpod.db: |59; preview.gitpod-self-hosted.com test file60preview.gitpod-self-hosted.com. IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082541 7200 3600 1209600 360061preview.gitpod-self-hosted.com. IN CNAME proxy.default.svc.cluster.local.62*.preview.gitpod-self-hosted.com. IN CNAME proxy.default.svc.cluster.local.63*.ws.preview.gitpod-self-hosted.com. IN CNAME proxy.default.svc.cluster.local.64Corefile: |65.:53 {66errors67health68ready69# extra configuration for `preview.gitpod-self-hosted.com`70file /etc/coredns/gitpod.db preview.gitpod-self-hosted.com71kubernetes cluster.local in-addr.arpa ip6.arpa {72pods insecure73fallthrough in-addr.arpa ip6.arpa74}75hosts /etc/coredns/NodeHosts {76ttl 6077reload 15s78fallthrough79}80prometheus :915381forward . /etc/resolv.conf82cache 3083loop84reload85loadbalance86}87---88apiVersion: apps/v189kind: Deployment90metadata:91name: coredns92namespace: kube-system93labels:94k8s-app: kube-dns95kubernetes.io/name: "CoreDNS"96spec:97#replicas: 198strategy:99type: RollingUpdate100rollingUpdate:101maxUnavailable: 1102selector:103matchLabels:104k8s-app: kube-dns105template:106metadata:107labels:108k8s-app: kube-dns109spec:110priorityClassName: "system-cluster-critical"111serviceAccountName: coredns112tolerations:113- key: "CriticalAddonsOnly"114operator: "Exists"115- key: "node-role.kubernetes.io/control-plane"116operator: "Exists"117effect: "NoSchedule"118- key: "node-role.kubernetes.io/master"119operator: "Exists"120effect: "NoSchedule"121nodeSelector:122beta.kubernetes.io/os: linux123containers:124- name: coredns125image: rancher/mirrored-coredns-coredns:1.9.1126imagePullPolicy: IfNotPresent127resources:128limits:129memory: 170Mi130requests:131cpu: 100m132memory: 70Mi133args: [ "-conf", "/etc/coredns/Corefile" ]134volumeMounts:135- name: config-volume136mountPath: /etc/coredns137readOnly: true138ports:139- containerPort: 53140name: dns141protocol: UDP142- containerPort: 53143name: dns-tcp144protocol: TCP145- containerPort: 9153146name: metrics147protocol: TCP148securityContext:149allowPrivilegeEscalation: false150capabilities:151add:152- NET_BIND_SERVICE153drop:154- all155readOnlyRootFilesystem: true156livenessProbe:157httpGet:158path: /health159port: 8080160scheme: HTTP161initialDelaySeconds: 60162periodSeconds: 10163timeoutSeconds: 1164successThreshold: 1165failureThreshold: 3166readinessProbe:167httpGet:168path: /ready169port: 8181170scheme: HTTP171initialDelaySeconds: 0172periodSeconds: 2173timeoutSeconds: 1174successThreshold: 1175failureThreshold: 3176dnsPolicy: Default177volumes:178- name: config-volume179configMap:180name: coredns181items:182- key: gitpod.db183path: gitpod.db184- key: Corefile185path: Corefile186- key: NodeHosts187path: NodeHosts188---189apiVersion: v1190kind: Service191metadata:192name: kube-dns193namespace: kube-system194annotations:195prometheus.io/port: "9153"196prometheus.io/scrape: "true"197labels:198k8s-app: kube-dns199kubernetes.io/cluster-service: "true"200kubernetes.io/name: "CoreDNS"201spec:202selector:203k8s-app: kube-dns204clusterIP: 10.43.0.10205ports:206- name: dns207port: 53208protocol: UDP209- name: dns-tcp210port: 53211protocol: TCP212- name: metrics213port: 9153214protocol: TCP215216217