16.2.5. GitOps ZTP를 사용하여 Lifecycle Agent를 사용하여 이미지 기반 업그레이드에 대한 ConfigMap 오브젝트 생성


이미지 기반 업그레이드를 준비하기 위해 ConfigMap 오브젝트로 래핑된 추가 매니페스트 및 사용자 정의 카탈로그 소스를 생성합니다.

업그레이드 후 OADP 리소스를 준비하여 애플리케이션을 복원합니다.

사전 요구 사항

  • GitOps ZTP를 사용하여 하나 이상의 관리 클러스터를 프로비저닝했습니다.
  • cluster-admin 권한이 있는 사용자로 로그인했습니다.
  • 호환되는 시드 클러스터에서 시드 이미지를 생성했습니다.
  • stateroots 간에 공유되는 컨테이너 이미지의 대상 클러스터에 별도의 파티션을 생성했습니다. 자세한 내용은 GitOps ZTP를 사용할 때 "ostree stateroots 간에 공유 컨테이너 파티션 구성"을 참조하십시오.
  • 시드 이미지와 함께 사용되는 버전과 호환되는 Lifecycle Agent 버전을 배포했습니다.
  • 대상 클러스터에 OADP Operator, DataProtectionApplication CR 및 해당 시크릿을 설치했습니다.
  • 적절한 인증 정보가 구성된 S3 호환 스토리지 솔루션 및 즉시 사용 가능한 버킷을 생성했습니다. 자세한 내용은 " GitOps ZTP를 사용하여 OADP Operator 설치 및 구성"을 참조하십시오.
  • OADP ConfigMap 오브젝트의 openshift-adp 네임스페이스는 모든 관리 클러스터에 있어야 하며 OADP ConfigMap 을 생성하고 클러스터에 복사하려면 허브가 있어야 합니다.

프로세스

  1. ArgoCD 정책 애플리케이션과 함께 사용하는 Git 리포지토리에 다음 디렉터리 구조가 포함되어 있는지 확인합니다.

    ├── source-crs/
    │   ├── ibu/
    │   │    ├── ImageBasedUpgrade.yaml
    │   │    ├── PlatformBackupRestore.yaml
    │   │    ├── PlatformBackupRestoreLvms.yaml
    │   │    ├── PlatformBackupRestoreWithIBGU.yaml
    ├── ...
    ├── kustomization.yaml

    source-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
    다중 클러스터Hub CR에 .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 값은 애플리케이션 Restore CR에 지정된 값보다 작아야 합니다.
  2. 업그레이드 후 애플리케이션을 복원해야 하는 경우 openshift-adp 네임스페이스에서 애플리케이션의 OADP BackupRestore CR을 생성합니다.

    1. 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 필드의 값은 플랫폼 Restore CR의 값보다 크고 애플리케이션 네임스페이스 범위 Restore CR의 값보다 작아야 합니다.
    2. 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& gt; : 애플리케이션에 대한 사용자 정의 리소스를 정의합니다.
      • persistentVolumes: 필수 필드입니다.
      • logicalvolumes.topolvm.io: 필수 필드입니다.
      • VolumeSnapshot Contents: LVM 스토리지 볼륨 스냅샷 을 사용하는 경우 선택 사항입니다.
      • restoreStatus.includedResources: 논리 볼륨을 복원하는 데 필요한 필드입니다.
      중요

      동일한 버전의 애플리케이션이 OpenShift Container Platform의 현재 릴리스와 대상 릴리스에서 작동해야 합니다.

  3. 다음 콘텐츠를 사용하여 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-adp 
    2
    
    generatorOptions:
      disableNameSuffixHash: true
    1
    BackupRestore CR을 사용하여 hub 클러스터에서 oadp-cm ConfigMap 오브젝트를 생성합니다.
    2
    네임스페이스는 모든 관리 클러스터에 있어야 하며 OADP ConfigMap 을 생성하고 클러스터에 복사하려면 허브가 있어야 합니다.
  4. Git 리포지토리로 변경 사항을 내보냅니다.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동