강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

romio1225님의 프로필 이미지
romio1225

작성한 질문수

대세는 쿠버네티스 (초급~중급편)

Volume - 실습

storageclassname: "" 안됨

작성

·

305

1

1. StorageOS를 설치하다가 중간에 잘 안되서 다 삭제하고 다시 하려는데, 네임스페이스 삭제가 terminating에서 멈추더라구요 그래서 네임스페이스 삭제가 멈춰 있는 것이 첫번째 문제고,

 

2. 그리고 storageOS 설치를 하는 과정에서 쿠버네티스상에서 설정이 들어간건지, volumeclaimtemplate 에서 strageclassname : "" 요렇게 입력 해도 pvc를 못찾더라구요. 

 

해결 방법 부탁드립니다. ㅠㅠ

퀴즈

Kubernetes에서 파드의 동적인 IP 변화에 상관없이 특정 파드로 직접 접근하기 위해 주로 사용하는 서비스 타입은 무엇일까요?

ClusterIP

Headless Service

NodePort

ExternalName

답변 3

1

romio1225님의 프로필 이미지
romio1225
질문자

감사합니다. 공식사이트 가이드대로 잘 설치 했습니다.

그래서 사용해 보려고, 스테이트풀셋에서

storageclassname='fast'를 하면

파드에서 'Back-off restarting failed container ' 에러가 뜹니다. 

그래서, storageclassnam=''로 하니까 되던데 이거는 스토리지 OS프로그램의 문제인가요 쿠버네티스의 문제인가요?

0

일프로님의 프로필 이미지
일프로
지식공유자

storageclassname=""을 했을때는 storageOS의 storageclass를 사용 안하게 됩니다.

아래 명령을 했을때 fast에 대한 storageclass가 조회되나요?

kubectl get storageclasses.storage.k8s.io
romio1225님의 프로필 이미지
romio1225
질문자

[root@k8s-worker09 ~]# kubectl get storageclasses.storage.k8s.io
NAME                      PROVISIONER                     RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
csi-cephfs-sc (default)   rook-ceph.cephfs.csi.ceph.com   Delete          Immediate           true                   251d
fast                      storageos                       Delete          Immediate           false                  39h
rook-ceph-block           rook-ceph.rbd.csi.ceph.com      Delete          Immediate           true                   251d

 

네넵 뜹니다. 위와 같습니다.

 

 

0

일프로님의 프로필 이미지
일프로
지식공유자

안녕하세요. 쿠버네티스 설치 버전이 어떻게 되시나요?

 

Terminating 해결 방법은 쿠버네티스 전형적인 문제라 구글링 해보시면 해결방법이 많이 나와 있습니다.

https://stackoverflow.com/questions/52369247/namespace-stuck-as-terminating-how-do-i-remove-it

Step 1: In one terminal run command bellow:

kubectl proxy

Step 2: Open another terminal then dump the descriptor as JSON to a file

kubectl get namespace YOURNAMESPACE -o json > logging.json

Open the file with a text editor:

{
    "apiVersion": "v1",
    "kind": "Namespace",
    "metadata": {
        "creationTimestamp": "2019-05-14T13:55:20Z",
        "labels": {
            "name": "logging"
        },
        "name": "logging",
        "resourceVersion": "29571918",
        "selfLink": "/api/v1/namespaces/logging",
        "uid": "e9516a8b-764f-11e9-9621-0a9c41ba9af6"
    },
    "spec": {
        "finalizers": [
            **"kubernetes"**
        ]
    },
    "status": {
        "phase": "Terminating"
    }
}

Remove content of finalizers array and leave it empty like example below:

    {
        "apiVersion": "v1",
        "kind": "Namespace",
        "metadata": {
            "creationTimestamp": "2019-05-14T13:55:20Z",
            "labels": {
                "name": "logging"
            },
            "name": "logging",
            "resourceVersion": "29571918",
            "selfLink": "/api/v1/namespaces/logging",
            "uid": "e9516a8b-764f-11e9-9621-0a9c41ba9af6"
        },
        "spec": {
            "finalizers": [
            ]
        },
        "status": {
            "phase": "Terminating"
        }
    }

Step 3: Executing the cleanup command to get rid of that annoying namespace:

curl -k -H "Content-Type: application/json" -X PUT --data-binary @logging.json http://127.0.0.1:8001/api/v1/namespaces/YOURNAMESPACE/finalize

 

romio1225님의 프로필 이미지
romio1225
질문자

쿠버네티스 버전은 아래와 같습니다.

[root@k8s-worker09 ~]# k version

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.6", GitCommit:"d32e40e20d167e103faf894261614c5b45c44198", GitTreeState:"clean", BuildDate:"2020-05-20T13:16:24Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.6", GitCommit:"d32e40e20d167e103faf894261614c5b45c44198", GitTreeState:"clean", BuildDate:"2020-05-20T13:08:34Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

일프로님의 프로필 이미지
일프로
지식공유자

플러그인들은 쿠버네티스 버전별로 설치 방법이 다르거든요.

그래서 제 설치영상을 참고로 아래 사이트에서 1.17 버전에 맞는 storageOS를 설치하시는게 좋습니다.

https://docs.storageos.com/docs/install/kubernetes/

 

romio1225님의 프로필 이미지
romio1225

작성한 질문수

질문하기