In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
CoreDNS is actually a DNS service, and DNS is a common means of service discovery, so many open source projects and engineers will use CoreDNS to provide service discovery for the cluster. Kubernetes uses CoreDNS in the cluster to solve the problem of service discovery.
Coredns image version: v1.6.6
The following is the YAML file required for deployment, with the main modification location: clusterIP in Service
Source of YAML file:
Https://github.com/coredns/deployment/tree/master/kubernetes
Modified by coredns.yaml.sed.
ApiVersion: v1kind: ServiceAccountmetadata: name: coredns namespace: kube-system---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata: labels: kubernetes.io/bootstrapping: rbac-defaults name: system:corednsrules:- apiGroups:-"" resources:-endpoints-services-pods-namespaces verbs:-list-watch- apiGroups:-"" resources:-nodes verbs:-get---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: Annotations: rbac.authorization.kubernetes.io/autoupdate: "true" labels: kubernetes.io/bootstrapping: rbac-defaults name: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: system:corednssubjects:- kind: ServiceAccount name: coredns namespace: kube-system---apiVersion: v1kind: ConfigMapmetadata: name: coredns namespace: kube-systemdata: Corefile:.: 53 {errors health {lameduck 5s} Ready kubernetes cluster.local in-addr.arpa ip6.arpa {fallthrough in-addr.arpa ip6.arpa} prometheus: 9153 forward. / etc/resolv.conf cache 30 loop reload loadbalance}-apiVersion: apps/v1kind: Deploymentmetadata: name: coredns namespace: kube-system labels: k8s-app: kube-dns kubernetes.io/name: "CoreDNS" spec: # replicas: not specified here: # 1. Default is 1. # 2. Will be tuned in real time if DNS horizontal auto-scaling is turned on. Strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 selector: matchLabels: k8s-app: kube-dns template: metadata: labels: k8s-app: kube-dns spec: priorityClassName: system-cluster-critical serviceAccountName: coredns tolerations:-key: "CriticalAddonsOnly" operator: "Exists" nodeSelector: beta.kubernetes.io/os: linux affinity: PodAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution:-labelSelector: matchExpressions:-key: k8s-app operator: In values: ["kube-dns"] topologyKey: kubernetes.io/hostname containers:-name: coredns image: coredns/coredns:1.6.6 imagePullPolicy: IfNotPresent resources: Limits: memory: 170Mi requests: cpu: 100m memory: 70Mi 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---apiVersion: v1kind: Servicemetadata: name: kube-dns Namespace: kube-system annotations: prometheus.io/port: "9153" prometheus.io/scrape: "true" labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: "CoreDNS" spec: selector: k8s-app: kube-dns clusterIP: 10.110.0.2 ports:-name: dns port: 53 protocol: UDP-name: dns-tcp port: 53 protocol: TCP-name: metrics port: 9153 protocol: TCP
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.