YOKOHEI.COM

YOKOHEI.COM

›Kubernetes Basics

Kubernetes Basics

  • Kubernetes Basics
  • Commands
  • Static Pod
  • Drain & Uncordon
  • Cluster Upgrade
  • Backup & Restore
  • Certification
  • RBAC
  • CNI
  • CoreDNS
  • Ingress

Kubernetes the Hard Way

  • the Hard Way?
  • AWS Prerequisites
  • CA and TLS
  • Configuration Files
  • Data Encryption
  • Bootstrapping etcd
  • Bootstrapping Control Plane
  • Bootstrapping Worker Node
  • kubectl configuraton
  • Pod Network
  • RBAC for Kubelet
  • Coredns Add-On
  • Test
  • TLS Bootstrapping

Amazon EKS

  • EKS Introduction
  • Ingress with ALB
  • PersistentVolume with EBS
  • NetworkPolicy with Calico
  • Secret with KMS
  • EKS Hands-On

CoreDNS

基礎知識

Corefile の設定方法

Corefile は ConfigMap として渡される。

$ kubectl get configmap -n kube-system
NAME                                 DATA      AGE
coredns                              1         22m
extension-apiserver-authentication   6         22m
kube-proxy                           2         22m
kubeadm-config                       1         22m
kubelet-config-1.11                  1         22m
weave-net                            0         22m

describe してみる。

 kubectl describe configmap coredns -n kube-system
Name:         coredns
Namespace:    kube-system
Labels:       <none>
Annotations:  kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","data":{"Corefile":".:53 {\n    errors\n    health\n    kubernetes nextgen.cloud in-addr.arpa ip6.arpa {\n       pods insecure\n    ...

Data
====
Corefile:
----
.:53 {
    errors
    health
    kubernetes nextgen.cloud in-addr.arpa ip6.arpa {
       pods insecure
       upstream
       fallthrough in-addr.arpa ip6.arpa
    }
    prometheus :9153
    proxy . /etc/resolv.conf
    cache 30
    reload
}

Events:  <none>

クラスタの root zone の確認

Corefile の kubernetes plugin の引数を見ればよい。
上の例を使うと nextgen.cloud となる。

kubernetes nextgen.cloud in-addr.arpa ip6.arpa

操作関連

DNS サーバの IP アドレスの取得

Service の ClusterIP を見ればよい。

$ kubectl get service -n kube-system
NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)         AGE
kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP   19m

Corefile の path 確認

kubectl exec で確認する。

$ kubectl exec coredns-78fcdf6894-hnp48 -n kube-system ps
PID   USER     TIME   COMMAND
    1 root       0:02 /coredns -conf /etc/coredns/Corefile
   27 root       0:00 ps
← CNIIngress →
▼ Codes ▼
LeetCodeGitHub
▼ Profile ▼
LinkedInFlickr
▼ Logo made with DesignEvo ▼
DesignEvo
Copyright © 2020 Kohei Yoshida