7.4. 기본 스토리지 클래스 변경

다음 프로세스를 사용하여 기본 스토리지 클래스를 변경합니다. 예를 들어 두 개의 스토리지 클래스(gp2standard)가 있으며 기본 스토리지 클래스를 gp2 에서 standard로 변경하려고 합니다.

  1. 스토리지 클래스를 나열합니다.

    $ oc get storageclass

    출력 예

    NAME                 TYPE
    gp2 (default)        kubernetes.io/aws-ebs 1
    standard             kubernetes.io/aws-ebs

    1
    (default)는 기본 스토리지 클래스를 나타냅니다.
  2. 기본 스토리지 클래스에 대해 storageclass.kubernetes.io/is-default-class 주석의 값을 false로 변경합니다.

    $ oc patch storageclass gp2 -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
  3. storageclass.kubernetes.io/is-default-class 주석을 true로 설정하여 다른 스토리지 클래스를 기본값으로 설정합니다.

    $ oc patch storageclass standard -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
  4. 변경 사항을 확인합니다.

    $ oc get storageclass

    출력 예

    NAME                 TYPE
    gp2                  kubernetes.io/aws-ebs
    standard (default)   kubernetes.io/aws-ebs