본문 바로가기
other/linux

ubuntu에 kind를 설치하기

by seohan1010 2025. 11. 28.

 

-설치 순서 
-> 다운로드 및 설치 
: curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
-> 쿠버네티스 클러스터 생성 
: kind create cluster
-> 멀티 노드 클러스터 생성 (워커 노드 여러 개)
: # kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker
-> 클러스터 생성 
: kind create cluster --config kind-config.yaml
-> 노드 확인 
: kubectl get nodes -o wide
-> 도커 컨테이너 확인 
: kubectl get nodes -o wide
-> 특정 이름의 클러스터 삭제 
: kind delete cluster --name mycluster
-> 클러스터 이름 변경 
: kind create cluster --name dev
kind create cluster --name test
-> 노드 이미지 지정 
: kind create cluster --image kindest/node:v1.30.0
-> kind가 생성한 네트워크 확인 
: docker network ls
docker network inspect kind
-> kind 클러스터에 ingress nginx 설치 
: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml

-> 호스트의 포트와 kind-control-plane의 포트를 매핑 
: # kind-ingress.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
    extraPortMappings:
      - containerPort: 80
        hostPort: 80
      - containerPort: 443
        hostPort: 443
  - role: worker
  - role: worker