13.3. Nutanix 설치 후 구성
아래 단계에 따라 OpenShift Container Platform과 Nutanix 클라우드 공급자의 통합을 완료하고 검증하십시오.
사전 요구 사항
- 지원 설치 관리자에서 클러스터 설치를 성공적으로 완료했습니다.
- 클러스터가 console.redhat.com 에 연결되어 있습니다.
- Red Hat OpenShift Container Platform 명령줄 인터페이스에 액세스할 수 있습니다.
13.3.1. Nutanix 구성 설정 업데이트
지원 설치 관리자를 사용하여 Nutanix 플랫폼에 OpenShift Container Platform을 설치한 후 다음 Nutanix 구성 설정을 수동으로 업데이트해야 합니다.
-
<prismcentral_username&
gt; : Nutanix Prism Central 사용자 이름. -
<prismcentral_password
> : Nutanix Prism Central 암호. -
<prismcentral_address
> : Nutanix Prism Central 주소입니다. -
<prismcentral_port
> : Nutanix Prism Central 포트. -
<prismelement_username&
gt; : Nutanix Prism Element 사용자 이름. -
<prismelement_password
> : Nutanix Prism Element 암호. -
<prismelement_address
> : Nutanix Prism Element 주소 -
<prismelement_port
> : Nutanix Prism Element 포트. -
<prismelement_clustername
> : Nutanix Prism Element 클러스터 이름입니다. -
<nutanix_storage_container
> : Nutanix Prism 스토리지 컨테이너
프로세스
OpenShift Container Platform 명령줄 인터페이스에서 Nutanix 클러스터 구성 설정을 업데이트합니다.
$ oc patch infrastructure/cluster --type=merge --patch-file=/dev/stdin <<-EOF { "spec": { "platformSpec": { "nutanix": { "prismCentral": { "address": "<prismcentral_address>", "port": <prismcentral_port> }, "prismElements": [ { "endpoint": { "address": "<prismelement_address>", "port": <prismelement_port> }, "name": "<prismelement_clustername>" } ] }, "type": "Nutanix" } } } EOF
샘플 출력
infrastructure.config.openshift.io/cluster patched
자세한 내용은 Nutanix에서 머신 세트 생성 을 참조하십시오.
Nutanix 시크릿을 생성합니다.
$ cat <<EOF | oc create -f - apiVersion: v1 kind: Secret metadata: name: nutanix-credentials namespace: openshift-machine-api type: Opaque stringData: credentials: | [{"type":"basic_auth","data":{"prismCentral":{"username":"${<prismcentral_username>}","password":"${<prismcentral_password>}"},"prismElements":null}}] EOF
샘플 출력
secret/nutanix-credentials created
OpenShift Container Platform 버전 4.13 이상을 설치할 때 Nutanix 클라우드 공급자 구성을 업데이트합니다.
Nutanix 클라우드 공급자 구성 YAML 파일을 가져옵니다.
$ oc get cm cloud-provider-config -o yaml -n openshift-config > cloud-provider-config-backup.yaml
구성 파일의 백업을 생성합니다.
$ cp cloud-provider-config_backup.yaml cloud-provider-config.yaml
구성 YAML 파일을 엽니다.
$ vi cloud-provider-config.yaml
다음과 같이 구성 YAML 파일을 편집합니다.
kind: ConfigMap apiVersion: v1 metadata: name: cloud-provider-config namespace: openshift-config data: config: | { "prismCentral": { "address": "<prismcentral_address>", "port":<prismcentral_port>, "credentialRef": { "kind": "Secret", "name": "nutanix-credentials", "namespace": "openshift-cloud-controller-manager" } }, "topologyDiscovery": { "type": "Prism", "topologyCategories": null }, "enableCustomLabeling": true }
구성 업데이트를 적용합니다.
$ oc apply -f cloud-provider-config.yaml
샘플 출력
Warning: resource configmaps/cloud-provider-config is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by oc apply. oc apply should only be used on resources created declaratively by either oc create --save-config or oc apply. The missing annotation will be patched automatically. configmap/cloud-provider-config configured
13.3.2. Nutanix CSI Operator group 생성
Nutanix CSI Operator에 대한 Operator 그룹을 생성합니다.
Operator 그룹 및 관련 개념에 대한 설명은 추가 리소스 의 일반 Operator 프레임워크 약관 을 참조하십시오.
프로세스
Nutanix CSI Operator 그룹 YAML 파일을 엽니다.
$ vi openshift-cluster-csi-drivers-operator-group.yaml
다음과 같이 YAML 파일을 편집합니다.
apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: generateName: openshift-cluster-csi-drivers namespace: openshift-cluster-csi-drivers spec: targetNamespaces: - openshift-cluster-csi-drivers upgradeStrategy: Default
Operator 그룹을 생성합니다.
$ oc create -f openshift-cluster-csi-drivers-operator-group.yaml
샘플 출력
operatorgroup.operators.coreos.com/openshift-cluster-csi-driversjw9cd created
13.3.3. Nutanix CSI Operator 설치
Kubernetes용 Nutanix CSI(Container Storage Interface) Operator는 Nutanix CSI 드라이버를 배포하고 관리합니다.
Red Hat OpenShift Container Platform을 통해 이 단계를 수행하는 방법에 대한 자세한 내용은 추가 리소스에서 Nutanix CSI Operator 문서의 Operator 설치 섹션을 참조하십시오.
프로세스
Nutanix CSI Operator YAML 파일의 매개변수 값을 가져옵니다.
Nutanix CSI Operator가 있는지 확인합니다.
$ oc get packagemanifests | grep nutanix
샘플 출력
nutanixcsioperator Certified Operators 129m
Operator의 기본 채널을 BASH 변수에 할당합니다.
$ DEFAULT_CHANNEL=$(oc get packagemanifests nutanixcsioperator -o jsonpath={.status.defaultChannel})
Operator의 시작 CSV(클러스터 서비스 버전)를 BASH 변수에 할당합니다.
$ STARTING_CSV=$(oc get packagemanifests nutanixcsioperator -o jsonpath=\{.status.channels[*].currentCSV\})
서브스크립션의 카탈로그 소스를 BASH 변수에 할당합니다.
$ CATALOG_SOURCE=$(oc get packagemanifests nutanixcsioperator -o jsonpath=\{.status.catalogSource\})
Nutanix CSI Operator 소스 네임스페이스를 BASH 변수에 할당합니다.
$ SOURCE_NAMESPACE=$(oc get packagemanifests nutanixcsioperator -o jsonpath=\{.status.catalogSourceNamespace\})
BASH 변수를 사용하여 Nutanix CSI Operator YAML 파일을 생성합니다.
$ cat << EOF > nutanixcsioperator.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: nutanixcsioperator namespace: openshift-cluster-csi-drivers spec: channel: $DEFAULT_CHANNEL installPlanApproval: Automatic name: nutanixcsioperator source: $CATALOG_SOURCE sourceNamespace: $SOURCE_NAMESPACE startingCSV: $STARTING_CSV EOF
CSI Nutanix Operator를 생성합니다.
$ oc apply -f nutanixcsioperator.yaml
샘플 출력
subscription.operators.coreos.com/nutanixcsioperator created
Operator 서브스크립션 상태가
AtLatestKnown
으로 변경될 때까지 다음 명령을 실행합니다. 이는 Operator 서브스크립션이 생성되었으며 시간이 걸릴 수 있음을 나타냅니다.$ oc get subscription nutanixcsioperator -n openshift-cluster-csi-drivers -o 'jsonpath={..status.state}'
13.3.4. Nutanix CSI 스토리지 드라이버 배포
Kubernetes용 Nutanix CSI(Container Storage Interface) 드라이버는 상태 저장 애플리케이션을 위한 확장 가능하고 영구 스토리지를 제공합니다.
Red Hat OpenShift Container Platform을 통해 이 단계를 수행하는 방법에 대한 자세한 내용은 추가 리소스 의 Nutanix CSI Operator 문서의 Operator 섹션을 사용하여 CSI 드라이버 설치 섹션을 참조하십시오.
프로세스
드라이버를 배포할
NutanixCsiStorage
리소스를 생성합니다.$ cat <<EOF | oc create -f - apiVersion: crd.nutanix.com/v1alpha1 kind: NutanixCsiStorage metadata: name: nutanixcsistorage namespace: openshift-cluster-csi-drivers spec: {} EOF
샘플 출력
snutanixcsistorage.crd.nutanix.com/nutanixcsistorage created
CSI 스토리지 드라이버에 대한 Nutanix 시크릿 YAML 파일을 생성합니다.
$ cat <<EOF | oc create -f - apiVersion: v1 kind: Secret metadata: name: ntnx-secret namespace: openshift-cluster-csi-drivers stringData: # prism-element-ip:prism-port:admin:password key: <prismelement_address:prismelement_port:prismcentral_username:prismcentral_password> 1 EOF
참고- 1
- 동일한 형식을 유지하면서 이러한 매개변수를 실제 값으로 바꿉니다.
샘플 출력
secret/nutanix-secret created
13.3.5. 설치 후 구성 검증
다음 단계를 실행하여 구성을 검증합니다.
프로세스
스토리지 클래스를 생성할 수 있는지 확인합니다.
$ cat <<EOF | oc create -f - kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: nutanix-volume annotations: storageclass.kubernetes.io/is-default-class: 'true' provisioner: csi.nutanix.com parameters: csi.storage.k8s.io/fstype: ext4 csi.storage.k8s.io/provisioner-secret-namespace: openshift-cluster-csi-drivers csi.storage.k8s.io/provisioner-secret-name: ntnx-secret storageContainer: <nutanix_storage_container> 1 csi.storage.k8s.io/controller-expand-secret-name: ntnx-secret csi.storage.k8s.io/node-publish-secret-namespace: openshift-cluster-csi-drivers storageType: NutanixVolumes csi.storage.k8s.io/node-publish-secret-name: ntnx-secret csi.storage.k8s.io/controller-expand-secret-namespace: openshift-cluster-csi-drivers reclaimPolicy: Delete allowVolumeExpansion: true volumeBindingMode: Immediate EOF
참고- 1
- Nutanix_storage_container>는 Nutanix 구성에서 <nutanix_storage_container>를 사용합니다(예: SelfServiceContainer).
샘플 출력
storageclass.storage.k8s.io/nutanix-volume created
Nutanix PVC(영구 볼륨 클레임)를 생성할 수 있는지 확인합니다.
PVC(영구 볼륨 클레임)를 생성합니다.
$ cat <<EOF | oc create -f - kind: PersistentVolumeClaim apiVersion: v1 metadata: name: nutanix-volume-pvc namespace: openshift-cluster-csi-drivers annotations: volume.beta.kubernetes.io/storage-provisioner: csi.nutanix.com volume.kubernetes.io/storage-provisioner: csi.nutanix.com finalizers: - kubernetes.io/pvc-protection spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: nutanix-volume volumeMode: Filesystem EOF
샘플 출력
persistentvolumeclaim/nutanix-volume-pvc created
PVC(영구 볼륨 클레임) 상태가 Bound인지 확인합니다.
$ oc get pvc -n openshift-cluster-csi-drivers
샘플 출력
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE nutanix-volume-pvc Bound nutanix-volume 52s