공부하기싫어
article thumbnail

목차

    이미 윈도우에 hyper-v가 활성화 되어있고 docker desktop 이 설치되어있는 상태이다.

    필자 os 는 window 11 pro

     

    Window에 Minikube 설치

    설치

    winget 사용 설치 :

    wizard 설치 :

    https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe

     

    실행

    minikube start

    이미지를 다운받고 컨테이너가 실행된다.

     

    테스트

    PS C:\Users\admin> kubectl cluster-info
    Kubernetes control plane is running at https://127.0.0.1:51984
    CoreDNS is running at https://127.0.0.1:51984/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
    
    To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
    PS C:\Users\admin>
    PS C:\Users\admin>
    PS C:\Users\admin> kubectl get node 
    NAME       STATUS   ROLES           AGE     VERSION
    minikube   Ready    control-plane   8m10s   v1.26.3
    PS C:\Users\admin>
    PS C:\Users\admin> kubectl get pods
    No resources found in default namespace.
    PS C:\Users\admin> 
    PS C:\Users\admin> kubectl get namespace
    NAME              STATUS   AGE
    default           Active   8m27s
    kube-node-lease   Active   8m29s
    kube-public       Active   8m29s
    kube-system       Active   8m29s
    PS C:\Users\admin>
    PS C:\Users\admin> kubectl get deployments
    No resources found in default namespace.
    PS C:\Users\admin> kubectl get services
    NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
    kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   10m
    PS C:\Users\admin>

     

    cluster 일시정지/재가동

    minikube pause
    minikube unpause

     

    cluster 정지/재시작

    minikube stop
    minikube restart

    minikube docker container 종료

    cluster와 kubectl 의 연결을 위해 사용된 ~/.kube/config 파일 내용도 모두 사라짐

    cluster 내 생성했던 리소스 정보들은 삭제되지 않음

    • 다시 minikube start 로 cluster 를 생성하면 기존 생성했던 리소스들은 동일하게 생성되어 구동됨

    minikube restart 로 재시작

     

     

    cluster 삭제

    minikube delete

    모든 정보와 리소스 삭제

    이후 minikube cluster 를 다시 시작한다면 완전한 초기상태로 시작됨

     

    Minikube dashboard 활성화

    addons - dashboard 활성화

    C:\Users\admin>minikube addons list
    |-----------------------------|----------|--------------|--------------------------------|
    |         ADDON NAME          | PROFILE  |    STATUS    |           MAINTAINER           |
    |-----------------------------|----------|--------------|--------------------------------|
    | ambassador                  | minikube | disabled     | 3rd party (Ambassador)         |
    | auto-pause                  | minikube | disabled     | Google                         |
    | cloud-spanner               | minikube | disabled     | Google                         |
    | csi-hostpath-driver         | minikube | disabled     | Kubernetes                     |
    | dashboard                   | minikube | disabled     | Kubernetes                     |
    | default-storageclass        | minikube | enabled ✅   | Kubernetes                     |
    | efk                         | minikube | disabled     | 3rd party (Elastic)            |
    | freshpod                    | minikube | disabled     | Google                         |
    | gcp-auth                    | minikube | disabled     | Google                         |
    | gvisor                      | minikube | disabled     | Google                         |
    | headlamp                    | minikube | disabled     | 3rd party (kinvolk.io)         |
    | helm-tiller                 | minikube | disabled     | 3rd party (Helm)               |
    | inaccel                     | minikube | disabled     | 3rd party (InAccel             |
    |                             |          |              | [info@inaccel.com])            |
    | ingress                     | minikube | disabled     | Kubernetes                     |
    | ingress-dns                 | minikube | disabled     | Google                         |
    | istio                       | minikube | disabled     | 3rd party (Istio)              |
    | istio-provisioner           | minikube | disabled     | 3rd party (Istio)              |
    | kong                        | minikube | disabled     | 3rd party (Kong HQ)            |
    | kubevirt                    | minikube | disabled     | 3rd party (KubeVirt)           |
    | logviewer                   | minikube | disabled     | 3rd party (unknown)            |
    | metallb                     | minikube | disabled     | 3rd party (MetalLB)            |
    | metrics-server              | minikube | disabled     | Kubernetes                     |
    | nvidia-driver-installer     | minikube | disabled     | Google                         |
    | nvidia-gpu-device-plugin    | minikube | disabled     | 3rd party (Nvidia)             |
    | olm                         | minikube | disabled     | 3rd party (Operator Framework) |
    | pod-security-policy         | minikube | disabled     | 3rd party (unknown)            |
    | portainer                   | minikube | disabled     | 3rd party (Portainer.io)       |
    | registry                    | minikube | disabled     | Google                         |
    | registry-aliases            | minikube | disabled     | 3rd party (unknown)            |
    | registry-creds              | minikube | disabled     | 3rd party (UPMC Enterprises)   |
    | storage-provisioner         | minikube | enabled ✅   | Google                         |
    | storage-provisioner-gluster | minikube | disabled     | 3rd party (Gluster)            |
    | volumesnapshots             | minikube | disabled     | Kubernetes                     |
    |-----------------------------|----------|--------------|--------------------------------|
    
    C:\Users\admin>

    비활성화 되어있다면 활성화시켜줌

     

    C:\Users\admin>minikube addons enable dashboard
    * dashboard 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 docker.io/kubernetesui/dashboard:v2.7.0
      - Using image docker.io/kubernetesui/metrics-scraper:v1.0.8
    * Some dashboard features require the metrics-server addon. To enable all features please run:
    
            minikube addons enable metrics-server
    
    
    * 'dashboard' 애드온이 활성화되었습니다
    
    C:\Users\admin>minikube addons list

     

    dashboard 접속

    minikube dashboard

    명령을 사용해 dashboard 활성화가 가능하지만 로컬호스트 ip 로 접근하기때문에 데이터는 확인이 안됨

    커맨드 라인 프록시

    kubectl proxy

    localhost:8001 로 접속

     

    참고

    https://velog.io/@gentledev10/install-minikube

     

    minikube 설치 및 사용

    minikube 를 설치하고 간단한 사용법을 알아보자

    velog.io

    https://kyeongseo.tistory.com/entry/minikube-dashboard-%ED%99%9C%EC%84%B1%ED%99%94-%EC%A0%91%EC%86%8D-%EB%B0%A9%EB%B2%95

     

    minikube dashboard 활성화, 접속 방법

    minikube의 대시보드를 활성화 시켜봄 일단 첫번째로 addons를 확인해봐야함 minikube addons list로 addons가 활성화 상태인 지 비활성화 상태인 지 확인할 수 있음 [ddadmin@edge .kube]$ minikube addons list |---------

    kyeongseo.tistory.com

     

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

    K3S - Flannel VXLAN  (0) 2024.03.10
    k3s  (0) 2023.06.05
    minikube 설치 (VM-linux)  (0) 2023.05.31
    minikube 설치 (linux-ubuntu)  (0) 2023.05.31