YOKOHEI.COM

YOKOHEI.COM

›Kubernetes the Hard Way

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

Deploying the DNS Cluster Add-on

この章では Cluster DNS として coredns を導入する。

Deploy

以下コマンドでデプロイ

$ kubectl apply -f https://raw.githubusercontent.com/mmumshad/kubernetes-the-hard-way/master/deployments/coredns.yaml

動いていることを確認

$ kubectl get pods -l k8s-app=kube-dns -n kube-system
NAME                       READY   STATUS    RESTARTS   AGE
coredns-69cbb76ff8-dlf99   1/1     Running   0          9s
coredns-69cbb76ff8-wn5ls   1/1     Running   0          9s

動作検証

$ kubectl run --generator=run-pod/v1  busybox --image=busybox:1.28 --command -- sleep 3600

$ kubectl exec -ti busybox -- nslookup kubernetes
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name:      kubernetes
Address 1: 10.96.0.1 kubernetes.default.svc.cluster.local

トラブルシューティングガイド

今回、kubectl exec 実行時に失敗する件で詰まった。

$ kubectl exec -ti busybox -- nslookup kubernetes
Error from server: error dialing backend: dial tcp: lookup worker-2 on 127.0.0.53:53: server misbehaving

マスターノードが worker-2 を名前解決できないという問題。
似た issue はたくさんあった。

https://github.com/kubernetes/kubernetes/issues/39980
https://github.com/kubernetes/kubernetes/issues/39026

今回は /etc/hosts に各ワーカーノードの IP アドレスとホスト名を書いて対応した。

← RBAC for KubeletTest →
▼ Codes ▼
LeetCodeGitHub
▼ Profile ▼
LinkedInFlickr
▼ Logo made with DesignEvo ▼
DesignEvo
Copyright © 2020 Kohei Yoshida