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-adpExample
OadpSubscriptionOperGroup.yamlfileapiVersion: 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디렉터리로 내보냅니다.DataProtectionApplication.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: false1 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: $bucketName2 prefix: $prefixName3 status: conditions: - reason: Complete status: "True" type: Reconciled- 1
- 영구 볼륨 콘텐츠가 업그레이드 후 유지되고 재사용되므로 이미지 기반 업그레이드에 대해
spec.configuration.restic.enable필드를false로 설정해야 합니다. - 2 3
- 버킷은 S3 백엔드에서 생성된 버킷 이름을 정의합니다. 접두사는 버킷에 자동으로 생성될 하위 디렉터리의 이름을 정의합니다. 버킷과 접두사의 조합은 대상 클러스터마다 고유해야 합니다. 각 대상 클러스터의 고유한 스토리지 디렉터리를 보장하기 위해 RHACM 허브 템플릿 기능(예:
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: namespace: openshift-adp annotations: ran.openshift.io/ztp-deploy-wave: "100" status: phase: AvailableOadpBackupStorageLocationStatus.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>1 - fileName: DataProtectionApplication.yaml policyName: "config-policy" spec: backupLocations: - velero: config: region: minio s3Url: <your_S3_URL>2 profile: "default" insecureSkipTLSVerify: "true" s3ForcePathStyle: "true" provider: aws default: true credential: key: cloud name: cloud-credentials objectStorage: bucket: <your_bucket_name>3 prefix: <cluster_name>4 - fileName: OadpBackupStorageLocationStatus.yaml policyName: "config-policy"