3장 Kubernetes 클러스터 배포

3659 단어 kubernetes

쿠버네티스 클라이언트



Kubernetes API에서 kubectl, 一種用을 사용하는 방법은 다음과 같습니다.

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.15", GitCommit:"2adc8d7091e89b6e3ca8d048140618ec89b39369", GitTreeState:"clean", BuildDate:"2020-09-02T11:40:00Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.15", GitCommit:"2adc8d7091e89b6e3ca8d048140618ec89b39369", GitTreeState:"clean", BuildDate:"2020-09-02T11:31:21Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}


會看到2種版本,一個是本機kubectl版本,一個是Kubernetes API伺服器版本.版本可以相容1個부 버전差異.
예를 들어 api 서버는 1.20 kubectl은 1.21, 1.20, 1.19로 가능합니다.

클러스터 구성 요소



Kubernetes 프록시는 LoadBalancer 내부의 LoadBalancer, 노드에 있는 노드가 없습니다.

The Kubernetes proxy is responsible for routing network traffic to load-balancedservices in the Kubernetes cluster. To do its job, the proxy must be present on everynode in the cluster. Kubernetes has an API object named DaemonSet, which you will learn about later in the book, that is used in many clusters to accomplish this.



$ k get daemonSets --all-namespaces

NAMESPACE     NAME              DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                 AGE
kube-system   kube-flannel-ds   1         1         1       1            1           <none>                        19h
kube-system   kube-proxy        1         1         1       1            1           beta.kubernetes.io/os=linux   19h


쿠버네티스 DNS 작업은 지금 진행 중입니다.

Kubernetes also runs a DNS server, which provides naming and discovery for theservices that are defined in the cluster. This DNS server also runs as a replicated ser‐vice on the cluster. Depending on the size of your cluster, you may see one or more DNS servers running in your cluster.



DNS 배포 작업, 회의 관리에는 DNS 복제본이 있어야 합니다.

$ k get deployments --namespace=kube-system coredns
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
coredns   2/2     2            2           19h


還有一個Service,它為DNS提供LoadBalance.

$ kubectl get svc --namespace=kube-system
NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   19h


Kubernetes UI 只有一個replica,但是為了可靠性和方便升級,還是透過Kubernetes 배포 관리.

좋은 웹페이지 즐겨찾기