본문 바로가기
OS/mac OS

[k8s] Mac M1에 Docker, Kubectl, Minikube 설치

by ganyga 2024. 3. 5.

Docker Desktop 설치

https://ganyga.tistory.com/entry/Docker-Mac-m1%EC%97%90-Docker-Desktop-%EC%84%A4%EC%B9%98%EC%99%80-%EC%82%AC%EC%9A%A9%EB%B2%95

 

[Docker] Mac M1에 Docker Desktop 설치

https://docs.docker.com/desktop/install/mac-install/ Install Docker Desktop on Mac Install Docker for Mac to get started. This guide covers system requirements, where to download, and instructions on how to install and update. docs.docker.com 0. mac 칩

ganyga.tistory.com

 

Kubectl 설치

 

macOS에 kubectl 설치 및 설정

시작하기 전에 클러스터의 마이너(minor) 버전 차이 내에 있는 kubectl 버전을 사용해야 한다. 예를 들어, v1.29 클라이언트는 v1.28, v1.29, v1.30의 컨트롤 플레인과 연동될 수 있다. 호환되는 최신 버전

kubernetes.io

 

macOS에서 Homebrew를 사용하여 설치

brew install kubectl

 

버전 확인

kubectl version --client

Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3

Minikube 설치

 

minikube start

minikube is local Kubernetes

minikube.sigs.k8s.io

설치할 옵션 선택

brew install minikube

 

minikube Cluster 생성

minikube start

 

kubernetes 상태 확인

kubectl cluster-info
Kubernetes control plane is running at https://127.0.0.1:55345
CoreDNS is running at https://127.0.0.1:55345/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

 

kubernetes node 정보 확인

kubectl get nodes -o wide
NAME       STATUS   ROLES           AGE     VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION    CONTAINER-RUNTIME
minikube   Ready    control-plane   5m49s   v1.28.3   192.168.49.2   <none>        Ubuntu 22.04.3 LTS   6.6.16-linuxkit   docker://24.0.7

 

모든 pods 정보

kubectl get all -A
NAMESPACE     NAME                                   READY   STATUS    RESTARTS      AGE
kube-system   pod/coredns-5dd5756b68-k6nxd           1/1     Running   0             14m
kube-system   pod/etcd-minikube                      1/1     Running   0             14m
kube-system   pod/kube-apiserver-minikube            1/1     Running   0             14m
kube-system   pod/kube-controller-manager-minikube   1/1     Running   0             14m
kube-system   pod/kube-proxy-4478d                   1/1     Running   0             14m
kube-system   pod/kube-scheduler-minikube            1/1     Running   0             14m
kube-system   pod/storage-provisioner                1/1     Running   1 (13m ago)   14m

NAMESPACE     NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
default       service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP                  14m
kube-system   service/kube-dns     ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   14m

NAMESPACE     NAME                        DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR            AGE
kube-system   daemonset.apps/kube-proxy   1         1         1       1            1           kubernetes.io/os=linux   14m

NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
kube-system   deployment.apps/coredns   1/1     1            1           14m

NAMESPACE     NAME                                 DESIRED   CURRENT   READY   AGE
kube-system   replicaset.apps/coredns-5dd5756b68   1         1         1       14m