Minikube๋ก Kubernetes Cluster ๊ตฌ์ฑ
minikube start
๐ Darwin 14.1.1 (arm64) ์ minikube v1.32.0
โจ ์๋์ ์ผ๋ก docker ๋๋ผ์ด๋ฒ๊ฐ ์ ํ๋์์ต๋๋ค. ๋ค๋ฅธ ๋๋ผ์ด๋ฒ ๋ชฉ๋ก: vmware, ssh
๐ Using Docker Desktop driver with root privileges
๐ minikube ํด๋ฌ์คํฐ์ minikube ์ปจํธ๋กค ํ๋ ์ธ ๋
ธ๋๋ฅผ ์์ํ๋ ์ค
๐ ๋ฒ ์ด์ค ์ด๋ฏธ์ง๋ฅผ ๋ค์ด๋ฐ๋ ์ค ...
๐ฅ Creating docker container (CPUs=2, Memory=4000MB) ...
๐ณ ์ฟ ๋ฒ๋คํฐ์ค v1.28.3 ์ Docker 24.0.7 ๋ฐํ์์ผ๋ก ์ค์นํ๋ ์ค
โช ์ธ์ฆ์ ๋ฐ ํค๋ฅผ ์์ฑํ๋ ์ค ...
โช ์ปจํธ๋กค ํ๋ ์ธ์ด ๋ถํ
...
โช RBAC ๊ท์น์ ๊ตฌ์ฑํ๋ ์ค ...
๐ Configuring bridge CNI (Container Networking Interface) ...
๐ Kubernetes ๊ตฌ์ฑ ์์๋ฅผ ํ์ธ...
โช Using image gcr.io/k8s-minikube/storage-provisioner:v5
๐ ์ ๋์จ ํ์ฑํ : storage-provisioner, default-storageclass
๐ ๋๋ฌ์ต๋๋ค! kubectl์ด "minikube" ํด๋ฌ์คํฐ์ "default" ๋ค์์คํ์ด์ค๋ฅผ ๊ธฐ๋ณธ์ ์ผ๋ก ์ฌ์ฉํ๋๋ก ๊ตฌ์ฑ๋์์ต๋๋ค.
kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
minikube Ready control-plane 11s v1.28.3 192.168.49.2 <none> Ubuntu 22.04.3 LTS 6.6.16-linuxkit docker://24.0.7
minikube node add
๐ ๋
ธ๋ m02 ๋ฅผ ํด๋ฌ์คํฐ minikube ์ ์ถ๊ฐํฉ๋๋ค
โ Cluster was created without any CNI, adding a node to it might cause broken networking.
๐ Starting worker node minikube-m02 in cluster minikube
๐ ๋ฒ ์ด์ค ์ด๋ฏธ์ง๋ฅผ ๋ค์ด๋ฐ๋ ์ค ...
๐ฅ Creating docker container (CPUs=2, Memory=2200MB) ...
๐ณ ์ฟ ๋ฒ๋คํฐ์ค v1.28.3 ์ Docker 24.0.7 ๋ฐํ์์ผ๋ก ์ค์นํ๋ ์ค
๐ Kubernetes ๊ตฌ์ฑ ์์๋ฅผ ํ์ธ...
๐ m02 ๋ฅผ minikube ์ ์ฑ๊ณต์ ์ผ๋ก ์ถ๊ฐํ์์ต๋๋ค!
minikube node add
๐ ๋
ธ๋ m03 ๋ฅผ ํด๋ฌ์คํฐ minikube ์ ์ถ๊ฐํฉ๋๋ค
๐ Starting worker node minikube-m03 in cluster minikube
๐ ๋ฒ ์ด์ค ์ด๋ฏธ์ง๋ฅผ ๋ค์ด๋ฐ๋ ์ค ...
๐ฅ Creating docker container (CPUs=2, Memory=2200MB) ...
๐ณ ์ฟ ๋ฒ๋คํฐ์ค v1.28.3 ์ Docker 24.0.7 ๋ฐํ์์ผ๋ก ์ค์นํ๋ ์ค
๐ Kubernetes ๊ตฌ์ฑ ์์๋ฅผ ํ์ธ...
๐ m03 ๋ฅผ minikube ์ ์ฑ๊ณต์ ์ผ๋ก ์ถ๊ฐํ์์ต๋๋ค!
kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
minikube Ready control-plane 83s v1.28.3 192.168.49.2 <none> Ubuntu 22.04.3 LTS 6.6.16-linuxkit docker://24.0.7
minikube-m02 Ready <none> 49s v1.28.3 192.168.49.3 <none> Ubuntu 22.04.3 LTS 6.6.16-linuxkit docker://24.0.7
minikube-m03 Ready <none> 8s v1.28.3 192.168.49.4 <none> Ubuntu 22.04.3 LTS 6.6.16-linuxkit docker://24.0.7
ArgoCD ์ค์น
https://argo-cd.readthedocs.io/en/stable/getting_started/
kubectl create namespace argocd
namespace/argocd created
kubectl get namespace
NAME STATUS AGE
argocd Active 5s
default Active 3m19s
kube-node-lease Active 3m19s
kube-public Active 3m19s
kube-system Active 3m19s
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
customresourcedefinition.apiextensions.k8s.io/applications.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/applicationsets.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/appprojects.argoproj.io created
serviceaccount/argocd-application-controller created
serviceaccount/argocd-applicationset-controller created
serviceaccount/argocd-dex-server created
serviceaccount/argocd-notifications-controller created
serviceaccount/argocd-redis created
serviceaccount/argocd-repo-server created
serviceaccount/argocd-server created
role.rbac.authorization.k8s.io/argocd-application-controller created
role.rbac.authorization.k8s.io/argocd-applicationset-controller created
role.rbac.authorization.k8s.io/argocd-dex-server created
role.rbac.authorization.k8s.io/argocd-notifications-controller created
role.rbac.authorization.k8s.io/argocd-server created
clusterrole.rbac.authorization.k8s.io/argocd-application-controller created
clusterrole.rbac.authorization.k8s.io/argocd-applicationset-controller created
clusterrole.rbac.authorization.k8s.io/argocd-server created
rolebinding.rbac.authorization.k8s.io/argocd-application-controller created
rolebinding.rbac.authorization.k8s.io/argocd-applicationset-controller created
rolebinding.rbac.authorization.k8s.io/argocd-dex-server created
rolebinding.rbac.authorization.k8s.io/argocd-notifications-controller created
rolebinding.rbac.authorization.k8s.io/argocd-server created
clusterrolebinding.rbac.authorization.k8s.io/argocd-application-controller created
clusterrolebinding.rbac.authorization.k8s.io/argocd-applicationset-controller created
clusterrolebinding.rbac.authorization.k8s.io/argocd-server created
configmap/argocd-cm created
configmap/argocd-cmd-params-cm created
configmap/argocd-gpg-keys-cm created
configmap/argocd-notifications-cm created
configmap/argocd-rbac-cm created
configmap/argocd-ssh-known-hosts-cm created
configmap/argocd-tls-certs-cm created
secret/argocd-notifications-secret created
secret/argocd-secret created
service/argocd-applicationset-controller created
service/argocd-dex-server created
service/argocd-metrics created
service/argocd-notifications-controller-metrics created
service/argocd-redis created
service/argocd-repo-server created
service/argocd-server created
service/argocd-server-metrics created
deployment.apps/argocd-applicationset-controller created
deployment.apps/argocd-dex-server created
deployment.apps/argocd-notifications-controller created
deployment.apps/argocd-redis created
deployment.apps/argocd-repo-server created
deployment.apps/argocd-server created
statefulset.apps/argocd-application-controller created
networkpolicy.networking.k8s.io/argocd-application-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-applicationset-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-dex-server-network-policy created
networkpolicy.networking.k8s.io/argocd-notifications-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-redis-network-policy created
networkpolicy.networking.k8s.io/argocd-repo-server-network-policy created
networkpolicy.networking.k8s.io/argocd-server-network-policy created
kubectl get all -n argocd
NAME READY STATUS RESTARTS AGE
pod/argocd-application-controller-0 1/1 Running 0 3m10s
pod/argocd-applicationset-controller-5478c64d7c-9jj2j 1/1 Running 0 3m10s
pod/argocd-dex-server-6fcfc6f94d-k7zm4 1/1 Running 0 3m10s
pod/argocd-notifications-controller-5f6c747849-sr8f7 1/1 Running 0 3m10s
pod/argocd-redis-66d9777b78-fvg7d 1/1 Running 0 3m10s
pod/argocd-repo-server-5c7d64b8bf-bt7lp 1/1 Running 0 3m10s
pod/argocd-server-56f7986dff-9k274 1/1 Running 0 3m10s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/argocd-applicationset-controller ClusterIP 10.103.18.243 <none> 7000/TCP,8080/TCP 3m11s
service/argocd-dex-server ClusterIP 10.100.178.113 <none> 5556/TCP,5557/TCP,5558/TCP 3m11s
service/argocd-metrics ClusterIP 10.108.118.171 <none> 8082/TCP 3m11s
service/argocd-notifications-controller-metrics ClusterIP 10.99.70.179 <none> 9001/TCP 3m11s
service/argocd-redis ClusterIP 10.110.1.48 <none> 6379/TCP 3m11s
service/argocd-repo-server ClusterIP 10.110.203.147 <none> 8081/TCP,8084/TCP 3m11s
service/argocd-server ClusterIP 10.97.74.94 <none> 80/TCP,443/TCP 3m11s
service/argocd-server-metrics ClusterIP 10.109.119.47 <none> 8083/TCP 3m10s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/argocd-applicationset-controller 1/1 1 1 3m10s
deployment.apps/argocd-dex-server 1/1 1 1 3m10s
deployment.apps/argocd-notifications-controller 1/1 1 1 3m10s
deployment.apps/argocd-redis 1/1 1 1 3m10s
deployment.apps/argocd-repo-server 1/1 1 1 3m10s
deployment.apps/argocd-server 1/1 1 1 3m10s
NAME DESIRED CURRENT READY AGE
replicaset.apps/argocd-applicationset-controller-5478c64d7c 1 1 1 3m10s
replicaset.apps/argocd-dex-server-6fcfc6f94d 1 1 1 3m10s
replicaset.apps/argocd-notifications-controller-5f6c747849 1 1 1 3m10s
replicaset.apps/argocd-redis-66d9777b78 1 1 1 3m10s
replicaset.apps/argocd-repo-server-5c7d64b8bf 1 1 1 3m10s
replicaset.apps/argocd-server-56f7986dff 1 1 1 3m10s
NAME READY AGE
statefulset.apps/argocd-application-controller 1/1 3m10s
ArgoCD API ์๋ฒ ์ก์ธ์ค
๊ธฐ๋ณธ์ ์ผ๋ก ArgoCD API ์๋ฒ๋ ์ธ๋ถ IP๋ก ๋ ธ์ถ๋์ง ์์
argocd-server ์๋น์ค ์ ํ์ LoadBalancer ํ์ ์ผ๋ก ๋ฐ๊ฟ์ฃผ๊ธฐ
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
service Type์ด LoadBalancer๋ก ๋ฐ๋์์ง๋ง EXTERNAL-IP๋ Pending ์ํ
kubectl get svc -n argocd
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
argocd-applicationset-controller ClusterIP 10.103.18.243 <none> 7000/TCP,8080/TCP 5m33s
argocd-dex-server ClusterIP 10.100.178.113 <none> 5556/TCP,5557/TCP,5558/TCP 5m33s
argocd-metrics ClusterIP 10.108.118.171 <none> 8082/TCP 5m33s
argocd-notifications-controller-metrics ClusterIP 10.99.70.179 <none> 9001/TCP 5m33s
argocd-redis ClusterIP 10.110.1.48 <none> 6379/TCP 5m33s
argocd-repo-server ClusterIP 10.110.203.147 <none> 8081/TCP,8084/TCP 5m33s
argocd-server LoadBalancer 10.97.74.94 <pending> 80:31746/TCP,443:30945/TCP 5m33s
argocd-server-metrics ClusterIP 10.109.119.47 <none> 8083/TCP 5m32s
Minikube LoadBalancer ์ก์ธ์ค ํ๊ธฐ
์ ํฐ๋ฏธ๋ ์ด์ด์ ์๋ ๋ช ๋ น์ด ์ ๋ ฅ
minikube tunnel
pending -> 127.0.0.1
kubectl get svc -n argocd
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
argocd-applicationset-controller ClusterIP 10.103.18.243 <none> 7000/TCP,8080/TCP 7m25s
argocd-dex-server ClusterIP 10.100.178.113 <none> 5556/TCP,5557/TCP,5558/TCP 7m25s
argocd-metrics ClusterIP 10.108.118.171 <none> 8082/TCP 7m25s
argocd-notifications-controller-metrics ClusterIP 10.99.70.179 <none> 9001/TCP 7m25s
argocd-redis ClusterIP 10.110.1.48 <none> 6379/TCP 7m25s
argocd-repo-server ClusterIP 10.110.203.147 <none> 8081/TCP,8084/TCP 7m25s
argocd-server LoadBalancer 10.97.74.94 127.0.0.1 80:31746/TCP,443:30945/TCP 7m25s
argocd-server-metrics ClusterIP 10.109.119.47 <none> 8083/TCP
minikube service list
|-------------|-----------------------------------------|--------------|-----|
| NAMESPACE | NAME | TARGET PORT | URL |
|-------------|-----------------------------------------|--------------|-----|
| argocd | argocd-applicationset-controller | No node port | |
| argocd | argocd-dex-server | No node port | |
| argocd | argocd-metrics | No node port | |
| argocd | argocd-notifications-controller-metrics | No node port | |
| argocd | argocd-redis | No node port | |
| argocd | argocd-repo-server | No node port | |
| argocd | argocd-server | http/80 | |
| | | https/443 | |
| argocd | argocd-server-metrics | No node port | |
| default | kubernetes | No node port | |
| kube-system | kube-dns | No node port | |
|-------------|-----------------------------------------|--------------|-----|
minikube service argocd-server -n argocd
|-----------|---------------|-------------|---------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|---------------|-------------|---------------------------|
| argocd | argocd-server | http/80 | http://192.168.49.2:31746 |
| | | https/443 | http://192.168.49.2:30945 |
|-----------|---------------|-------------|---------------------------|
๐ argocd-server ์๋น์ค์ ํฐ๋์ ์์ํ๋ ์ค
|-----------|---------------|-------------|------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|---------------|-------------|------------------------|
| argocd | argocd-server | | http://127.0.0.1:60396 |
| | | | http://127.0.0.1:60397 |
|-----------|---------------|-------------|------------------------|
[argocd argocd-server http://127.0.0.1:60396
http://127.0.0.1:60397]
โ Because you are using a Docker driver on darwin, the terminal needs to be open to run it.
[argocd argocd-server http://127.0.0.1:60396
http://127.0.0.1:60397]
์๋ ค์ค ์ฃผ์๋ก ์น ๋ธ๋ผ์ฐ์ ์์ ์ ์ ( ๊ณ ๊ธ > ์์ ํ์ง ์์)
์ด๊ธฐ admin ๊ณ์ password ์กฐํ
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
tqQOvBy86mK486Kg
๋ก๊ทธ์ธ ํ๋ฉด
์ด๊ธฐ password ๋ณ๊ฒฝํ๊ธฐ
User Info > UPDATE PASSWORD
'Container > Kubernetes' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[k8s] minikube ํด๋ฌ์คํฐ ์ญ์ ๋ช ๋ น์ด (0) | 2024.05.23 |
---|---|
[k8s] Minikube์ node (worker) ์ถ๊ฐํ๊ธฐ (0) | 2024.03.05 |
[k8s] Minikube๋? ๋ช ๋ น์ด, (Addon)์ ๋์จ (2) | 2024.03.05 |
[k8s] Ubuntu 22.04์์ Kubernetes(์ฟ ๋ฒ๋คํฐ์ค) Cluster ๊ตฌ์ฑํ๊ธฐ (0) | 2024.02.28 |