본문 바로가기
Kubernetes/Install

K8s 구성 - KinD on MacOS

by 여행을 떠나자! 2021. 9. 14.

2020.08.26

1. kind

   - KinD ?

      kind is a tool for running local Kubernetes clusters using Docker container “nodes”.

      kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI.

      kind supports multi-node (including HA) clusters

      kind is a CNCF certified conformant Kubernetes installer

      https://kind.sigs.k8s.io/

   - supported K8s list

      https://hub.docker.com/r/kindest/node/tags

   - StorageClass

   % k get storageclasses.storage.k8s.io

   NAME                 PROVISIONER             AGE

   standard (default)   rancher.io/local-path   88m

   - 제약조건

      kind currently only exposes a single Docker port to the host machine (Kubernetes API server).

      NodePort 서비스를 외부에서 호출 할 수 없음

 

 

2. Installation

    % brew install kind

 

 

3. Creating a cluster

  % vi kind-config.yaml

  # three node cluster config

  kind: Cluster

  apiVersion: kind.x-k8s.io/v1alpha4

  nodes:

  - role: control-plane

  #  extraPortMappings:

  #  - containerPort: 30000

  #    hostPort: 30000

  #    listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"

  #    protocol: tcp # Optional, defaults to tcp

  - role: worker

  - role: worker

  % kind create cluster --image kindest/node:v1.15.11 --config kind-config.yaml --name kind

 

  % kind get clusters

  % kubectl cluster-info --context kind-kind   # In order to interact with a specific cluster

  % kubectl get nodes

  % docker ps

  CONTAINER ID    IMAGE                   COMMAND                  CREATED             STATUS             PORTS                       NAMES

  aa3212b8f14f    kindest/node:v1.15.11   "/usr/local/bin/entr…"   About an hour ago   Up About an hour   127.0.0.1:51959->6443/tcp   kind-control-plane

  6372dbbe8e9c    kindest/node:v1.15.11   "/usr/local/bin/entr…"   About an hour ago   Up About an hour                               kind-worker2

  8c998069d6ab    kindest/node:v1.15.11   "/usr/local/bin/entr…"   About an hour ago   Up About an hour                               kind-worker

  %

 

4. Stoping cluster (non-official)

  % docker stop kind-worker kind-worker2 kind-control-plane

 

 

5. Starting cluster (non-official)

  % docker start kind-worker kind-worker2 kind-control-plane

 

 

6. Deleting cluster

  % kind delete cluster --name kind

 

'Kubernetes > Install' 카테고리의 다른 글

MetalLB  (0) 2021.09.15
keepalived, haproxy for K8s  (0) 2021.09.15
K8s 구성 - MiniKube on MacOS  (0) 2021.09.14
K8s 구성 - Single on GCE  (0) 2021.09.14
K8s 구성 - HA K8s on bare-metal server  (0) 2021.09.14

댓글