針對未受管理的叢集設定 Block Storage for VPC
以下文件涵蓋了在 IBM Cloud 中的非托管 OpenShift Container Platform 集群上部署 Block Storage for VPC 驅動程式的步驟。 此程序不受支援,任何與步驟或驅動程式有關的問題都必須在 Red Hat OpenShift on IBM Cloud 群集中重新建立,才能獲得支援。
虛擬私有雲
想要在 IBM Cloud Kubernetes Service 或 Red Hat OpenShift on IBM Cloud 叢集中使用 Block Storage for VPC? 如需詳細資訊,請參閱 設定 Block Storage for VPC。
必要條件
若要使用 Block Storage for VPC 驅動程式,請完成下列工作:
- 在 VPC 基礎架構上建立 Red Hat OpenShift on IBM Cloud 叢集。
- 標註工作者節點。
- 建立儲存空間密碼。
- 建立使用 IAM 認證的映像檔取回密碼。
標示工作者節點
在部署 Block Storage for VPC 驅動程式之前,您必須透過新增所需的標籤來準備工作節點。
開始之前,請先登入您的帳戶:。 適用的話,請將適當的資源群組設為目標。 設定叢集的環境定義。
-
擷取 VPC 實例的下列詳細資料。 這些參數用於將標籤套用至工作者節點。
<instanceID>-VPC 實例 ID。 若要擷取此值,請執行ibmcloud is ins。<node-name>- 工作節點的名稱。 若要擷取此值,請執行kubectl get nodes。<region-of-instanceID>及<zone-of-instanceID>-VPC 實例所在的地區及區域。 若要擷取這些值,請執行ibmcloud is in <instanceID>。 區域值的範例:eu-de。 區域值範例:eu-de-1。
-
複製下列 Shell Script,並將它儲存至本端機器上稱為
setup.sh的檔案。#!/bin/bash function help() { echo "Run the script in the following format..." echo "./setup.sh <node-name> <instanceID> <region-of-instanceID> <zone-of-instanceID>" exit 1 } function apply_labels() { kubectl label nodes $1 "ibm-cloud.kubernetes.io/worker-id"=$2 kubectl label nodes $1 "failure-domain.beta.kubernetes.io/region"=$3 kubectl label nodes $1 "failure-domain.beta.kubernetes.io/zone"=$4 kubectl label nodes $1 "topology.kubernetes.io/region"=$3 kubectl label nodes $1 "topology.kubernetes.io/zone"=$4 } function verify_node() { kubectl get nodes | grep $1 if (( $? == 0 )) then return 0 else return 1 fi } if (( $# < 4 )) then help fi node=$1 instanceID=$2 region=$3 zone=$4 verify_node $node if (( $? == 0 )) then apply_labels $node $instanceID $region $zone else echo "Node " \'$node\' " not found in the cluster, please check the node or passing correct parameters while executing script" help fi -
透過執行 Shell Script 並指定先前擷取的參數,為工作者節點加上標籤。 針對叢集裡的每一個工作者節點重複此步驟。
sh setup.sh <node-name> <instanceID> <region-of-instanceID> <zone-of-instanceID>
擷取 IAM 及 VPC 詳細資料
要建立 Block Storage for VPC ConfigMap, 中使用的 Kubernetes secret,您必須擷取您的 IAM 和 VPC 詳細資訊。
-
擷取下列配置參數值。 這些值用來建立 Block Storage for VPC所需的 Kubernetes 密鑰。
<g2_api_key>- IAM API 金鑰。 您可以使用現有的 API 金鑰,或者透過執行ibmcloud iam api-key-create NAME指令來建立一個 API 金鑰。<g2_riaas_endpoint>-VPC 叢集的 VPC 地區端點,格式為https://<region>.iaas.cloud.ibm.com。 範例:https://eu-de.iaas.cloud.ibm.com。 如需相關資訊,請參閱 VPC 端點。<g2_resource_group_id>-若要擷取此值,請執行ibmcloud is vpc <vpc-ID>指令並記下Resource group欄位。
-
將下列 TOML 配置檔儲存至稱為
config.toml的本端機器。 請確定值之間沒有空白行,且檔案結尾沒有空白行。[server] debug_trace = false [vpc] iam_client_id = "bx" iam_client_secret = "bx" g2_token_exchange_endpoint_url = "https://iam.bluemix.net" g2_riaas_endpoint_url = "<g2_riaas_endpoint>" g2_resource_group_id = "<resource_group_id>" g2_api_key = "<IAM_API_key>" provider_type = "g2" -
輸入您先前擷取的值,並將 TOML 檔案編碼為 base64。 儲存 base64 輸出以在 Block Storage 驅動程式 ConfigMap中使用。
cat ./config.toml | base64
在叢集裡建立映像檔取回密碼
在叢集裡建立映像檔取回密碼。 您建立的密鑰用於取回 Block Storage for VPC 驅動程式映像檔。
-
檢閱並擷取映像檔取回密碼的下列值。
<docker-username>-輸入字串:iamapikey。<docker-password>- 輸入您的 IAM API 金鑰。 如需進一步了解 IAM API 金鑰,請參閱《 了解 API 金鑰 》。<docker-email>-輸入字串:iamapikey。
-
執行下列指令,以在叢集裡建立映像檔取回密碼。 請注意,您的密鑰必須命名為
icr-io-secret。oc create secret docker-registry icr-io-secret --docker-server=icr.io --docker-username=iamapikey --docker-password=-<iam-api-key> --docker-email=iamapikey -n kube-system
建立 Block Storage for VPC 驅動程式部署
選擇符合工作節點作業系統的 Block Storage for VPC 驅動程式 ConfigMap。 當您在群集中建立部署時,就會安裝 Block Storage for VPC 驅動程式和儲存類別。
-
將下列其中一個 YAML 配置儲存至本端機器上稱為
configmap.yaml的檔案。 根據您的叢集作業系統,選取 ConfigMap。 -
將您先前建立的已編碼 TOML 配置詳細資料新增至
slclient.toml密鑰配置區段中的 ConfigMap。 -
在您的叢集中建立「ConfigMap」。
oc create -f configmap.yaml -
驗證已部署驅動程式 Pod,且狀態為
Running。oc get pods -n kube-system | grep vpc -
驗證已建立
csidrivers。oc get csidrivers | grep vpc輸出範例:
NAME ATTACHREQUIRED PODINFOONMOUNT MODES AGE vpc.block.csi.ibm.io true true Persistent 8m26s -
請確認儲存類別是否已建立。
oc get sc輸出範例
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 8d ibmc-vpc-block-10iops-tier (default) vpc.block.csi.ibm.io Delete Immediate false 9m ibmc-vpc-block-5iops-tier vpc.block.csi.ibm.io Delete Immediate false 9m ibmc-vpc-block-custom vpc.block.csi.ibm.io Delete Immediate false 9m ibmc-vpc-block-general-purpose vpc.block.csi.ibm.io Delete Immediate false 9m ibmc-vpc-block-retain-10iops-tier vpc.block.csi.ibm.io Retain Immediate false 9m ibmc-vpc-block-retain-5iops-tier vpc.block.csi.ibm.io Retain Immediate false 8m59s ibmc-vpc-block-retain-custom vpc.block.csi.ibm.io Retain Immediate false 8m59s ibmc-vpc-block-retain-general-purpose vpc.block.csi.ibm.io Retain Immediate false 8m59s -
部署使用 Block Storage for VPC 的有狀態集。
部署使用 Block Storage for VPC 的有狀態集
部署 Block Storage for VPC 驅動程式後,您可以建立利用 Block Storage for VPC 的部署。 下列有狀態設定透過建立使用 ibmc-vpc-block-5iops-tier 儲存類別的 PVC,動態提供 Block Storage for VPC 磁碟區。
- 將下列 YAML 配置儲存為本端機器上稱為
statefulset.yaml的檔案。apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx spec: ports: - port: 80 name: web clusterIP: None selector: app: nginx --- apiVersion: apps/v1 kind: StatefulSet metadata: name: web spec: serviceName: "nginx" replicas: 2 podManagementPolicy: "Parallel" selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx securityContext: privileged: false image: registry.k8s.io/nginx-slim:0.8 ports: - containerPort: 80 name: web volumeMounts: - name: www mountPath: /usr/share/nginx/html tolerations: - operator: Exists volumeClaimTemplates: - metadata: annotations: volume.beta.kubernetes.io/storage-class: ibmc-vpc-block-5iops-tier name: www spec: accessModes: - ReadWriteOnce # access mode resources: requests: storage: 25Gi # - 在叢集裡建立有狀態集。
kubectl create -f statefulset.yaml - 請確認有狀態集(stateful set)的 Pod 是否正在執行中。
輸出範例kubectl get podsNAME READY STATUS RESTARTS AGE web-0 1/1 Running 0 2m52s web-1 1/1 Running 0 2m52s
移除 Block Storage for VPC 驅動程式
如果您不想再在群集中使用 Block Storage for VPC 驅動程式,可以移除 ConfigMap 來移除驅動程式 Pod。
從叢集移除 Block Storage for VPC 驅動程式不會移除儲存卷中的資料。 如果您想要完全移除 PV 及 PVC,請參閱 清除持續性儲存空間。
- 從叢集中刪除
ibm-vpc-block-csi-configmapConfigMap。oc rm cm ibm-vpc-block-csi-configmap -n kube-system - 請確認已移除 ConfigMap。
oc get cm -n kube-system | grep ibm-vpc-block-csi-configmap
配置對映參照
根據您的工作者節點作業系統,選取下列其中一個配置對映。
RHEL 或 CentOS ConfigMap
將下列 ConfigMap YAML 儲存為本端機器上的檔案。
apiVersion: v1
items:
- apiVersion: v1
data:
CSI_ENDPOINT: unix:/csi/csi.sock
IKS_BLOCK_PROVIDER_NAME: iks-vpc
IKS_ENABLED: "False"
SECRET_CONFIG_PATH: /etc/storage_ibmc
VPC_API_GENERATION: "1"
VPC_API_TIMEOUT: 180s
VPC_API_VERSION: "2019-07-02"
VPC_BLOCK_PROVIDER_NAME: vpc
VPC_ENABLED: "True"
VPC_RETRY_ATTEMPT: "10"
VPC_RETRY_INTERVAL: "120"
kind: ConfigMap
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-csi-configmap
namespace: kube-system
- apiVersion: v1
imagePullSecrets:
- name: bluemix-default-secret
- name: bluemix-default-secret-regional
- name: bluemix-default-secret-international
- name: icr-io-secret
kind: ServiceAccount
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-node-sa
namespace: kube-system
- apiVersion: v1
data:
cluster-config.json: |
{}
kind: ConfigMap
metadata:
annotations:
name: cluster-info
namespace: kube-system
- apiVersion: v1
data:
slclient.toml: # Enter the base64 encoded TOML file that you created earlier
kind: Secret
metadata:
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
kubernetes.io/cluster-service: "true"
name: storage-secret-store
namespace: kube-system
type: Opaque
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-driver-registrar-role
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- get
- list
- watch
- create
- update
- patch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-driver-registrar-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vpc-block-driver-registrar-role
subjects:
- kind: ServiceAccount
name: ibm-vpc-block-node-sa
namespace: kube-system
- apiVersion: v1
imagePullSecrets:
- name: bluemix-default-secret
- name: bluemix-default-secret-regional
- name: bluemix-default-secret-international
- name: icr-io-secret
kind: ServiceAccount
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-controller-sa
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-provisioner-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- list
- watch
- create
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- get
- list
- apiGroups:
- storage.k8s.io
resources:
- csinodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-provisioner-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vpc-block-provisioner-role
subjects:
- kind: ServiceAccount
name: ibm-vpc-block-controller-sa
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-external-attacher-role
rules:
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- csi.storage.k8s.io
resources:
- csinodeinfos
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments
verbs:
- get
- list
- watch
- update
- patch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-external-attacher-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vpc-block-external-attacher-role
subjects:
- kind: ServiceAccount
name: ibm-vpc-block-controller-sa
namespace: kube-system
- apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
name: vpc.block.csi.ibm.io
spec:
attachRequired: true
podInfoOnMount: true
volumeLifecycleModes:
- Persistent
- apiVersion: apps/v1
kind: DaemonSet
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-csi-node
namespace: kube-system
spec:
selector:
matchLabels:
app: ibm-vpc-block-csi-driver
template:
metadata:
labels:
app: ibm-vpc-block-csi-driver
spec:
containers:
- args:
- --v=5
- --csi-address=$(ADDRESS)
- --kubelet-registration-path=$(DRIVER_REGISTRATION_SOCK)
env:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REGISTRATION_SOCK
value: /var/lib/kubelet/plugins/vpc.block.csi.ibm.io/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
imagePullPolicy: Always
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- rm -rf /registration/vpc.block.csi.ibm.io /registration/vpc.block.csi.ibm.io-reg.sock
name: csi-driver-registrar
securityContext:
runAsNonRoot: false
runAsUser: 0
privileged: false
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 10m
memory: 20Mi
volumeMounts:
- mountPath: /csi
name: plugin-dir
- mountPath: /registration
name: registration-dir
- args:
- --v=5
- --endpoint=unix:/csi/csi.sock
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
envFrom:
- configMapRef:
name: ibm-vpc-block-csi-configmap
image: icr.io/ibm/ibm-vpc-block-csi-driver:v3.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
name: iks-vpc-block-node-driver
ports:
- containerPort: 9808
name: healthz
protocol: TCP
resources:
limits:
cpu: 200m
memory: 250Mi
requests:
cpu: 20m
memory: 50Mi
securityContext:
runAsNonRoot: false
runAsUser: 0
privileged: true
volumeMounts:
- mountPath: /var/lib/kubelet
mountPropagation: Bidirectional
name: kubelet-data-dir
- mountPath: /csi
name: plugin-dir
- mountPath: /dev
name: device-dir
- mountPath: /etc/udev
name: etcudevpath
- mountPath: /run/udev
name: runudevpath
- mountPath: /lib/udev
name: libudevpath
- mountPath: /sys
name: syspath
- mountPath: /etc/storage_ibmc
name: customer-auth
readOnly: true
- mountPath: /etc/storage_ibmc/cluster_info
name: cluster-info
readOnly: true
- args:
- --csi-address=/csi/csi.sock
image: quay.io/k8scsi/livenessprobe:v2.0.0
name: liveness-probe
securityContext:
runAsNonRoot: false
runAsUser: 0
privileged: false
resources:
limits:
cpu: 50m
memory: 50Mi
requests:
cpu: 5m
memory: 10Mi
volumeMounts:
- mountPath: /csi
name: plugin-dir
serviceAccountName: ibm-vpc-block-node-sa
tolerations:
- operator: Exists
volumes:
- hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
name: registration-dir
- hostPath:
path: /var/lib/kubelet
type: Directory
name: kubelet-data-dir
- hostPath:
path: /var/lib/kubelet/plugins/vpc.block.csi.ibm.io/
type: DirectoryOrCreate
name: plugin-dir
- hostPath:
path: /dev
type: Directory
name: device-dir
- hostPath:
path: /etc/udev
type: Directory
name: etcudevpath
- hostPath:
path: /run/udev
type: Directory
name: runudevpath
- hostPath:
path: /lib/udev
type: Directory
name: libudevpath
- hostPath:
path: /sys
type: Directory
name: syspath
- name: customer-auth
secret:
secretName: storage-secret-store
- configMap:
name: cluster-info
name: cluster-info
- apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-csi-controller
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: ibm-vpc-block-csi-driver
serviceName: ibm-vpc-block-service
template:
metadata:
labels:
app: ibm-vpc-block-csi-driver
spec:
securityContext:
runAsNonRoot: true
runAsUser: 2121
containers:
- args:
- --v=5
- --csi-address=$(ADDRESS)
- --timeout=600s
- --feature-gates=Topology=true
env:
- name: ADDRESS
value: /csi/csi.sock
image: quay.io/k8scsi/csi-provisioner:v1.6.0
securityContext:
privileged: false
allowPrivilegeEscalation: false
imagePullPolicy: Always
name: csi-provisioner
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 10m
memory: 20Mi
volumeMounts:
- mountPath: /csi
name: socket-dir
- args:
- --v=5
- --csi-address=/csi/csi.sock
- --timeout=900s
image: quay.io/k8scsi/csi-attacher:v2.2.0
securityContext:
privileged: false
allowPrivilegeEscalation: false
imagePullPolicy: Always
name: csi-attacher
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 10m
memory: 20Mi
volumeMounts:
- mountPath: /csi
name: socket-dir
- args:
- --csi-address=/csi/csi.sock
image: quay.io/k8scsi/livenessprobe:v2.0.0
name: liveness-probe
securityContext:
privileged: false
allowPrivilegeEscalation: false
resources:
limits:
cpu: 50m
memory: 50Mi
requests:
cpu: 5m
memory: 10Mi
volumeMounts:
- mountPath: /csi
name: socket-dir
- args:
- --v=5
- --endpoint=$(CSI_ENDPOINT)
- --lock_enabled=false
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- configMapRef:
name: ibm-vpc-block-csi-configmap
image: icr.io/ibm/ibm-vpc-block-csi-driver:v3.0.0
imagePullPolicy: Always
securityContext:
privileged: false
allowPrivilegeEscalation: false
livenessProbe:
failureThreshold: 5
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
name: iks-vpc-block-driver
ports:
- containerPort: 9808
name: healthz
protocol: TCP
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 50m
memory: 100Mi
volumeMounts:
- mountPath: /csi
name: socket-dir
- mountPath: /etc/storage_ibmc
name: customer-auth
readOnly: true
- mountPath: /etc/storage_ibmc/cluster_info
name: cluster-info
readOnly: true
serviceAccountName: ibm-vpc-block-controller-sa
volumes:
- emptyDir: {}
name: socket-dir
- name: customer-auth
secret:
secretName: storage-secret-store
- configMap:
name: cluster-info
name: cluster-info
volumeClaimTemplates: []
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
storageclass.beta.kubernetes.io/is-default-class: "true"
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-10iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 10iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-5iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 5iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-custom
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
iops: "400"
profile: custom
region: ""
resourceGroup: ""
sizeIOPSRange: |-
[10-39]GiB:[100-1000]
[40-79]GiB:[100-2000]
[80-99]GiB:[100-4000]
[100-499]GiB:[100-6000]
[500-999]GiB:[100-10000]
[1000-1999]GiB:[100-20000]
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-general-purpose
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: general-purpose
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-10iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 10iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-5iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 5iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-custom
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
iops: "400"
profile: custom
region: ""
resourceGroup: ""
sizeIOPSRange: |-
[10-39]GiB:[100-1000]
[40-79]GiB:[100-2000]
[80-99]GiB:[100-4000]
[100-499]GiB:[100-6000]
[500-999]GiB:[100-10000]
[1000-1999]GiB:[100-20000]
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-general-purpose
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: general-purpose
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
kind: List
metadata:
annotations:
version: 2.0.3_354
name: ibm-vpc-block-csi-driver
namespace: kube-system
Ubuntu ConfigMap
將下列 YAML 配置儲存為本端機器上的檔案。
apiVersion: v1
items:
- apiVersion: v1
data:
CSI_ENDPOINT: unix:/csi/csi.sock
IKS_BLOCK_PROVIDER_NAME: iks-vpc
IKS_ENABLED: "False"
SECRET_CONFIG_PATH: /etc/storage_ibmc
VPC_API_GENERATION: "1"
VPC_API_TIMEOUT: 180s
VPC_API_VERSION: "2019-07-02"
VPC_BLOCK_PROVIDER_NAME: vpc
VPC_ENABLED: "True"
VPC_RETRY_ATTEMPT: "10"
VPC_RETRY_INTERVAL: "120"
kind: ConfigMap
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-csi-configmap
namespace: kube-system
- apiVersion: v1
data:
cluster-config.json: |
{}
kind: ConfigMap
metadata:
annotations:
name: cluster-info
namespace: kube-system
- apiVersion: v1
data:
slclient.toml: # Enter the base64 encoded TOML file that you created earlier.
kind: Secret
metadata:
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
kubernetes.io/cluster-service: "true"
name: storage-secret-store
namespace: kube-system
type: Opaque
- apiVersion: v1
imagePullSecrets:
- name: bluemix-default-secret
- name: bluemix-default-secret-regional
- name: bluemix-default-secret-international
- name: icr-io-secret
kind: ServiceAccount
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-node-sa
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-driver-registrar-role
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- get
- list
- watch
- create
- update
- patch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-driver-registrar-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vpc-block-driver-registrar-role
subjects:
- kind: ServiceAccount
name: ibm-vpc-block-node-sa
namespace: kube-system
- apiVersion: v1
imagePullSecrets:
- name: bluemix-default-secret
- name: bluemix-default-secret-regional
- name: bluemix-default-secret-international
- name: icr-io-secret
kind: ServiceAccount
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-controller-sa
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-provisioner-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- list
- watch
- create
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- get
- list
- apiGroups:
- storage.k8s.io
resources:
- csinodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-provisioner-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vpc-block-provisioner-role
subjects:
- kind: ServiceAccount
name: ibm-vpc-block-controller-sa
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-external-attacher-role
rules:
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- csi.storage.k8s.io
resources:
- csinodeinfos
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments
verbs:
- get
- list
- watch
- update
- patch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: vpc-block-external-attacher-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vpc-block-external-attacher-role
subjects:
- kind: ServiceAccount
name: ibm-vpc-block-controller-sa
namespace: kube-system
- apiVersion: apps/v1
kind: DaemonSet
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-csi-node
namespace: kube-system
spec:
selector:
matchLabels:
app: ibm-vpc-block-csi-driver
template:
metadata:
labels:
app: ibm-vpc-block-csi-driver
spec:
containers:
- args:
- --v=5
- --csi-address=$(ADDRESS)
- --kubelet-registration-path=$(DRIVER_REGISTRATION_SOCK)
env:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REGISTRATION_SOCK
value: /var/lib/kubelet/csi-plugins/vpc.block.csi.ibm.io/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- rm -rf /registration/vpc.block.csi.ibm.io /registration/vpc.block.csi.ibm.io-reg.sock
name: csi-driver-registrar
securityContext:
runAsNonRoot: false
runAsUser: 0
privileged: false
volumeMounts:
- mountPath: /csi
name: plugin-dir
- mountPath: /registration
name: registration-dir
- args:
- --v=5
- --endpoint=unix:/csi/csi.sock
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
envFrom:
- configMapRef:
name: ibm-vpc-block-csi-configmap
image: icr.io/ibm/ibm-vpc-block-csi-driver:v3.0.0
imagePullPolicy: IfNotPresent
name: iks-vpc-block-node-driver
securityContext:
runAsNonRoot: false
runAsUser: 0
privileged: true
volumeMounts:
- mountPath: /var/lib/kubelet
mountPropagation: Bidirectional
name: kubelet-data-dir
- mountPath: /csi
name: plugin-dir
- mountPath: /dev
name: device-dir
- mountPath: /etc/udev
name: etcudevpath
- mountPath: /run/udev
name: runudevpath
- mountPath: /lib/udev
name: libudevpath
- mountPath: /sys
name: syspath
- mountPath: /etc/storage_ibmc
name: customer-auth
readOnly: true
- mountPath: /etc/storage_ibmc/cluster_info
name: cluster-info
readOnly: true
serviceAccountName: ibm-vpc-block-node-sa
volumes:
- hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
name: registration-dir
- hostPath:
path: /var/lib/kubelet
type: Directory
name: kubelet-data-dir
- hostPath:
path: /var/lib/kubelet/csi-plugins/vpc.block.csi.ibm.io/
type: DirectoryOrCreate
name: plugin-dir
- hostPath:
path: /dev
type: Directory
name: device-dir
- hostPath:
path: /etc/udev
type: Directory
name: etcudevpath
- hostPath:
path: /run/udev
type: Directory
name: runudevpath
- hostPath:
path: /lib/udev
type: Directory
name: libudevpath
- hostPath:
path: /sys
type: Directory
name: syspath
- name: customer-auth
secret:
secretName: storage-secret-store
- configMap:
name: cluster-info
name: cluster-info
- apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
name: ibm-vpc-block-csi-controller
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: ibm-vpc-block-csi-driver
serviceName: ibm-vpc-block-service
template:
metadata:
labels:
app: ibm-vpc-block-csi-driver
spec:
securityContext:
runAsNonRoot: true
runAsUser: 2121
containers:
- args:
- --v=5
- --csi-address=$(ADDRESS)
- --timeout=600s
- --feature-gates=Topology=true
env:
- name: ADDRESS
value: /csi/csi.sock
image: quay.io/k8scsi/csi-provisioner:v1.3.1
securityContext:
privileged: false
allowPrivilegeEscalation: false
name: csi-provisioner
volumeMounts:
- mountPath: /csi
name: socket-dir
- args:
- --v=5
- --csi-address=/csi/csi.sock
- --timeout=900s
image: quay.io/k8scsi/csi-attacher:v2.0.0
name: csi-attacher
securityContext:
privileged: false
allowPrivilegeEscalation: false
volumeMounts:
- mountPath: /csi
name: socket-dir
- args:
- --v=5
- --endpoint=$(CSI_ENDPOINT)
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- configMapRef:
name: ibm-vpc-block-csi-configmap
image: icr.io/ibm/ibm-vpc-block-csi-driver:v3.0.0
securityContext:
privileged: false
allowPrivilegeEscalation: false
imagePullPolicy: IfNotPresent
name: iks-vpc-block-driver
volumeMounts:
- mountPath: /csi
name: socket-dir
- mountPath: /etc/storage_ibmc
name: customer-auth
readOnly: true
- mountPath: /etc/storage_ibmc/cluster_info
name: cluster-info
readOnly: true
serviceAccountName: ibm-vpc-block-controller-sa
volumes:
- emptyDir: {}
name: socket-dir
- name: customer-auth
secret:
secretName: storage-secret-store
- configMap:
name: cluster-info
name: cluster-info
volumeClaimTemplates: []
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
storageclass.beta.kubernetes.io/is-default-class: "true"
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-10iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 10iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-5iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 5iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-custom
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
iops: "400"
profile: custom
region: ""
resourceGroup: ""
sizeIOPSRange: |-
[10-39]GiB:[100-1000]
[40-79]GiB:[100-2000]
[80-99]GiB:[100-4000]
[100-499]GiB:[100-6000]
[500-999]GiB:[100-10000]
[1000-1999]GiB:[100-20000]
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-general-purpose
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: general-purpose
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Delete
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-10iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 10iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-5iops-tier
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: 5iops-tier
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-custom
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
iops: "400"
profile: custom
region: ""
resourceGroup: ""
sizeIOPSRange: |-
[10-39]GiB:[100-1000]
[40-79]GiB:[100-2000]
[80-99]GiB:[100-4000]
[100-499]GiB:[100-6000]
[500-999]GiB:[100-10000]
[1000-1999]GiB:[100-20000]
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
- apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
version: 2.0.2_285
labels:
addonmanager.kubernetes.io/mode: Reconcile
app: ibm-vpc-block-csi-driver
razee/force-apply: "true"
name: ibmc-vpc-block-retain-general-purpose
parameters:
billingType: hourly
classVersion: "1"
csi.storage.k8s.io/fstype: ext4
encrypted: "false"
encryptionKey: ""
profile: general-purpose
region: ""
resourceGroup: ""
sizeRange: '[10-2000]GiB'
tags: ""
zone: ""
provisioner: vpc.block.csi.ibm.io
reclaimPolicy: Retain
kind: List
metadata:
annotations:
version: 2.0.2_285
name: ibm-vpc-block-csi-driver
namespace: kube-system