ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Jupyterhub for Kubernetes-2] JupyterHub 설치
    Backend/Kubernetes 2022. 3. 20. 16:46

    1. JupyterHub Chart 설치  

    helm 명령어와 Helm chart에서 repository를 찾아 jupyterhub chart를 설치할 수 있다.

    helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
    helm repo update

    다음과 같은 출력이 나온다. Happy Helming!

    Hang tight while we grab the latest from your chart repositories...
    ...Skip local chart repository
    ...Successfully got an update from the "stable" chart repository
    ...Successfully got an update from the "jupyterhub" chart repository
    Update Complete. ⎈ Happy Helming!⎈

     

    2. config.yaml이 포함된 디렉토리에서 다음 명령어를 실행하여 차트를 설치한다.

    helm upgrade --cleanup-on-fail \
      --install <helm-release-name> jupyterhub/jupyterhub \
      --namespace <k8s-namespace> \
      --create-namespace \
      --version=<chart-version> \
      --values config.yaml

    document에 설명이 되어있긴 하지만 각각 뭘 뜻하는 건지 정확히 몰라서 결국은 해보면서 찾았다.

    • helm-release-name : 원하는 release 이름
    • k8s-namespace : 원하는 namespace 명
    • chart-version : jupyterhub chart의 버전
      • 버전 확인
    helm search repo

     

    example>

    helm upgrade --cleanup-on-fail \
    --install celljupyter jupyterhub/jupyterhub \
    --namespace jhub \
    --create-namespace \
    --version=1.2.0 \
    --values config.yaml

     

    ERROR 1

    만약 다음과 같은 에러가 발생한다면 이는 default storage class가 2개이기 때문에 발생된 것이다.

    이는 두가지 해결방법이 있다.

    • default storage class 중 하나를 삭제
    • default로 되어있는 class 중 하나의 default 설정을 바꾸기

    첫번째 방식의 경우 다음의 명령어를 통해 default storage class중 하나를 삭제하여 해결할 수 있다.

    kubectl patch storageclass <your-class-name> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'

    이때 your-class-name은 삭제할 class명을 적어야하는데 다음의 명령어를 통해 존재하는 storage class를 확인할 수 있다.

    microk8s kubectl get storageclasses.storage.k8s.io

    두번째 방식의 경우 다음의 명령어를 통해 두가지 default storage class 중에서 하나의 default 설정을 false로 바꾼다.

    kubectl patch storageclass <your-storageclass-name> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'

    <your-storageclass-name>의 경우 본인이 원하는 storageclass명을 적으면 된다.

     

    나의 경우 두번째 방식을 택하여 microk8s-hostpath의 default 설정을 false로 바꾸었다.

     

    ERROR 2

    Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp 127.0.0.1:8080: connect: connection refused

     

    kubectl config view --raw > ~/.kube/config

     

    ERROR 3

    WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/miraebox/.kube/config
    WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/miraebox/.kube/config
    chmod 600 ~/.kube/config

     


    작성중....

     

     

     

     

     

    댓글

Designed by Tistory.