이 콘텐츠는 선택한 언어로 제공되지 않습니다.
A.2. Deploying the Containers
Execute the following commands to deploy the Red Hat Gluster Storage container on the nodes:
- List out the hostnames of the nodes on which the Red Hat Gluster Storage container has to be deployed:
oc get nodes
# oc get nodes
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to label all nodes that will run Red Hat Gluster Storage pods:
oc label node <NODENAME> storagenode=glusterfs
# oc label node <NODENAME> storagenode=glusterfs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:oc label nodes 192.168.90.3 storagenode=glusterfs
# oc label nodes 192.168.90.3 storagenode=glusterfs node "192.168.90.3" labeled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Repeat this command for every node that will be in the GlusterFS cluster.Verify the label has set properly by running the following command:oc get nodes --show-labels
# oc get nodes --show-labels 192.168.90.2 Ready 12d beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=192.168.90.2,storagenode=glusterfs 192.168.90.3 Ready 12d beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=192.168.90.3,storagenode=glusterfs 192.168.90.4 Ready 12d beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=192.168.90.4,storagenode=glusterfs 192.168.90.5 Ready,SchedulingDisabled 12d beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=192.168.90.5
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to deploy the Red Hat Gluster Storage pods:
oc process glusterfs | oc create -f -
# oc process glusterfs | oc create -f - daemonset "glusterfs" created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
This does not initialize the hardware or create trusted storage pools. That aspect will be taken care by heketi which is explained in the further steps. - Execute the following command to grant the heketi Service Account the neccessary privileges:
oc policy add-role-to-user edit system:serviceaccount:<project_name>:heketi-service-account
# oc policy add-role-to-user edit system:serviceaccount:<project_name>:heketi-service-account
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:oc policy add-role-to-user edit system:serviceaccount:storage-project:heketi-service-account
# oc policy add-role-to-user edit system:serviceaccount:storage-project:heketi-service-account
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to determine the mountable secret you should use for the heketi pods:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You should select a secret that is mountable, in your project namespace, and of typekubernetes.io/service-account-token
. You can use the following command to inspect a given secret:oc describe secret <secret name>
# oc describe secret <secret name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to deploy heketi:
oc process deploy-heketi -v \ HEKETI_KUBE_NAMESPACE=<Project name> \ HEKETI_KUBE_APIHOST='<OpenShift master endpoint address>' \ HEKETI_KUBE_SECRETNAME=<heketi-service-account secret> | oc create -f -
# oc process deploy-heketi -v \ HEKETI_KUBE_NAMESPACE=<Project name> \ HEKETI_KUBE_APIHOST='<OpenShift master endpoint address>' \ HEKETI_KUBE_SECRETNAME=<heketi-service-account secret> | oc create -f -
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to verify that the containers are running:
oc get pods
# oc get pods
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow