另外我依然沒梗圖,所以開場 Po 個影片 Installing OpenShift to Red Hat Virtualization using full-stack automation,現在 libvirt 體系平台也可以使用 node scaling 的能力了,影片三分鐘,OpenShift 4.4 之後就會開始支援了
apiVersion:apps/v1 kind:Deployment metadata: name:nfs-client-provisioner labels: app:nfs-client-provisioner # replace with namespace where provisioner is deployed namespace:default spec: replicas:1 strategy: type:Recreate selector: matchLabels: app:nfs-client-provisioner template: metadata: labels: app:nfs-client-provisioner spec: serviceAccountName:nfs-client-provisioner containers: -name:nfs-client-provisioner # In diconnected environment, please pull the image before installing image:quay.io/external_storage/nfs-client-provisioner:latest volumeMounts: -name:nfs-client-root mountPath:/persistentvolumes env: -name:PROVISIONER_NAME value:fuseim.pri/ifs # Replace NFS Server and PATH -name:NFS_SERVER value:farm.pichuang.local -name:NFS_PATH value:/volume1/ocp_nfs volumes: -name:nfs-client-root nfs: # Replace NFS Server and PATH server:farm.pichuang.local path:/volume1/ocp_nfs
這邊提供 git diff 的差異,比較能了解需要修改的地方
bastion.ocp4.internal
1 2 3 4 5 6
$ oc create -f deploy/deployment.yaml deployment.apps/nfs-client-provisioner created
$ oc get pod NAME READY STATUS RESTARTS AGE nfs-client-provisioner-7df5d4f459-4lrnx 1/1 Running 0 73m
部署 StorageClass
deploy/class.yaml
1 2 3 4 5 6 7
apiVersion:storage.k8s.io/v1 kind:StorageClass metadata: name:managed-nfs-storage# or choose another name, the name will be applied by Dynamic PV provisioner:fuseim.pri/ifs# or choose another name, must match deployment's env PROVISIONER_NAME' parameters: archiveOnDelete:"false"
bastion.ocp4.internal
1 2
$ oc create -f deploy/class.yaml storageclass.storage.k8s.io/managed-nfs-storage created
$ oc create -f deploy/test-pod.yaml pod/test-pod created
# # Post Check # $ oc get pv,pvc NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE persistentvolume/pvc-719adae1-8fa4-4058-ae48-d9da1c5e7873 1Mi RWX Delete Bound default/test-claim managed-nfs-storage 3m6s
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE persistentvolumeclaim/test-claim Bound pvc-719adae1-8fa4-4058-ae48-d9da1c5e7873 1Mi RWX managed-nfs-storage 3m6s
如果這時候切到 NFS 的目錄裡面的話,就可以看到該檔案了
升級 OpenShift 4.y.z
Cluster Version Operator, CVO
現在 OpenShift 4 的升級已經是改由以 Operator Framework 為基礎實作 Cluster Version Operator 出來,主要能力就是提供OpenShift 線上更新機制 (Over The Air, OTA),
# Check current version and available upgrade inforamtion $ oc adm upgrade Cluster version is 4.3.5
Updates:
VERSION IMAGE 4.3.8 quay.io/openshift-release-dev/[email protected]:a414f6308db72f88e9d2e95018f0cc4db71c6b12b2ec0f44587488f0a16efc42 4.3.9 quay.io/openshift-release-dev/[email protected]:f0fada3c8216dc17affdd3375ff845b838ef9f3d67787d3d42a88dcd0f328eea
# Upgrade to specific version $ oc adm upgrade --to=4.3.9 Updating to 4.3.9
# Waiting... The installation time should be over 1 hr $ watch -n 30 oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.3.5 True True 4s Working towards 4.3.9: downloading update
# If you see any information mention # Unable to apply 4.y.z: the cluster operator <Operator Name> has not yet successfully rolled out # Solution: Just Wait or use oc describe clusterversion
$ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.3.9 True False 49s Cluster version is 4.3.9