Last active
February 5, 2022 11:47
-
-
Save HirokiYoshida837/7541612b0597874d99fb6cad6de0e375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kube-dnsについて調べてみる。 |
Author
HirokiYoshida837
commented
Feb 5, 2022
❯ kubectl describe po kube-dns-697dc8fc8b-8fs7n -n kube-system
Name: kube-dns-697dc8fc8b-8fs7n
Namespace: kube-system
Priority: 2000000000
Priority Class Name: system-cluster-critical
Node: gke-k8s-benkyo-gke-k8s-benkyo-gke-nod-9c8265c2-tznl/10.10.0.5
Start Time: Sat, 05 Feb 2022 20:21:40 +0900
Labels: k8s-app=kube-dns
pod-template-hash=697dc8fc8b
Annotations: cni.projectcalico.org/containerID: 414fc9ded1418ecbb0cce132a9cabd06f83c108f8c2d2406ad8d31b3c9a39fb1
cni.projectcalico.org/podIP: 10.60.1.4/32
cni.projectcalico.org/podIPs: 10.60.1.4/32
components.gke.io/component-name: kubedns
prometheus.io/port: 10054
prometheus.io/scrape: true
scheduler.alpha.kubernetes.io/critical-pod:
seccomp.security.alpha.kubernetes.io/pod: runtime/default
Status: Running
IP: 10.60.1.4
IPs:
IP: 10.60.1.4
Controlled By: ReplicaSet/kube-dns-697dc8fc8b
Containers:
kubedns:
Container ID: containerd://07dc2543ffc30e9ce39b64f36d7de42289c03f1942cce10f673953b8516626fb
Image: gke.gcr.io/k8s-dns-kube-dns:1.21.0-gke.0
Image ID: gke.gcr.io/k8s-dns-kube-dns@sha256:b5dd662f1a366bbc034954dcc66beb2a5009a78982479f2b7ab7d431b12efb3f
Ports: 10053/UDP, 10053/TCP, 10055/TCP
Host Ports: 0/UDP, 0/TCP, 0/TCP
Args:
--domain=cluster.local.
--dns-port=10053
--config-dir=/kube-dns-config
--v=2
State: Running
Started: Sat, 05 Feb 2022 20:21:46 +0900
Ready: True
Restart Count: 0
Limits:
memory: 210Mi
Requests:
cpu: 100m
memory: 70Mi
Liveness: http-get http://:10054/healthcheck/kubedns delay=60s timeout=5s period=10s #success=1 #failure=5
Readiness: http-get http://:8081/readiness delay=3s timeout=5s period=10s #success=1 #failure=3
Environment:
PROMETHEUS_PORT: 10055
Mounts:
/kube-dns-config from kube-dns-config (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-g8v6z (ro)
dnsmasq:
Container ID: containerd://fcbab93edf6e930007a45c0304ef977041791246a702c5ae15d7d4ac0b8eb247
Image: gke.gcr.io/k8s-dns-dnsmasq-nanny:1.21.0-gke.0
Image ID: gke.gcr.io/k8s-dns-dnsmasq-nanny@sha256:64b131898a7aead50510baa425a0525aa71b2b2733ea0352e50ccdebad682720
Ports: 53/UDP, 53/TCP
Host Ports: 0/UDP, 0/TCP
Args:
-v=2
-logtostderr
-configDir=/etc/k8s/dns/dnsmasq-nanny
-restartDnsmasq=true
--
-k
--cache-size=1000
--no-negcache
--dns-forward-max=1500
--log-facility=-
--server=/cluster.local/127.0.0.1#10053
--server=/in-addr.arpa/127.0.0.1#10053
--server=/ip6.arpa/127.0.0.1#10053
State: Running
Started: Sat, 05 Feb 2022 20:21:49 +0900
Ready: True
Restart Count: 0
Requests:
cpu: 150m
memory: 20Mi
Liveness: http-get http://:10054/healthcheck/dnsmasq delay=60s timeout=5s period=10s #success=1 #failure=5
Environment: <none>
Mounts:
/etc/k8s/dns/dnsmasq-nanny from kube-dns-config (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-g8v6z (ro)
sidecar:
Container ID: containerd://0d403010d0af2ded0c18d784e6600e911c27ab642215e33d758ca065d4f47b36
Image: gke.gcr.io/k8s-dns-sidecar:1.21.0-gke.0
Image ID: gke.gcr.io/k8s-dns-sidecar@sha256:6a175b4ddbff9d87551437c481581f7c26444ff678ddf98d16bb458df75e0eb8
Port: 10054/TCP
Host Port: 0/TCP
Args:
--v=2
--logtostderr
--probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.cluster.local,5,SRV
--probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.cluster.local,5,SRV
State: Running
Started: Sat, 05 Feb 2022 20:21:52 +0900
Ready: True
Restart Count: 0
Requests:
cpu: 10m
memory: 20Mi
Liveness: http-get http://:10054/metrics delay=60s timeout=5s period=10s #success=1 #failure=5
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-g8v6z (ro)
prometheus-to-sd:
Container ID: containerd://2ff968f2f6071e3cf61907da2282e817421c1769840db8d983a3b8222fd6008a
Image: gke.gcr.io/prometheus-to-sd:v0.4.2
Image ID: gke.gcr.io/prometheus-to-sd@sha256:aca8ef83a7fae83f1f8583e978dd4d1ff655b9f2ca0a76bda5edce6d8965bdf2
Port: <none>
Host Port: <none>
Command:
/monitor
--source=kubedns:http://localhost:10054?whitelisted=probe_kubedns_latency_ms,probe_kubedns_errors,dnsmasq_misses,dnsmasq_hits
--stackdriver-prefix=container.googleapis.com/internal/addons
--api-override=https://monitoring.googleapis.com/
--pod-id=$(POD_NAME)
--namespace-id=$(POD_NAMESPACE)
--v=2
State: Running
Started: Sat, 05 Feb 2022 20:21:54 +0900
Ready: True
Restart Count: 0
Environment:
POD_NAME: kube-dns-697dc8fc8b-8fs7n (v1:metadata.name)
POD_NAMESPACE: kube-system (v1:metadata.namespace)
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-g8v6z (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
kube-dns-config:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: kube-dns
Optional: true
kube-api-access-g8v6z:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: Burstable
Node-Selectors: kubernetes.io/os=linux
Tolerations: CriticalAddonsOnly op=Exists
components.gke.io/gke-managed-components op=Exists
node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 7m12s default-scheduler Successfully assigned kube-system/kube-dns-697dc8fc8b-8fs7n to gke-k8s-benkyo-gke-k8s-benkyo-gke-nod-9c8265c2-tznl
Normal Pulling 7m11s kubelet Pulling image "gke.gcr.io/k8s-dns-kube-dns:1.21.0-gke.0"
Normal Pulled 7m7s kubelet Successfully pulled image "gke.gcr.io/k8s-dns-kube-dns:1.21.0-gke.0" in 4.544893878s
Normal Created 7m6s kubelet Created container kubedns
Normal Started 7m6s kubelet Started container kubedns
Normal Pulling 7m6s kubelet Pulling image "gke.gcr.io/k8s-dns-dnsmasq-nanny:1.21.0-gke.0"
Normal Pulled 7m4s kubelet Successfully pulled image "gke.gcr.io/k8s-dns-dnsmasq-nanny:1.21.0-gke.0" in 2.102300153s
Normal Pulling 7m3s kubelet Pulling image "gke.gcr.io/k8s-dns-sidecar:1.21.0-gke.0"
Normal Created 7m3s kubelet Created container dnsmasq
Normal Started 7m3s kubelet Started container dnsmasq
Normal Pulled 7m1s kubelet Successfully pulled image "gke.gcr.io/k8s-dns-sidecar:1.21.0-gke.0" in 2.319810819s
Normal Created 7m kubelet Created container sidecar
Normal Started 7m kubelet Started container sidecar
Normal Pulling 7m kubelet Pulling image "gke.gcr.io/prometheus-to-sd:v0.4.2"
Normal Pulled 6m58s kubelet Successfully pulled image "gke.gcr.io/prometheus-to-sd:v0.4.2" in 1.889991719s
Normal Created 6m58s kubelet Created container prometheus-to-sd
Normal Started 6m58s kubelet Started container prometheus-to-sd
SkyDNSのetcdストレージが削除され、DNSレコードがメモリに直接保存されて、クエリのパフォーマンスが向上します。
添付資料011.KubernetesDNSと構築
kube-dnsのコードを十分に読めてないけど、この資料でも言われているようにSkyDNS関係の処理を色々含んでるけど、バックエンド自体はオンメモリになってそう。
ちゃんと調べようとしたらコードリーディングとSkyDNSのことを調べないと難しそう。
一旦ここまで。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment