Knative serving GKE 부가기능 제거

관련 리소스 및 라벨을 포함하여 클러스터에서 Knative serving 'GKE 부가기능'을 제거합니다.

이 태스크에서는 클러스터에서 'GKE 부가기능'을 삭제하기 위한 목적으로만 마이그레이션 스크립트를 사용하고 기존 Knative serving 리소스는 모두 클러스터에 계속 남아서 트래픽을 계속 처리합니다.

시작하기 전에

개요

GKE 부가기능을 제거하려면 다음을 수행해야 합니다.

  1. 노드 풀이 업그레이드 요구사항을 충족하는지 검사합니다.
  2. Knative serving 리소스가 다음 네임스페이스에서 삭제되지 않도록 마이그레이션 라벨을 적용하고 허용 웹훅 ValidatingWebhookConfiguration을 만듭니다.
    • knative-serving
    • cloud-run-system
    • gke-system
  3. 'GKE 부가기능'을 제거하고 Knative serving 리소스에서 관련 관리자 라벨도 삭제합니다.

    이 프로세스는 실행하는 데 10분 이상 걸릴 수 있습니다.

  4. appdevexperience-operator 주석을 추가합니다.

  5. Fleet에 사용되지 않는 비활성 cloudrun.operator.run.cloud.google.com 리소스를 삭제합니다.

Knative serving GKE 부가기능 제거

이 섹션에서는 마이그레이션 스크립트를 사용하여 'GKE 부가기능'을 제거합니다.

  1. 다음 명령어를 실행하여 마이그레이션 스크립트를 시작합니다.

    ./migration-addon.sh --command uninstall-cloudrun-addon
    
  2. 터미널에서 마이그레이션 스크립트는 각 작업 수행을 확인하라는 메시지를 표시합니다. y를 입력하여 프로세스를 시작하고 각 프롬프트에서 작업을 계속 진행합니다.

    'GKE 부가기능' 제거 프로세스 중의 프롬프트는 다음과 유사합니다.

    In this process, the script performs the following:
    1. Validating the node pool to make sure it meets the requirements for
       upgrading. Confirming node pool requirements for
       my-gcp-project/us-central1-c/my-gke-cluster...
    2. Applying the required migration labels
       namespace/knative-serving labeled
    3. Create a ValidatingWebhookConfiguration admission webhook to prevent
       the deletion of resources under the following namespaces:
       knative-serving, cloud-run-system, and gke-system
    Continue? [Y/n] y
    
    validatingwebhookconfiguration.admissionregistration.k8s.io/prevent-deletion-cloud-run-resources created
    ValidatingWebhookConfiguration prevent-deletion-cloud-run-resources for preventing deleting Knative serving resources is effective.
    
    4. Uninstall the Knative serving GKE add-on? Your
    Knative serving resources remain in your cluster.
    Continue? [Y/n] y
    
    Updating my-gke-cluster...
    
    5. Removing the add-on manager labels and adding the Operator related
      annotations. This step will take about 10 minutes.
    
    customresourcedefinition.apiextensions.k8s.io/certificates.networking.internal.knative.dev annotated
    
    6. Clean up unused stale Knative serving operator.
    
    cloudrun.operator.run.cloud.google.com "cloud-run" deleted
    No resources found
    
    Knative serving GKE add-on is successfully uninstalled.
    
  3. 다음 명령어를 실행하여 'GKE 부가기능'이 disabled인지 확인합니다.

    gcloud container clusters describe ${CLUSTER_NAME} --region ${CLUSTER_LOCATION} --project ${PROJECT_ID} --format='get(addonsConfig.cloudRunConfig.disabled)'
    

    'GKE 부가기능'이 클러스터에서 성공적으로 삭제되었으면 True가 반환됩니다.

다음 단계

Anthos Service Mesh로 마이그레이션

롤백

위 단계를 통해 수행한 변경사항을 롤백해야 할 경우 마이그레이션 스크립트를 사용하여 다음을 수행할 수 있습니다.

  • Knative serving 'GKE 부가기능'을 다시 사용 설정합니다.
  • ValidatingWebhookConfiguration 허용 웹훅을 삭제합니다.

롤백 프로세스를 시작하려면 다음 안내를 따르세요.

  1. 다음 명령어를 실행하여 마이그레이션 스크립트를 시작합니다.

    ./migration-addon.sh --command rollback-uninstall-cloudrun-addon
    
  2. 터미널에서 마이그레이션 스크립트는 각 작업 수행을 확인하라는 메시지를 표시합니다. 각 프롬프트에서 y를 입력하여 작업을 계속합니다.

    'GKE 부가기능' 다시 사용 설정 프로세스 중의 프롬프트는 다음과 유사합니다.

    In this step, the script performs the following:
      1. Enable Knative serving GKE add-on
      2. Remove the ValidatingWebhookConfiguration added for uninstalling addon
    Continue? [Y/n] Y
    
    1. Enable Knative serving GKE add-on?
    Continue? [Y/n] Y
    
    Updating my-gke-cluster...done.
    Knative serving GKE add-on is enabled
    
    2. Remove the ValidatingWebhookConfiguration added for uninstalling addon?
    Continue? [Y/n] Y
    
    Removing the ValidatingWebhookConfiguration used to prevent deletion
    
  3. Knative serving 'GKE 부가기능'이 다시 사용 설정되었는지 확인합니다.

    gcloud container clusters describe ${CLUSTER_NAME} --region ${CLUSTER_LOCATION} --project ${PROJECT_ID} --format='get(addonsConfig.cloudRunConfig)'
    

    부가기능이 클러스터에서 실행되면 부가기능의 구성 세부정보가 반환됩니다. 예를 들면 다음과 같습니다.

    loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL