15.2.2.4. GitOps ZTP를 사용하여 OADP Operator 설치 및 구성
업그레이드를 시작하기 전에 GitOps ZTP로 OADP Operator를 설치하고 구성합니다.
프로세스
ztp-site-generate컨테이너 이미지에서 다음 CR을 추출하여source-cr디렉토리에 푸시합니다.OadpSubscriptionNS.yaml파일의 예:apiVersion: v1 kind: Namespace metadata: name: openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "2" labels: kubernetes.io/metadata.name: openshift-adpOadpSubscriptionOperGroup.yaml파일의 예:apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: redhat-oadp-operator namespace: openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "2" spec: targetNamespaces: - openshift-adpOadpSubscription.yaml파일의 예:apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: redhat-oadp-operator namespace: openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "2" spec: channel: stable-1.4 name: redhat-oadp-operator source: redhat-operators sourceNamespace: openshift-marketplace installPlanApproval: Manual status: state: AtLatestKnownOadpOperatorStatus.yaml파일의 예:apiVersion: operators.coreos.com/v1 kind: Operator metadata: name: redhat-oadp-operator.openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "2" status: components: refs: - kind: Subscription namespace: openshift-adp conditions: - type: CatalogSourcesUnhealthy status: "False" - kind: InstallPlan namespace: openshift-adp conditions: - type: Installed status: "True" - kind: ClusterServiceVersion namespace: openshift-adp conditions: - type: Succeeded status: "True" reason: InstallSucceeded디렉터리 구조의 예:
├── kustomization.yaml ├── sno │ ├── example-cnf.yaml │ ├── common-ranGen.yaml │ ├── group-du-sno-ranGen.yaml │ ├── group-du-sno-validator-ranGen.yaml │ └── ns.yaml ├── source-crs │ ├── OadpSubscriptionNS.yaml │ ├── OadpSubscriptionOperGroup.yaml │ ├── OadpSubscription.yaml │ ├── OadpOperatorStatus.yaml공통
PolicyGenTemplate에 CR을 추가합니다.apiVersion: ran.openshift.io/v1 kind: PolicyGenTemplate metadata: name: "example-common-latest" namespace: "ztp-common" spec: bindingRules: common: "true" du-profile: "latest" sourceFiles: - fileName: OadpSubscriptionNS.yaml policyName: "subscriptions-policy" - fileName: OadpSubscriptionOperGroup.yaml policyName: "subscriptions-policy" - fileName: OadpSubscription.yaml policyName: "subscriptions-policy" - fileName: OadpOperatorStatus.yaml policyName: "subscriptions-policy" [...]대상 클러스터에 대해서만
DataProtectionApplicationCR과 S3 비밀을 생성합니다.ztp-site-generate컨테이너 이미지에서 다음 CR을 추출하여source-cr디렉토리에 푸시합니다.OadpDataProtectionApplication.yaml파일의 예:apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication metadata: name: dataprotectionapplication namespace: openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "100" spec: configuration: restic: enable: false velero: defaultPlugins: - aws - openshift resourceTimeout: 10m backupLocations: - velero: config: profile: "default" region: minio s3Url: $url insecureSkipTLSVerify: "true" s3ForcePathStyle: "true" provider: aws default: true credential: key: cloud name: cloud-credentials objectStorage: bucket: $bucketName prefix: $prefixName status: conditions: - reason: Complete status: "True" type: Reconciled-
영구 볼륨 콘텐츠가 업그레이드 후 유지되고 재사용되므로 이미지 기반 업그레이드에 대해
spec.configuration.restic.enable을false로 설정해야 합니다. -
버킷은 S3 백엔드에서 생성된 버킷 이름을 정의합니다.prefix는 버킷에 자동으로 생성될 하위 디렉터리의 이름을 정의합니다. 버킷과 접두사의 조합은 각 대상 클러스터마다 고유해야 서로 간섭을 피할 수 있습니다. 각 대상 클러스터의 고유한 스토리지 디렉터리를 보장하기 위해 Red Hat Advanced Cluster Management Hub 템플릿 기능(예:prefix: {{hub .ManagedClusterName hub}})을 사용할 수 있습니다.
OadpSecret.yaml파일의 예:apiVersion: v1 kind: Secret metadata: name: cloud-credentials namespace: openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "100" type: OpaqueOadpBackupStorageLocationStatus.yaml파일의 예:apiVersion: velero.io/v1 kind: BackupStorageLocation metadata: name: dataprotectionapplication-1 namespace: openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "100" status: phase: AvailableBackupStorageLocation리소스의name값은 해당DataProtectionApplication리소스와 일치하는 특정 이름 지정 규칙을 따라야 합니다.-
이름은 <
DataProtectionApplication.metadata.name>-<index> 패턴을사용해야 합니다. -
&
lt;index>는DataProtectionApplication리소스의spec.backupLocations필드에 있는 해당 항목의 위치를 나타냅니다. 위치는1에서 시작합니다. -
OadpDataProtectionApplication.yaml파일에서DataProtectionApplication리소스의metadata.name값을 변경하는 경우BackupStorageLocation리소스의metadata.name필드도 새 값과 일치하도록 업데이트해야 합니다.
OadpBackupStorageLocationStatus.yamlCR은 OADP에서 생성한 백업 스토리지 위치의 가용성을 확인합니다.-
영구 볼륨 콘텐츠가 업그레이드 후 유지되고 재사용되므로 이미지 기반 업그레이드에 대해
사이트
PolicyGenTemplate에 CR을 재정의하여 추가합니다.apiVersion: ran.openshift.io/v1 kind: PolicyGenTemplate metadata: name: "example-cnf" namespace: "ztp-site" spec: bindingRules: sites: "example-cnf" du-profile: "latest" mcp: "master" sourceFiles: ... - fileName: OadpSecret.yaml policyName: "config-policy" data: cloud: <your_credentials> - fileName: OadpDataProtectionApplication.yaml policyName: "config-policy" spec: backupLocations: - velero: config: region: minio s3Url: <your_S3_URL> profile: "default" insecureSkipTLSVerify: "true" s3ForcePathStyle: "true" provider: aws default: true credential: key: cloud name: cloud-credentials objectStorage: bucket: <your_bucket_name> prefix: <cluster_name> - fileName: OadpBackupStorageLocationStatus.yaml policyName: "config-policy"
다음과 같습니다.
your_credentials- S3 스토리지 백엔드에 대한 인증 정보를 지정합니다.
OadpDataProtectionApplication.yaml-
OadpDataProtectionApplicationCR에 두 개 이상의backupLocations항목이 정의된 경우 상태 추적을 위해 각 위치에 해당OadpBackupStorageLocationCR이 추가되어 있는지 확인하세요. 예제OadpBackupStorageLocationStatus.yaml파일에 설명된 대로 각 추가OadpBackupStorageLocationCR의 이름이 올바른 인덱스로 재정의되었는지 확인하세요. your_S3_URL- S3 호환 버킷의 URL을 지정합니다.
버킷및접두사-
버킷은S3 백엔드에서 생성되는 버킷 이름을 정의합니다.접두사는버킷에 자동으로 생성되는 하위 디렉토리의 이름을 정의합니다.버킷과접두사의 조합은 각 대상 클러스터마다 고유해야 서로 간섭을 피할 수 있습니다. 각 대상 클러스터에 고유한 저장 디렉토리를 보장하려면 Red Hat Advanced Cluster Management 허브 템플릿 함수를 사용할 수 있습니다(예:접두사: {{hub .ManagedClusterName hub}}).