본문 바로가기

리눅스

[kubernetes] minikube addon 설치

728x90

minikube addon 설치

minikube addons 사용법

$ minikube --help
minikube provisions and manages local Kubernetes clusters optimized for development workflows.

Basic Commands:
  start            Starts a local Kubernetes cluster
  status           Gets the status of a local Kubernetes cluster
  stop             Stops a running local Kubernetes cluster
  delete           Deletes a local Kubernetes cluster
  dashboard        Access the Kubernetes dashboard running within the minikube cluster
  pause            pause Kubernetes
  unpause          unpause Kubernetes

Images Commands:
  docker-env       Provides instructions to point your terminal's docker-cli to the Docker Engine inside minikube.
(Useful for building docker images directly inside minikube)
  podman-env       Configure environment to use minikube's Podman service
  cache            Manage cache for images
  image            Manage images

Configuration and Management Commands:
  addons           Enable or disable a minikube addon
  config           Modify persistent configuration values
  profile          Get or list the current profiles (clusters)
  update-context   Update kubeconfig in case of an IP or port change

Networking and Connectivity Commands:
  service          Returns a URL to connect to a service
  tunnel           Connect to LoadBalancer services

Advanced Commands:
  mount            Mounts the specified directory into minikube
  ssh              Log into the minikube environment (for debugging)
  kubectl          Run a kubectl binary matching the cluster version
  node             Add, remove, or list additional nodes
  cp               Copy the specified file into minikube

Troubleshooting Commands:
  ssh-key          Retrieve the ssh identity key path of the specified node
  ssh-host         Retrieve the ssh host key of the specified node
  ip               Retrieves the IP address of the specified node
  logs             Returns logs to debug a local Kubernetes cluster
  update-check     Print current and latest version number
  version          Print the version of minikube
  options          Show a list of global command-line options (applies to all commands).

Other Commands:
  completion       Generate command completion for a shell

Use "minikube <command> --help" for more information about a given command.

addon 리스트

minikube addons list

아이피 확인

virsh net-list
$ virsh net-list
 Name          State    Autostart   Persistent
------------------------------------------------
 default       active   yes         yes
 mk-minikube   active   yes         yes
$ minikube ip
192.168.39.107
virsh net-dumpxml mk-minikube
$ virsh net-dumpxml mk-minikube
<network connections='1'>
  <name>mk-minikube</name>
  <uuid>f6a171dc-adc1-490f-942f-655401bc3a3b</uuid>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:8a:35:bc'/>
  <dns enable='no'/>
  <ip address='192.168.39.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.39.2' end='192.168.39.254'/>
    </dhcp>
  </ip>
</network>

metallb 설치(설정 필요 시 : minikube addons configure)

minikube addons configure metallb
$ minikube addons configure metallb
-- Enter Load Balancer Start IP: 192.168.39.200
-- Enter Load Balancer End IP: 192.168.39.209
    ▪ Using image docker.io/metallb/speaker:v0.9.6
    ▪ Using image docker.io/metallb/controller:v0.9.6
✅  metallb was successfully configured
minikube addons list

 

LoadBalancer 설치 전

$ kubectl get po,svc
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
service/kubernetes     ClusterIP      10.96.0.1       <none>        443/TCP        31m
service/myapp-svc-lb   LoadBalancer   10.108.94.179   <pending>     80:31125/TCP   97s

LoadBalancer 설치 후

$ kubectl get svc -o wide
NAME           TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE   SELECTOR
example        ExternalName   <none>          example.com      <none>         12m   <none>
kubernetes     ClusterIP      10.96.0.1       <none>           443/TCP        65m   <none>
myapp-svc-lb   LoadBalancer   10.108.94.179   192.168.39.200   80:31125/TCP   36m   app=myapp-rs
myapp-svc-np   NodePort       10.96.93.168    <none>           80:31111/TCP   12m   app=myapp-rs

ingress 설치

minikube addons enable ingress
$ minikube addons enable ingress
💡  ingress is an addon maintained by Kubernetes. For any concerns contact minikube on GitHub.
You can view the list of minikube maintainers at: https://github.com/kubernetes/minikube/blob/master/OWNERS
    ▪ Using image k8s.gcr.io/ingress-nginx/controller:v1.2.1
    ▪ Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1
    ▪ Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1
🔎  Verifying ingress addon...
🌟  The 'ingress' addon is enabled
minikube addons list

metrics-server 설치

minikube addons enable metrics-server
$ minikube addons enable metrics-server
💡  metrics-server is an addon maintained by Kubernetes. For any concerns contact minikube on GitHub.
You can view the list of minikube maintainers at: https://github.com/kubernetes/minikube/blob/master/OWNERS
    ▪ Using image k8s.gcr.io/metrics-server/metrics-server:v0.6.1
🌟  The 'metrics-server' addon is enabled
kubectl get deployment metrics-server -n kube-system
$ kubectl get deployment metrics-server -n kube-system
NAME             READY   UP-TO-DATE   AVAILABLE   AGE
metrics-server   1/1     1            1           33m
kubectl top nodes
$ kubectl top nodes
NAME       CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
minikube   1001m        25%    2539Mi          64%
728x90

'리눅스' 카테고리의 다른 글

[kubernetes] kubectl exec 명령  (0) 2022.09.22
[kubernetes] kubectl delete 명령  (0) 2022.09.22
[kubernetes] kubectl run 명령  (0) 2022.09.21
[kubernetes] kubectl explain 명령  (0) 2022.09.21
[kubernetes] kubectl get events 명령  (0) 2022.09.21