Knowledge Base
#
SummaryHow do I reuse an existing PV - after re-creating Kubernetes StatefulSet and its PVC
How to install OpenEBS in OpenShift 4.x?
How to enable Admission-Controller in OpenShift environment?
How to setup default PodSecurityPolicy to allow the OpenEBS pods to work with all permissions?
How to prevent container logs from exhausting disk space?
How to create a BlockDeviceClaim for a particular BlockDevice?
How to provision Local PV on K3OS?
How to make cStor volume online if 2 replicas of 3 are lost?
How to reconstruct data from healthy replica to replaced one?
How to verify whether cStor volume is running fine?
Expanding Jiva Storage Volumes
#
How do I reuse an existing PV - after re-creating Kubernetes StatefulSet and its PVCThere are some cases where it had to delete the StatefulSet and re-install a new StatefulSet. In the process you may have to delete the PVCs used by the StatefulSet and retain PV policy by ensuring the Retain as the "Reclaim Policy". In this case, following are the procedures for re-using an existing PV in your StatefulSet application.
Get the PV name by following command and use it in Step 2.
Following is an example output
Patch corresponding PV's reclaim policy from "Delete" to "Retain". So that PV will retain even its PVC is deleted.This can be done by using the steps mentioned here.
Example Output:
Get the PVC name by following command and note down the PVC name. You have to use this same PVC name while creating new PVC.
Example Output:
Delete StatefulSet application and associated PVCs.
Create a new PVC YAML named newPVC.yaml with same configuration. Specify old PV name belongs to volumeName under the PVC spec.
Apply the modified PVC YAML using the following command
Example Output:
Get the newly created PVC UID using
kubectl get pvc mongo-persistent-storage-mongo-0 -o yaml
.Update the uid under the claimRef in the PV using the following command. The PVC will get attached to the PV after editing the PV with correct uid.
Get the updated PVC status using the following command.
Example Output:
Apply the same StatefulSet application YAML. The pod will come back online by re-using the existing PVC. The application pod status can be get by following command.
#
How to scale up Jiva replica?From 0.9.0 OpenEBS version, Jiva pod deployment are scheduling with nodeAffinity. For scaling up Jiva replica count, the following steps has to be performed.
Get the deployment details of replica of corresponding Jiva volume using the following command. If it is deployed in
openebs
namespace, use corresponding namespace appropriately in the following commands.Following is an example output.
Edit the corresponding replica deployment of the Jiva volume using the following command.
Example:
Perform Step 3 and 4 and then save the changes. It is required to modify the fields of replica count and hostname details where the replica pods has to be scheduled.
Edit
replicas
value underspec
with the required number. In this example, it wasreplicas: 1
during the initial deployment. With following change, replicas count will change to 2.Example:
Add corresponding hostnames under value in
spec.template.spec.affinity.nodeAffinity.nodeSelectorTerms.key.values
. The following is the sample snippet for adding the required hostnames. In the following snippet, it is added the hostname of second node in the mentioned path.After modifying the above changes, save the configuration. With this change , new replica pods will be running and following command will get the details of replica pods.
The following is an example output.
#
How to install OpenEBS in OpenShift 4.x#
Tested versionsOpenEBS has been tested in the following configurations;
OpenShift Version | OS | Status |
---|---|---|
4.2 | RHEL7.6, CoreOS 4.2 | Tested |
3.10 | RHEL7.6, CoreOS 4.2 | Tested |
#
Notes on securityNote: Earlier documentation for installing OpenEBS on OpenShift required disabling SELinux. This is no longer necessary - SELinux does not need to be disabled now.
Note: However, the OpenEBS operator, and some projects that use OpenEBS volumes do require privileged Security Context Constraints. This is described below.
#
Installation option: via the OperatorHubThe easiest way to install OpenEBS is by using the operator in the OperatorHub;
This guide recommends installing the operator into an empty openebs
namespace.
#
Installation option: via "manual" installFind the latest OpenEBS release version from here and download the latest OpenEBS operator YAML in your master node. The latest openebs-operator YAML file can be downloaded using the following way.
Apply the modified the YAML using the following command.
privileged
SCC to the openebs-maya-operator
service account#
Adding The examples below assume you have installed OpenEBS in the OpenEBS
project.
If you have used another namespace, change -n
accordingly.
Add the privileged
SecurityContextConstraint (SCC) to the OpenEBS service account;
Example output:
#
Quickly verifying the installationVerify OpenEBS pod status by using kubectl get pods -n openebs
, all pods
should be "Running" after a few minutes. If pods are not running after a few
minutes, start debugging with oc get events
and viewing these container logs.
If you are seeing errors with hostNetwork
or similar, this is likely because
the serviceAccount for that container has not been added to the privileged
SCC.
Next Steps:
- You may want to fully verifying the OpenEBS installation in more detail.
- After verification, you probably want to select a CAS Engine.
privileged
SCC to projects that use OpenEBS volumes#
Adding When you create a PVC using a StorageClass for OpenEBS, a ctrl
and rep
deployment will be created for that PVC. The rep
containers also need to be
privileged.
Switch to a project that is using OpenEVS PVs;
To stop the whole project running as privileged, you could create a new serviceAccount for the project, and only run the Deployment/pvc-...-rep using that service account.
However, an easy (and lazy, insecure) workaround is change this project's
default
ServiceAccount to be privileged.
Note: OpenShift automatically creates a project for every namespace, and a default
ServiceAccount for every project.
Once these permissions have been granted, you can provision persistent volumes using OpenEBS. See CAS Engines for more details.
#
How to enable Admission-Controller in OpenShift 3.10 and aboveThe following procedure will help to enable admission-controller in OpenShift 3.10 and above.
Update the
/etc/origin/master/master-config.yaml
file with below configuration.Restart the API and controller services using the following commands.
#
How to setup default PodSecurityPolicy to allow the OpenEBS pods to work with all permissions?Apply the following YAML in your cluster.
Create a Privileged PSP
Associate the above PSP to a ClusterRole
Associate the above Privileged ClusterRole to OpenEBS Service Account
Proceed to install the OpenEBS. Note that the namespace and service account name used by the OpenEBS should match what is provided in the above ClusterRoleBinding.
#
How to prevent container logs from exhausting disk space?Container logs, if left unchecked, can eat into the underlying disk space causing disk-pressure
conditions
leading to eviction of pods running on a given node. This can be prevented by performing log-rotation
based on file-size while specifying retention count. One recommended way to do this is by configuring the
docker logging driver on the individual cluster nodes. Follow the steps below to enable log-rotation.
Configure the docker configuration file /etc/docker/daemon.json (create one if not already found) with the log-options similar to ones shown below (with desired driver, size at which logs are rotated, maximum logfile retention count & compression respectively):
Restart the docker daemon on the nodes. This may cause a temporary disruption of the running containers & cause the node to show up as
Not Ready
until the daemon has restarted successfully.To verify that the newly set log-options have taken effect, the following commands can be used:
At a node-level, the docker logging driver in use can be checked via the following command:
The
LogConfig
section of the output must show the desired values:
At the individual container level, the log options in use can be checked via the following command:
The
LogConfig
section of the output must show the desired values:
To view the current & compressed files, check the contents of the
/var/lib/docker/containers/<container-id>/
directory. The symlinks at/var/log/containers/<container-name>
refer to the above.
NOTES:
The steps are common for Linux distributions (tested on CentOS, RHEL, Ubuntu)
Log rotation via the specified procedure is supported by docker logging driver types:
json-file (default), local
Ensure there are no dockerd cli flags specifying the
--log-opts
(verify viaps -aux
or service definition files in/etc/init.d
or/etc/systemd/system/docker.service.d
). The docker daemon fails to start if an option is duplicated between the file and the flags, regardless their value.These log-options are applicable only to the containers created after the dockerd restart (which is automatically taken care by the kubelet)
The
kubectl log
reads the uncompressed files/symlinks at/var/log/containers
and thereby show rotated/rolled-over logs. If you would like to read the retained/compressed log content as well usedocker log
command on the nodes. Note that reading from compressed logs can cause temporary increase in CPU utilization (on account of decompression actions performed internally)The log-opt
compress: true:
is supported from Docker version: 18.04.0. Themax-file
&max-size
opts are supported on earlier releases as well.
#
How to create a BlockDeviceClaim for a particular BlockDevice?There are certain use cases where the user does not need some of the BlockDevices discovered by OpenEBS to be used by any of the storage engines (cStor, LocalPV, etc.). In such scenarios, users can manually create a BlockDeviceClaim to claim that particular BlockDevice, so that it won't be used by cStor or Local PV. The following steps can be used to claim a particular BlockDevice:
Download the BDC CR YAML from
node-disk-manager
repository.Provide the BD name of the corresponding BlockDevice which can be obtained by running
kubectl get bd -n <openebs_installed_namespace>
Apply the modified YAML spec using the following command:
Note: The blockdeviceclaim CR should be created on the same namespace where openebs is installed.
Verify if particular BDC is created for the given BD cr using the following command:
#
How to provision Local PV on K3OS?K3OS can be installed on any hypervisor The procedure for deploying K3OS on VMware environment is provided in the following section. There are 3 steps for provisioning OpenEBS Local PV on K3OS.
- Configure server(master)
- Configure agent(worker)
- Deploying OpenEBS
The detailed information of each steps are provided below.
Configure server(master)
Download the ISO file from the latest release and create a virtual machine in VMware. Mount the ISO file into hypervisor and start a virtual machine.
Select Run k3OS LiveCD or Installation and press
<ENTER>
.The system will boot-up and gives you the login prompt.
Login as rancher user without providing password.
Set a password for rancher user to enable connectivity from other machines by running
sudo passwd rancher
.Now, install K3OS into disk. This can be done by running the command
sudo os-config
.Choose the option 1.Install to disk . Answer the proceeding questions and provide rancher user password.
As part of above command execution, you can configure the host as either server or agent. Select
1.server
to configure K3s master.While configuring server, set cluster secret which would be used while joining nodes to the server. After successful installation and server reboot, check the cluster status.
Run following command to get the details of nodes:
Example output:
Configure agent(worker)
Follow the above steps till installing K3OS into disk in all the hosts that you want to be part of K3s cluster.
To configure kubernetes agent with K3OS, select the option
2. agent
while runningsudo os-config
command. You need to provide URL of server and secret configured during server configuration.After performing this, Kubernetes agent will be configured as follows and it will be added to the server.
Check the cluster configuration by checking the nodes using the following command:
Example output:
Installing OpenEBS
Run the following command to install OpenEBS from master console:
Check the OpenEBS components by running the following command:
Note that
openebs-ndm
pods are in not created successfully. This is due to the lack of udev support in K3OS. More details can be found here.Now user can install Local PV on this cluster. Check the StorageClasses created as part of OpenEBS deployment by running the following command.
Example output:
The default StorageClass
openebs-hostpath
can be used to create local PV on the path/var/openebs/local
in your Kubernetes node. You can either useopenebs-hostpath
storage class to create volumes or create new storage class by following the steps mentioned here.Note: OpenEBS local PV will not be bound until the application pod is scheduled as its volumeBindingMode is set to WaitForFirstConsumer. Once the application pod is scheduled on a certain node, OpenEBS Local PV will be bound on that node.
#
How to make cStor volume online if 2 replicas of 3 are lost?Application that is using cStor volume can run IOs, if at least 2 out of 3 replicas (i.e., > 50% of ReplicationFactor) have data with them. If 2 out of 3 replicas lost data, cStor volume goes into RO (read-only) mode, and, application can get into crashed state. This section is to provide the steps to bring back volume online by scaling down replicas to 1 with a consideration of ReplicationFactor as 3 in the examples.
Perform the following steps to make the cStor volume online:
- Check the current state of CVRs of a cStor volume.
- Scaling down the replica count to 1 from 3.
- Make the volume mount point into RW mode from the Worker node where application is scheduled.
The detailed information of each steps are provided below.
Check the current state of CVRs of a cStor volume
Run the following command to get the current state of CVR of a cStor volume.
Output will be similar to the following:
Check the details of the corresponding cStor volume using the following command:
The following is a snippet of the output of the above command:
In the above snippet, quorum value of one replica is in
ON
and quorum value of other two areOFF
mode and cStor volume is inOffline
state. Running IOs now on this cStor volume will get IO error on Node as below:
Scaling down the replica count to 1 from 3.
At this point, user can make the target pod healthy with the single replica which is in quorum.
Note: Target pod is made healthy on the assumption that the replica which is in quorum have the latest data with it. In other words, only the data that is available with the replica which is in quorum will be served.
The following steps will help to make the target pod healthy with a single replica which is in quorum.
Edit CStorVolume CR to set ReplicationFactor and ConsistencyFactor to 1.
Check the details of the corresponding cStor volume using the following command:
The following is a snippet of the output of the above command:
Restart target pod by running following command
Now the cStor volume will be running with a single replica.
Make the volume mount point into RW mode from the Worker node where application is scheduled.
Next, user should make the volume mount point into RW mode using the following steps.
If mount point of the volume went to RO, restart the application pod to bring back the mount point to RW state.
If application still remains in
CrashLoopback
state due to RO mode of mount point (kubectl describe
of application pod will show the reason), follow below steps to convert it into RW:Login to node where application pod is running.
Get the node details where the application pod is running using the following command.
After identifying the node, ssh into the node.
Find the iSCSI disk related to this PVC.
Run following command inside the node to get the iSCSI disk related to the PVC.
The output will be similar to the following:
From the above output, user can obtain the iSCSI disk related to this PV. In this example, SCSI disk related to this PV is
sdb
.Unmount the mount points related to this PVC that are in RO.
Next, perform unmount operation on mount points that are related to sdb. The following output will help to get the mount details related to disk sdb:
The output will be similar to the following:
Perform unmount on the above found mountpoints.
Perform
iscsiadm logout
andiscsiadm login
of the iSCSI session related to this PVC.From the node related to application pod, perform below command to logout:
From the node related to application pod, perform below command to login:
Find the new iSCSI disk related to this PVC.
Get the new iSCSI disk name after login using the following command:
Output will be similar to the following:
Mount the mount points that are unmounted in 3rd step .
Perform mount of the SCSI disk on the mount points which are unmounted in 3rd step. The application may still remain in RO state. If so, restart the application pod.
#
How to reconstruct data from healthy replica to replaced ones?Consider the case where cStorVolumes have replication enabled, and one/few of its replicas got replaced, i.e., they are new and lost the data. In this case, cStor volume will be in Offline state and unable to recover data to the replaced replicas from healthy replica automatically.
Reconstructing data from healthy replica to the replaced ones can be done using the following steps. To perform the following steps, cStor volume should be in Online
. If cStor volume is not in Online
, make it online using the steps mentioned here.
Run the following command to get the current state of CVR of a cStor volume.
Output will be similar to the following:
For easy representation, healthy replica will be referred to as R1, and offline replica that needs to be reconstructed with data will be referred to as R2. User should keep the information of healthy replica and replaced replica and associated pool in handy.
In this example, R1 is pvc-5c52d001-c6a1-11e9-be30-42010a800094-cstor-sparse-pool-sb1v
and R2 is pvc-5c52d001-c6a1-11e9-be30-42010a800094-cstor-sparse-pool-a1ud
. Pool name associated to R1 is cstor-sparse-pool-sb1v-77658f4c85-jcgwc
and pool name related to R2 is cstor-sparse-pool-a1ud-5dd8bb6fb6-f54md
. Pool name can be found by doing zpool list
in the pool pod of that particular node.
The following are the steps to reconstruct data from healthy replica to a replaced replica:
- Take base snapshot on R1.
- Copy the base snapshot to R2’s node.
- Apply the base snapshot to the pool of R2.
- Take incremental snapshot on R1.
- Copy the incremental snapshot to R2’s node.
- Apply the above incremental snapshot to the pool of R2.
- Repeat steps 4, 5 and 6 till incremental snapshot is of lesser size.
- Scale down spec.replicas to 0 of client application so that final changes can be transferred.
- Scale down spec.replicas of target pod deployment to 0.
- Perform steps 4, 5 and 6.
- Set TargetIP and Quorum properties on R2.
- Edit cStorVolume CR of this PVC to increase
ReplicationFactor
by 1 and to setConsistencyFactor
to (ReplicationFactor/2 + 1). - Scale up
spec.replicas
to 1 of target pod deployment. - Scale up
spec.replicas
of client application - Edit cStorVolume CR of this PVC to increase
ReplicationFactor
by 1 and to setConsistencyFactor
to (ReplicationFactor/2 + 1). - Restart the cStor target pod deployment.
Step1: Take base snapshot on R1.
Exec into cstor-pool-mgt container of pool pod of R1 to run snapshot command:
Run the following command inside the pool pod container to take the base snapshot
Example command:
Step2: Copy the base snapshot to R2’s node.
There are multiple ways to do this. In this article, above created snapshot is streamed to a file. This streamed file is copied to node related to R2. As /tmp directory of the pool pod is mounted on the host node at /var/openebs/sparse/shared-<spc name>
, streamed file will be created at R1 and copied at R2 to this location.
Stream snapshot to a file:
Exec into cstor-pool-mgmt container of pool pod of R1 to run the below command:
Example command:
Copy the streamed file to local machine:
Copy the local copy of streamed file to another node:
Step3: Apply the base snapshot to the pool of R2
Applying base snapshot to pool related to R2 involves setting a few parameters. Below are the steps:
Exec into
cstor-pool-mgmt
container of pool pod related to R2.Example command:
Identify the PV related datasets.
The output will be similar to the following:
Look for PV name in the above list output. In this example, datasets that are in bold are related to this PV.
Note: Dataset which is
<pool name>/<PV name>
is the main replica. Dataset that ends with@rebuild_snap
is the internally created snapshot, and the one that ends with_rebuild_clone
is internally created clone.Unset target IP on the main volume.
Run the following command to unset target ip on the main volume:
Example command:
Delete rebuild_snap snapshot.
Note: Below are destructive steps and need to be performed on verifying that they are the correct ones to be deleted.
Example command:
Delete internally created clone related to this PV with suffix as _rebuild_clone.
Note: Below are destructive steps and need to be performed on verifying that they are the correct ones to be deleted.
Example command:
Apply the streamed file to offline pool:
Example command:
Capacity “USED” can be verified by doing
zfs list -t all
Step4: Take incremental snapshot on R1
From
cstor-pool-mgmt
container of pool pod related to R1, perform following command:Example command:
Please note that snapshot name which is <incr_snap_name> as mentioned above need to be different for each incremental snapshot.
Step5: Copy the data in incremental snapshot to R2’s node
This involves streaming the incremental data to a file, copying it to R2.
Stream incremental snapshot to a file:
From cstor-pool-mgmt container of pool pod of R1, run below command:
Example command:
Copy the streamed file to R2 following the steps similar to copying the streamed file related to base snapshot.
Step6: Apply the above incremental snapshot to pool of R2
Exec into
cstor-pool-mgmt
container of pool pod of R2 to run:Example command to apply incremental snapshot:
zfs list -t all
should show the dataset related to this PVC with increased "USED" space.Example command:
Output will be similar to the following:
Step7: Repeat steps 4, 5 and 6 till incremental snapshot is of lesser size
Step 8: Scale down spec.replicas
to 0 of client application so that final changes can be transferred.
Step 9:Scale down spec.replicas
of target pod deployment to 0.
Step 10: Perform steps 4, 5 and 6
Step 11: Set TargetIP and Quorum properties on R2
Once steps 8,9 and 10 are followed, set targetIP
and quorum properties of newly reconstructed R2.
Set quorum on the newly reconstructed dataset on R2.
In the cstor-pool-mgmt container of pool pod related to R2, perform the following command:
Example command:
Set
targetIP
on the newly rebuilt dataset on R2Example command:
Step 12: Edit ‘CStorVolume’ CR of this PVC to increase ReplicationFactor
by 1 and to set ConsistencyFactor
to (ReplicationFactor/2 + 1)
Step 13: Scale up spec.replicas
to 1 of target pod deployment
On performing step 12 and 13, this newly reconstructed replica gets added to the cStor volume.
Status of CStorVolume and CVRs related to this PV looks like:
Check the details of the corresponding cStor volume using the following command:
The following is a snippet of the output of the above command:
Step 14: Scale up spec.replicas
of client application.
Step 15: To make third replica healthy, edit ‘CStorVolume’ CR of this PVC to increase ReplicationFactor
by 1 and to set ConsistencyFactor
to (ReplicationFactor/2 + 1). After doing this change, ReplicationFactor
will be 3 and ConsistencyFactor
to 2.
Step 16: Restart the cStor target pod deployment of the volume using the following command:
Step 17: After sometime, the third replica will come to healthy state. Status of CVRs related to this PV will looks like below:
#
How to verify whether cStor volume is running fine?#
OverviewThe following items will be discussed:
- Verification of cStor Storage Pool(CSP)
- Verification of cStor Volume
- Verification of cStor Volume Replica(CVR)
#
Verification of cStor Storage PoolcStor Storage Pool(CSP) resources are cluster scoped. Status of CSPs can be obtained using the following way.
Example output:
Status of each cStor pool can be found under STATUS
column. The following are the different type of STATUS
information of cStor pools and their meaning.
Healthy: This state represents cStor pool is online and running.
Offline: cStor pool status is offline due to the following cases:
- when pool creation or pool import is failed.
- when a disk is unavailable in case of the pool is created in a striped manner.
- when tampering happens on CSP resource and invalid values are set then CSP will be updated to offline.
Degraded: cStor pool status is degraded due to the following cases:
- when any one of the disks is unavailable on the node where the pool is created either Mirror, Raidz or Raidz2 manner.
Error: This means cstor-pool container in cStor pool pod is not in running state.
DeletionFailed: There could be an internal error occurred when CSP is deleted.
Note: Status of CSPs are updated only if its corresponding cStor pool pod is Running. If the cStor pool pod of corresponding cStor pool is not running, then the status of cStor pool shown in the above output may be stale.
#
Verification of cStor VolumecStor Volume is namespace scoped resource. You have to provide the same namespace where openebs is installed. Status of cStor Volume can be obtained using the following way.
Example command:
Example output:
Status of each cStor volume can be found under STATUS
field.
Note: If the target pod of corresponding cStor volume is not running, then the status of cStor volume shown in the above output may be stale.
The following are the different type of STATUS information of cStor volumes and their definition.
Init: Init status of cStor volume is due to the following cases:
- when the cStor volume is created.
- when the replicas are not connected to target pod.
Healthy: Healthy status of cStor volume represents that 51% of healthy replicas are connected to the target and volume is ready IO operations.
Degraded: Minimum 51% of replicas are connected and some of these replicas are in degraded state, then volume will be running as degraded state and IOs are operational in this state.
Offline: When number of replicas which is equal to Consistency Factor are not yet connected to the target due to network issues or some other reasons In this case, volume is not ready to perform IOs.
For getting the number of replicas connected to the target pod of the cStor volume, use following command:
Example output:
In this case, replicationFactor is 3.
In the above output, if quorum: **0**
then data written to that replica is lost(not ready to read). If quorum: **1**
then that replica is ready for Read and Write operation.
If anything went wrong then the error can be seen in cStor volume events kubectl describe cstorvolume <volume_name> -n <openebs_installed_namespace>
#
Verification of cStor Volume ReplicacStor Volume Replica is namespace scoped resource. You have to provide the same namespace where OpenEBS is installed. Status of cStor Volume Replica can be obtained using the following way.
Example command:
Example output:
Status of each cStor volume Replica can be found under STATUS
field.
Note: If the pool pod of corresponding cStor volume replica is not running, then the status of CVR shown in the output of the above command may be stale.
The following are the different type of STATUS information of cStor Volumes Replica and their definition.
Healthy: Healthy state represents volume is healthy and volume data existing on this replica is up to date.
Offline: cStor volume replica status is offline due to the following cases:
- when the corresponding cStor pool is not available to create volume.
- when the creation of cStor volume fails.
- when the replica is not yet connected to the target.
Degraded: cStor volume replica status is degraded due to the following case
- when the cStor volume replica is connected to the target and rebuilding is not yet started on this replica.
Rebuilding: cStor volume replica status is rebuilding when the cStor volume replica is undergoing rebuilding, that means, data sync with another replica.
Error: cStor volume replica status is in error state due to the following cases:
- when the volume replica data set is not existing in the pool.
- when an error occurs while getting the stats of cStor volume.
- when the unit of size is not mentioned in PVC spec. For example, if the size is 5 instead of 5G.
DeletionFailed: cStor volume replica status will be in deletion failed
when destroying corresponding cStor volume fails.
Invalid: cStor volume replica status is invalid when a new cstor-pool-mgmt container in a new pod is communicating with the old cstor-pool container in an old pod.
Init: cStor volume replica status init represents the volume is not yet created.
Recreate: cStor volume replica status recreate represents an intermediate state before importing the volume(this can happen only when pool pod got restarted) in case of a non-ephemeral disk. If the disk is ephemeral then this status represents volume is going to recreate.
NewReplicaDegraded: cStor volume replica is newly created and it make successful connection with the target pod.
ReconstructingNewReplica: cStor volume replica is newly created and it started reconstructing entire data from another healthy replica.
Note: If cStor Volume Replica STATUS
is in NewReplicaDegraded
or NewReplicaReconstructing
, then the corresponding volume replica will not be part of the quorum decisions.
#
Expanding Jiva Storage VolumesYou can resize/expand the OpenEBS volume using the following procedure. Execute the commands from step 2 to 8 as root user on the node where application pod is running.
Step 1: Identify the node where application pod is running. Also note down the IP address of corresponding Jiva controller pod. This IP address is needed in step 7. The above details can be obtained by running the following command:
Example:
Example output:
In the above sample output, application pod is running on node gke-ranjith-jiva-resize-default-pool-ec5045bf-mzf4
and Jiva controller pod IP is 10.16.1.8
.
Step 2: SSH to the node where application pod is running and run the following command.
Example output:
In the above sample output, sdb
is the target volume with 5G
capacity. Similarly, find out the volume which needs to be resized.
Step 3: Obtain the iSCSI target and disk details using the following command.
Example output:
In the above sample output, there is only one volume present on the node. So it is easy to get the iSCSI target IP address and the disk details. In this example disk is sdb
, iSCSI target IP is 10.20.23.99:3260
, and target iqn is iqn.2016-09.com.openebs.jiva:pvc-25e8f6f1-eb2d-11e9-b8d1-42010a800093
. Similarly, find out the target IP address, IQN and the disk name of the volume that has to be resized and note down these information for future use. If there are many volumes attached on the node, then identify the disk using the PV name.
Step 4 Check the mount path on disk sdb
using the following command.
Example snippet of Output:
Step 5: Unmount the file system using following command. The following is an example command with respect to the above output. Update correct mount path according to your deployment. Ensure that you are running following commands as super user.
Step 6: Logout from the particular iSCSI target using the following command:
Example:
Example output:
Step 7: Get the volume ID using the following command:
Example:
Example output:
From above example output, You can find volume id is cHZjLTI1ZThmNmYxLWViMmQtMTFlOS1iOGQxLTQyMDEwYTgwMDA5Mw==
, Jiva target pod IP is 10.16.1.8
, and the Volume name is pvc-25e8f6f1-eb2d-11e9-b8d1-42010a800093
. These parameters are required in the next step.
Step 8: Specify desired size of volume and the above parameters in the following command.
Example output:
From the above output, volume has been expanded to 8G
.
Step 9: Run step 9 and step 10 from Kubernetes master node. Get the Jiva pod details using the following command:
Example output:
Step 10: Restart all replica pods of the corresponding volume using the following command. If the replica count of Jiva volume is more than 1, then you must delete all the replica pods of corresponding Jiva volume simultaneously using single command.
Example:
Example output:
Verify if new Jiva pods are running successfully using:
Step 11: Perform step 11 to 15 as root user on node where the application pod is running. Perform iSCSI target login using the following commands.
Example:
Example output:
From above output, iSCSI target IP is 10.20.23.99:3260
.
Now, Login to the iSCSI target using the following command:
Example output:
Step 12: Verify the resized disk details using the following command:
Example output:
From the above output, You can see the resized disk is sdc
with 8G capacity.
Step 13: Check the file system consistency using the following command:
In following example, /dev/sdc is the newly expanded disk.
Example output:
Step 14: Expand the file system using the following command. In the following example, /dev/sdc
is the newly expanded disk.
Example output:
Step 15: Mount the file system using the following commands as root user:
Step 16: Execute the below command in Kubernetes master node. Restart the application pod using the following command:
Verify if the application pod is running using the following command. Note down the node where the application pod is running now.
Example output:
Step 17: Identify the node where new application pod is running. Then SSH to the node to verify the expanded size and execute the following command:
Example output:
Step 18: Verify the expanded size from application pod.
Note: After the volume expansion, size will not be reflected on kubectl get pv
for the corresponding volume.