검색

4.5. SiteConfig 및 GitOps ZTP를 사용하여 관리형 클러스터 배포

download PDF

다음 절차에 따라 SiteConfig CR(사용자 정의 리소스) 및 관련 파일을 생성하고 ZTP( GitOps Zero Touch Provisioning) 클러스터 배포를 시작합니다.

사전 요구 사항

  • OpenShift CLI(oc)가 설치되어 있습니다.
  • cluster-admin 권한이 있는 사용자로 hub 클러스터에 로그인했습니다.
  • 필요한 설치 및 정책 CR을 생성하도록 허브 클러스터를 구성했습니다.
  • 사용자 지정 사이트 구성 데이터를 관리하는 Git 리포지토리를 생성하셨습니다. 리포지토리는 hub 클러스터에서 액세스할 수 있어야 하며 ArgoCD 애플리케이션의 소스 리포지토리로 구성해야 합니다. 자세한 내용은 " GitOps ZTP 사이트 구성 리포지토리 준비"를 참조하십시오.

    참고

    소스 리포지토리를 생성할 때 ztp-site-generate 컨테이너에서 추출한 argocd/deployment/argocd-openshift-gitops-patch.json patch-file을 사용하여 ArgoCD 애플리케이션을 패치하는지 확인합니다. " ArgoCD를 사용하여 허브 클러스터 구성"을 참조하십시오.

  • 관리 클러스터 프로비저닝을 준비하려면 각 베어 메탈 호스트에 대해 다음이 필요합니다.

    네트워크 연결
    네트워크에는 DNS가 필요합니다. 허브 클러스터에서 관리 클러스터 호스트에 연결할 수 있어야 합니다. hub 클러스터와 관리 클러스터 호스트 간에 계층 3 연결이 있는지 확인합니다.
    BMC(Baseboard Management Controller) 세부 정보
    GitOps ZTP는 BMC 사용자 이름과 암호 세부 정보를 사용하여 클러스터 설치 중에 BMC에 연결합니다. GitOps ZTP 플러그인은 사이트 Git 리포지토리의 site Config CR을 기반으로 Hub 클러스터에서 ManagedCluster CR을 관리합니다. 각 호스트에 대해 수동으로 개별 BMCSecret CR을 생성합니다.

    프로세스

    1. hub 클러스터에 필요한 관리 클러스터 시크릿을 생성합니다. 이러한 리소스는 클러스터 이름과 일치하는 이름이 있는 네임스페이스에 있어야 합니다. 예를 들어 out/argocd/example/siteconfig/example-sno.yaml 에서 클러스터 이름과 네임스페이스는 example-sno 입니다.

      1. 다음 명령을 실행하여 클러스터 네임스페이스를 내보냅니다.

        $ export CLUSTERNS=example-sno
      2. 네임스페이스를 생성합니다.

        $ oc create namespace $CLUSTERNS
    2. 관리 클러스터에 대한 풀 시크릿 및 BMC Secret CR을 생성합니다. 풀 시크릿에는 OpenShift Container Platform 및 필요한 모든 Operator를 설치하는 데 필요한 모든 인증 정보가 포함되어야 합니다. 자세한 내용은 "관리된 베어 메탈 호스트 시크릿 생성"을 참조하십시오.

      참고

      보안은 site Config CR(사용자 정의 리소스)에서 이름으로 참조됩니다. 네임스페이스는 site Config 네임스페이스와 일치해야 합니다.

    3. Git 리포지토리의 로컬 복제본에 클러스터의 site Config CR을 생성합니다.

      1. out/argocd/example/siteconfig/ 폴더에서 CR에 적합한 예제를 선택합니다. 폴더에는 단일 노드, 3-노드 및 표준 클러스터에 대한 예제 파일이 포함되어 있습니다.

        • example-sno.yaml
        • 예:-3node.yaml
        • example-standard.yaml
      2. 예제 파일의 클러스터 및 호스트 세부 정보를 원하는 클러스터 유형과 일치하도록 변경합니다. 예를 들면 다음과 같습니다.

        단일 노드 OpenShift SiteConfig CR의 예

        # example-node1-bmh-secret & assisted-deployment-pull-secret need to be created under same namespace example-sno
        ---
        apiVersion: ran.openshift.io/v1
        kind: SiteConfig
        metadata:
          name: "example-sno"
          namespace: "example-sno"
        spec:
          baseDomain: "example.com"
          pullSecretRef:
            name: "assisted-deployment-pull-secret"
          clusterImageSetNameRef: "openshift-4.10"
          sshPublicKey: "ssh-rsa AAAA..."
          clusters:
          - clusterName: "example-sno"
            networkType: "OVNKubernetes"
            # installConfigOverrides is a generic way of passing install-config
            # parameters through the siteConfig.  The 'capabilities' field configures
            # the composable openshift feature.  In this 'capabilities' setting, we
            # remove all but the marketplace component from the optional set of
            # components.
            # Notes:
            # - OperatorLifecycleManager is needed for 4.15 and later
            # - NodeTuning is needed for 4.13 and later, not for 4.12 and earlier
            installConfigOverrides: |
              {
                "capabilities": {
                  "baselineCapabilitySet": "None",
                  "additionalEnabledCapabilities": [
                    "NodeTuning",
                    "OperatorLifecycleManager"
                  ]
                }
              }
            # It is strongly recommended to include crun manifests as part of the additional install-time manifests for 4.13+.
            # The crun manifests can be obtained from source-crs/optional-extra-manifest/ and added to the git repo ie.sno-extra-manifest.
            # extraManifestPath: sno-extra-manifest
            clusterLabels:
              # These example cluster labels correspond to the bindingRules in the PolicyGenTemplate examples
              du-profile: "latest"
              # These example cluster labels correspond to the bindingRules in the PolicyGenTemplate examples in ../policygentemplates:
              # ../policygentemplates/common-ranGen.yaml will apply to all clusters with 'common: true'
              common: true
              # ../policygentemplates/group-du-sno-ranGen.yaml will apply to all clusters with 'group-du-sno: ""'
              group-du-sno: ""
              # ../policygentemplates/example-sno-site.yaml will apply to all clusters with 'sites: "example-sno"'
              # Normally this should match or contain the cluster name so it only applies to a single cluster
              sites : "example-sno"
            clusterNetwork:
              - cidr: 1001:1::/48
                hostPrefix: 64
            machineNetwork:
              - cidr: 1111:2222:3333:4444::/64
            serviceNetwork:
              - 1001:2::/112
            additionalNTPSources:
              - 1111:2222:3333:4444::2
            # Initiates the cluster for workload partitioning. Setting specific reserved/isolated CPUSets is done via PolicyTemplate
            # please see Workload Partitioning Feature for a complete guide.
            cpuPartitioningMode: AllNodes
            # Optionally; This can be used to override the KlusterletAddonConfig that is created for this cluster:
            #crTemplates:
            #  KlusterletAddonConfig: "KlusterletAddonConfigOverride.yaml"
            nodes:
              - hostName: "example-node1.example.com"
                role: "master"
                # Optionally; This can be used to configure desired BIOS setting on a host:
                #biosConfigRef:
                #  filePath: "example-hw.profile"
                bmcAddress: "idrac-virtualmedia+https://[1111:2222:3333:4444::bbbb:1]/redfish/v1/Systems/System.Embedded.1"
                bmcCredentialsName:
                  name: "example-node1-bmh-secret"
                bootMACAddress: "AA:BB:CC:DD:EE:11"
                # Use UEFISecureBoot to enable secure boot
                bootMode: "UEFI"
                rootDeviceHints:
                  deviceName: "/dev/disk/by-path/pci-0000:01:00.0-scsi-0:2:0:0"
                # disk partition at `/var/lib/containers` with ignitionConfigOverride. Some values must be updated. See DiskPartitionContainer.md for more details
                ignitionConfigOverride: |
                   {
                    "ignition": {
                      "version": "3.2.0"
                    },
                    "storage": {
                      "disks": [
                        {
                          "device": "/dev/disk/by-path/pci-0000:01:00.0-scsi-0:2:0:0",
                          "partitions": [
                            {
                             "label": "var-lib-containers",
                             "sizeMiB": 0,
                             "startMiB": 250000
                          }
                      ],
                      "wipeTable": false
                     }
                   ],
                    "filesystems": [
                      {
                       "device": "/dev/disk/by-partlabel/var-lib-containers",
                       "format": "xfs",
                       "mountOptions": [
                         "defaults",
                         "prjquota"
                        ],
                        "path": "/var/lib/containers",
                        "wipeFilesystem": true
                       }
                     ]
                   },
                   "systemd": {
                     "units": [
                       {
                        "contents": "# Generated by Butane\n[Unit]\nRequires=systemd-fsck@dev-disk-by\\x2dpartlabel-var\\x2dlib\\x2dcontainers.service\nAfter=systemd-fsck@dev-disk-by\\x2dpartlabel-var\\x2dlib\\x2dcontainers.service\n\n[Mount]\nWhere=/var/lib/containers\nWhat=/dev/disk/by-partlabel/var-lib-containers\nType=xfs\nOptions=defaults,prjquota\n\n[Install]\nRequiredBy=local-fs.target",
                        "enabled": true,
                        "name": "var-lib-containers.mount"
                       }
                      ]
                    }
                   }
                nodeNetwork:
                  interfaces:
                    - name: eno1
                      macAddress: "AA:BB:CC:DD:EE:11"
                  config:
                    interfaces:
                      - name: eno1
                        type: ethernet
                        state: up
                        ipv4:
                          enabled: false
                        ipv6:
                          enabled: true
                          address:
                          # For SNO sites with static IP addresses, the node-specific,
                          # API and Ingress IPs should all be the same and configured on
                          # the interface
                          - ip: 1111:2222:3333:4444::aaaa:1
                            prefix-length: 64
                    dns-resolver:
                      config:
                        search:
                        - example.com
                        server:
                        - 1111:2222:3333:4444::2
                    routes:
                      config:
                      - destination: ::/0
                        next-hop-interface: eno1
                        next-hop-address: 1111:2222:3333:4444::1
                        table-id: 254

        참고

        BMC 주소 지정에 대한 자세한 내용은 "추가 리소스" 섹션을 참조하십시오. installConfigOverridesignitionConfigOverride 필드는 쉽게 읽을 수 있도록 확장됩니다.

      3. 외부/argocd/extra-manifest에서 기본 extra-manifest MachineConfig CR 세트를 검사할 수 있습니다. 설치 시 클러스터에 자동으로 적용됩니다.
      4. 선택 사항: 프로비저닝된 클러스터에서 추가 설치 시간 매니페스트를 프로비저닝하려면 Git 리포지토리에 디렉터리를 생성하고 (예: sno-extra-manifest/ ) 사용자 정의 매니페스트 CR을 이 디렉터리에 추가합니다. SiteConfig.yamlextraManifestPath 필드의 이 디렉터리를 참조하는 경우 이 참조 디렉터리의 모든 CR이 기본 추가 매니페스트 세트에 추가됩니다.

        crun OCI 컨테이너 런타임 활성화

        최적의 클러스터 성능을 위해서는 단일 노드 OpenShift에서 마스터 및 작업자 노드에 대해 crun, 추가 작업자 노드가 있는 단일 노드 OpenShift, 3-노드 OpenShift 및 표준 클러스터를 활성화합니다.

        클러스터를 재부팅하지 않도록 ContainerRuntimeConfig CR에서 0일 추가 설치 시간 매니페스트로 crun을 활성화합니다.

        enable-crun-master.yamlenable-crun-worker.yaml CR 파일은 ztp-site-generate 컨테이너에서 추출할 수 있는 out/source-crs/optional-extra-manifest/ 폴더에 있습니다. 자세한 내용은 " GitOps ZTP 파이프라인의 추가 설치 매니페스트 사용자 지정"을 참조하십시오.

    4. out/argocd/example/siteconfig/ kustomization.yaml 과 유사하게 generators 섹션의 kustomization.yaml 파일에 SiteConfig CR을 추가합니다.
    5. Git 리포지토리에서 SiteConfig CR 및 관련 kustomization.yaml 변경 사항을 커밋하고 변경 사항을 내보냅니다.

      ArgoCD 파이프라인은 변경 사항을 감지하고 관리 클러스터 배포를 시작합니다.

검증

  • 노드가 배포된 후 사용자 정의 역할 및 라벨이 적용되는지 확인합니다.

    $ oc describe node example-node.example.com

출력 예

Name:   example-node.example.com
Roles:  control-plane,example-label,master,worker
Labels: beta.kubernetes.io/arch=amd64
        beta.kubernetes.io/os=linux
        custom-label/parameter1=true
        kubernetes.io/arch=amd64
        kubernetes.io/hostname=cnfdf03.telco5gran.eng.rdu2.redhat.com
        kubernetes.io/os=linux
        node-role.kubernetes.io/control-plane=
        node-role.kubernetes.io/example-label= 1
        node-role.kubernetes.io/master=
        node-role.kubernetes.io/worker=
        node.openshift.io/os_id=rhcos

1
사용자 정의 레이블이 노드에 적용됩니다.

4.5.1. 단일 노드 OpenShift SiteConfig CR 설치 참조

표 4.1. 단일 노드 OpenShift 클러스터에 대한 SiteConfig CR 설치 옵션
siteConfig CR 필드설명

spec.cpuPartitioningMode

cpu CryostatingMode 값을 AllNodes 로 설정하여 워크로드 파티셔닝을 구성합니다. 구성을 완료하려면 PerformanceProfile CR에서 분리된 CPU와 예약된 CPU를 지정합니다.

참고

SiteConfig CR에서 cpu CryostatingMode 필드를 사용하여 워크로드 파티셔닝을 구성하는 것은 OpenShift Container Platform 4.13의 기술 프리뷰 기능입니다.

metadata.name

nameassisted-deployment-pull-secret 으로 설정하고 site Config CR과 동일한 네임스페이스에 assisted-deployment-pull-secret CR 을 생성합니다.

spec.clusterImageSetNameRef

사이트의 모든 클러스터에 대해 hub 클러스터에서 사용 가능한 이미지 세트를 구성합니다. hub 클러스터에서 지원되는 버전 목록을 보려면 oc get clusterimagesets 를 실행합니다.

installConfigOverrides

클러스터 설치 전에 선택적 구성 요소를 활성화하거나 비활성화하려면 installConfigOverrides 필드를 설정합니다.

중요

예제 SiteConfig CR에 지정된 대로 참조 구성을 사용합니다. 시스템에 추가 구성 요소를 추가하려면 추가로 예약된 CPU 용량이 필요할 수 있습니다.

spec.clusters.clusterImageSetNameRef

개별 클러스터를 배포하는 데 사용되는 클러스터 이미지 세트를 지정합니다. 정의된 경우 사이트 수준에서 spec.clusterImageSetNameRef 를 덮어씁니다.

spec.clusters.clusterLabels

사용자가 정의한 PolicyGenTemplate CR의 bindingRules 필드에 해당하도록 클러스터 레이블을 구성합니다. 예를 들어 policygentemplates/common-ranGen.yamlcommon: true 가 설정된 모든 클러스터에 적용됩니다. policygentemplates/group-du-sno-ranGen.yamlgroup-du-sno: "" 가 설정된 모든 클러스터에 적용됩니다.

spec.clusters.crTemplates.KlusterletAddonConfig

선택 사항: KlusterletAddonConfigKlusterletAddonConfig로 설정하여 클러스터에 생성된 기본 'KlusterletAddonConfig를 재정의합니다.

spec.clusters.nodes.hostName

단일 노드 배포의 경우 단일 호스트를 정의합니다. 3-노드 배포의 경우 세 개의 호스트를 정의합니다. 표준 배포의 경우 역할이 있는 세 개의 호스트( master 및 role: worker )로 정의된 두 개 이상의 호스트를 정의합니다.

spec.clusters.nodes.nodeLabels

관리 클러스터에서 노드의 사용자 지정 역할을 지정합니다. 추가 역할은 사용자만 OpenShift Container Platform 구성 요소에서 사용하지 않습니다. 사용자 지정 역할을 추가하면 해당 역할의 특정 구성을 참조하는 사용자 지정 머신 구성 풀과 연결할 수 있습니다. 설치 중에 사용자 정의 레이블 또는 역할을 추가하면 배포 프로세스가 더 효과적이며 설치가 완료된 후 추가 재부팅이 필요하지 않습니다.

spec.clusters.nodes.automatedCleaningMode

선택 사항: 디스크를 완전히 삭제하지 않고 값의 주석을 metadata 로 설정하여 디스크 파티션 테이블만 제거할 수 있습니다. 기본값은 disabled 입니다.

spec.clusters.nodes.bmcAddress

호스트에 액세스하는 데 사용하는 BMC 주소입니다. 모든 클러스터 유형에 적용됩니다. GitOps ZTP는 Redfish 또는 IPMI 프로토콜을 사용하여 iPXE 및 가상 미디어 부팅을 지원합니다. iPXE 부팅을 사용하려면 RHACM 2.8 이상을 사용해야 합니다. BMC 주소 지정에 대한 자세한 내용은 "추가 리소스" 섹션을 참조하십시오.

spec.clusters.nodes.bmcAddress

호스트에 액세스하는 데 사용하는 BMC 주소입니다. 모든 클러스터 유형에 적용됩니다. GitOps ZTP는 Redfish 또는 IPMI 프로토콜을 사용하여 iPXE 및 가상 미디어 부팅을 지원합니다. iPXE 부팅을 사용하려면 RHACM 2.8 이상을 사용해야 합니다. BMC 주소 지정에 대한 자세한 내용은 "추가 리소스" 섹션을 참조하십시오.

참고

지금까지 엣지 Telco 사용 사례에서는 GitOps ZTP에서 사용할 수 있도록 가상 미디어만 지원됩니다.

spec.clusters.nodes.bmcCredentialsName

호스트 BMC 인증 정보를 사용하여 별도로 생성하는 bmh-secret CR을 구성합니다. bmh-secret CR을 생성할 때 호스트를 프로비저닝하는 SiteConfig CR과 동일한 네임스페이스를 사용합니다.

spec.clusters.nodes.bootMode

호스트의 부팅 모드를 UEFI 로 설정합니다. 기본값은 UEFI 입니다. UEFISecureBoot 를 사용하여 호스트에서 보안 부팅을 활성화합니다.

spec.clusters.nodes.rootDeviceHints

배포 장치를 지정합니다. 재부팅 시 안정적인 식별자를 사용하는 것이 좋습니다. 예를 들어 wwn: <disk_wwn> 또는 deviceName: /dev/disk/by-path/<device_path >. <by-path& gt; 값이 선호됩니다. 안정적인 식별자의 자세한 목록은 "루트 장치 팁 정보" 섹션을 참조하십시오.

spec.clusters.nodes.ignitionConfigOverride

선택 사항: 이 필드를 사용하여 영구 스토리지의 파티션을 할당합니다. 디스크 ID와 크기를 특정 하드웨어에 조정합니다.

spec.clusters.nodes.nodeNetwork

노드의 네트워크 설정을 구성합니다.

spec.clusters.nodes.nodeNetwork.config.interfaces.ipv6

호스트의 IPv6 주소를 구성합니다. 고정 IP 주소가 있는 단일 노드 OpenShift 클러스터의 경우 노드별 API 및 Ingress IP가 동일해야 합니다.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.