16.2.5. GitOps ZTP를 사용하여 Lifecycle Agent를 사용하여 이미지 기반 업그레이드에 대한 ConfigMap 오브젝트 생성
이미지 기반 업그레이드를 준비하기 위해 ConfigMap 오브젝트로 래핑된 추가 매니페스트 및 사용자 정의 카탈로그 소스를 생성합니다.
16.2.5.1. GitOps ZTP를 사용하여 이미지 기반 업그레이드에 대한 OADP 리소스 생성 링크 복사링크가 클립보드에 복사되었습니다!
업그레이드 후 OADP 리소스를 준비하여 애플리케이션을 복원합니다.
사전 요구 사항
- GitOps ZTP를 사용하여 하나 이상의 관리 클러스터를 프로비저닝했습니다.
-
cluster-admin권한이 있는 사용자로 로그인했습니다. - 호환되는 시드 클러스터에서 시드 이미지를 생성했습니다.
- stateroots 간에 공유되는 컨테이너 이미지의 대상 클러스터에 별도의 파티션을 생성했습니다. 자세한 내용은 GitOps ZTP를 사용할 때 "ostree stateroots 간에 공유 컨테이너 파티션 구성"을 참조하십시오.
- 시드 이미지와 함께 사용되는 버전과 호환되는 Lifecycle Agent 버전을 배포했습니다.
-
대상 클러스터에 OADP Operator,
DataProtectionApplicationCR 및 해당 시크릿을 설치했습니다. - 적절한 인증 정보가 구성된 S3 호환 스토리지 솔루션 및 즉시 사용 가능한 버킷을 생성했습니다. 자세한 내용은 " GitOps ZTP를 사용하여 OADP Operator 설치 및 구성"을 참조하십시오.
-
OADP
ConfigMap오브젝트의openshift-adp네임스페이스는 모든 관리 클러스터에 있어야 하며 OADPConfigMap을 생성하고 클러스터에 복사하려면 허브가 있어야 합니다.
프로세스
ArgoCD 정책 애플리케이션과 함께 사용하는 Git 리포지토리에 다음 디렉터리 구조가 포함되어 있는지 확인합니다.
├── source-crs/ │ ├── ibu/ │ │ ├── ImageBasedUpgrade.yaml │ │ ├── PlatformBackupRestore.yaml │ │ ├── PlatformBackupRestoreLvms.yaml │ │ ├── PlatformBackupRestoreWithIBGU.yaml ├── ... ├── kustomization.yamlsource-crs/ibu/PlatformBackupRestoreWithIBGU.yaml파일은 ZTP 컨테이너 이미지에 제공됩니다.PlatformBackupRestoreWithIBGU.yaml
apiVersion: velero.io/v1 kind: Backup metadata: name: acm-klusterlet annotations: lca.openshift.io/apply-label: "apps/v1/deployments/open-cluster-management-agent/klusterlet,v1/secrets/open-cluster-management-agent/bootstrap-hub-kubeconfig,rbac.authorization.k8s.io/v1/clusterroles/klusterlet,v1/serviceaccounts/open-cluster-management-agent/klusterlet,scheduling.k8s.io/v1/priorityclasses/klusterlet-critical,rbac.authorization.k8s.io/v1/clusterroles/open-cluster-management:klusterlet-work:ibu-role,rbac.authorization.k8s.io/v1/clusterroles/open-cluster-management:klusterlet-admin-aggregate-clusterrole,rbac.authorization.k8s.io/v1/clusterrolebindings/klusterlet,operator.open-cluster-management.io/v1/klusterlets/klusterlet,apiextensions.k8s.io/v1/customresourcedefinitions/klusterlets.operator.open-cluster-management.io,v1/secrets/open-cluster-management-agent/open-cluster-management-image-pull-credentials"1 labels: velero.io/storage-location: default namespace: openshift-adp spec: includedNamespaces: - open-cluster-management-agent includedClusterScopedResources: - klusterlets.operator.open-cluster-management.io - clusterroles.rbac.authorization.k8s.io - clusterrolebindings.rbac.authorization.k8s.io - priorityclasses.scheduling.k8s.io includedNamespaceScopedResources: - deployments - serviceaccounts - secrets excludedNamespaceScopedResources: [] --- apiVersion: velero.io/v1 kind: Restore metadata: name: acm-klusterlet namespace: openshift-adp labels: velero.io/storage-location: default annotations: lca.openshift.io/apply-wave: "1" spec: backupName: acm-klusterlet- 1
다중 클러스터HubCR에.spec.imagePullSecret이 정의되어 있지 않고 허브 클러스터의open-cluster-management-agent네임스페이스에 보안이 존재하지 않는 경우v1/secrets/open-cluster-management-agent/open-cluster-management-image-pull-credentials.
참고관리 클러스터에서 직접 이미지 기반 업그레이드를 수행하는 경우
PlatformBackupRestore.yaml파일을 사용합니다.LVM 스토리지를 사용하여 영구 볼륨을 생성하는 경우 ZTP 컨테이너 이미지에 제공된
source-crs/ibu/PlatformBackupRestoreLvms.yaml을 사용하여 LVM 스토리지 리소스를 백업할 수 있습니다.PlatformBackupRestoreLvms.yaml
apiVersion: velero.io/v1 kind: Backup metadata: labels: velero.io/storage-location: default name: lvmcluster namespace: openshift-adp spec: includedNamespaces: - openshift-storage includedNamespaceScopedResources: - lvmclusters - lvmvolumegroups - lvmvolumegroupnodestatuses --- apiVersion: velero.io/v1 kind: Restore metadata: name: lvmcluster namespace: openshift-adp labels: velero.io/storage-location: default annotations: lca.openshift.io/apply-wave: "2" spec: backupName: lvmcluster-
lca.openshift.io/apply-ECDSA 값은 애플리케이션RestoreCR에 지정된 값보다 작아야 합니다.
업그레이드 후 애플리케이션을 복원해야 하는 경우
openshift-adp네임스페이스에서 애플리케이션의 OADPBackup및RestoreCR을 생성합니다.openshift-adp네임스페이스에서 클러스터 범위 애플리케이션 아티팩트에 대한 OADP CR을 생성합니다.LSO 및 LVM 스토리지의 클러스터 범위 애플리케이션 아티팩트에 대한 OADP CR의 예
apiVersion: velero.io/v1 kind: Backup metadata: annotations: lca.openshift.io/apply-label: "apiextensions.k8s.io/v1/customresourcedefinitions/test.example.com,security.openshift.io/v1/securitycontextconstraints/test,rbac.authorization.k8s.io/v1/clusterroles/test-role,rbac.authorization.k8s.io/v1/clusterrolebindings/system:openshift:scc:test" name: backup-app-cluster-resources labels: velero.io/storage-location: default namespace: openshift-adp spec: includedClusterScopedResources: - customresourcedefinitions - securitycontextconstraints - clusterrolebindings - clusterroles excludedClusterScopedResources: - Namespace --- apiVersion: velero.io/v1 kind: Restore metadata: name: test-app-cluster-resources namespace: openshift-adp labels: velero.io/storage-location: default annotations: lca.openshift.io/apply-wave: "3" spec: backupName: backup-app-cluster-resources-
lca.openshift.io/apply-label필드의 예제 리소스 이름을 실제 리소스로 교체합니다. -
lca.openshift.io/apply-ECDHE 필드의 값은 플랫폼RestoreCR의 값보다 크고 애플리케이션 네임스페이스 범위RestoreCR의 값보다 작아야 합니다.
-
source-crs/custom-crs디렉터리의 네임스페이스 범위 애플리케이션 아티팩트에 대한 OADP CR을 생성합니다.LSO를 사용할 때 OADP CR의 네임스페이스 범위 애플리케이션 아티팩트의 예
apiVersion: velero.io/v1 kind: Backup metadata: labels: velero.io/storage-location: default name: backup-app namespace: openshift-adp spec: includedNamespaces: - test includedNamespaceScopedResources: - secrets - persistentvolumeclaims - deployments - statefulsets - configmaps - cronjobs - services - job - poddisruptionbudgets - <application_custom_resources> excludedClusterScopedResources: - persistentVolumes --- apiVersion: velero.io/v1 kind: Restore metadata: name: test-app namespace: openshift-adp labels: velero.io/storage-location: default annotations: lca.openshift.io/apply-wave: "4" spec: backupName: backup-app-
includedNamespaceScopedResources필드에서 애플리케이션에 대한 사용자 지정 리소스를 정의합니다.
LVM 스토리지를 사용할 때 OADP CR의 네임스페이스 범위 애플리케이션 아티팩트의 예
apiVersion: velero.io/v1 kind: Backup metadata: labels: velero.io/storage-location: default name: backup-app namespace: openshift-adp spec: includedNamespaces: - test includedNamespaceScopedResources: - secrets - persistentvolumeclaims - deployments - statefulsets - configmaps - cronjobs - services - job - poddisruptionbudgets - <application_custom_resources> includedClusterScopedResources: - persistentVolumes - logicalvolumes.topolvm.io - volumesnapshotcontents --- apiVersion: velero.io/v1 kind: Restore metadata: name: test-app namespace: openshift-adp labels: velero.io/storage-location: default annotations: lca.openshift.io/apply-wave: "4" spec: backupName: backup-app restorePVs: true restoreStatus: includedResources: - logicalvolumes다음과 같습니다.
-
<application_custom_resources> : 애플리케이션에 대한 사용자 정의 리소스를 정의합니다. -
persistentVolumes: 필수 필드입니다. -
logicalvolumes.topolvm.io: 필수 필드입니다. -
VolumeSnapshot
Contents: LVM 스토리지 볼륨 스냅샷을 사용하는 경우 선택 사항입니다. -
restoreStatus.includedResources: 논리 볼륨을 복원하는 데 필요한 필드입니다.
중요동일한 버전의 애플리케이션이 OpenShift Container Platform의 현재 릴리스와 대상 릴리스에서 작동해야 합니다.
-
다음 콘텐츠를 사용하여
kustomization.yaml을 생성합니다.apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization configMapGenerator:1 - files: - source-crs/ibu/PlatformBackupRestoreWithIBGU.yaml #- source-crs/custom-crs/ApplicationClusterScopedBackupRestore.yaml #- source-crs/custom-crs/ApplicationApplicationBackupRestoreLso.yaml name: oadp-cm namespace: openshift-adp2 generatorOptions: disableNameSuffixHash: true- Git 리포지토리로 변경 사항을 내보냅니다.