Deploy an Application
info
- Refer to the Local PV LVM Deployment documentation to deploy Local PV LVM.
- Refer to the Local PV ZFS Deployment documentation to deploy Local PV ZFS.
- Refer to the Replicated PV Mayastor Deployment documentation to deploy Replicated PV Mayastor.
#
Deploy an ApplicationThis section will help you to deploy an application.
#
Create a PersistentVolumeClaimThe next step is to create a PersistentVolumeClaim. Pods will use PersistentVolumeClaims to request Hostpath Local PV from the OpenEBS Dynamic Local PV provisioner.
Here is the configuration file for the PersistentVolumeClaim. Save the following PersistentVolumeClaim definition as
local-hostpath-pvc.yaml
Create the PersistentVolumeClaim
Look at the PersistentVolumeClaim:
The output shows that the
STATUS
isPending
. This means PVC has not yet been used by an application pod. The next step is to create a Pod that uses your PersistentVolumeClaim as a volume.
#
Create Pod to Consume OpenEBS Local PV Hostpath StorageHere is the configuration file for the Pod that uses Local PV. Save the following Pod definition to
local-hostpath-pod.yaml
.note
As the Local PV storage classes use
waitForFirstConsumer
, do not usenodeName
in the Pod spec to specify node affinity. IfnodeName
is used in the Pod spec, then PVC will remain inpending
state. Refer to the issue #2915 for more details.Create the Pod:
Verify that the container in the Pod is running.
Verify that the data is being written to the volume.
Verify that the container is using the Local PV Hostpath.
The output shows that the Pod is running on
Node: gke-user-helm-default-pool-3a63aff5-1tmf
and using the persistent volume provided bylocal-hostpath-pvc
.Look at the PersistentVolumeClaim again to see the details about the dynamically provisioned Local PersistentVolume
The output shows that the
STATUS
isBound
. A new Persistent Volumepvc-864a5ac8-dd3f-416b-9f4b-ffd7d285b425
has been created.Look at the PersistentVolume details to see where the data is stored. Replace the PVC name with the one that was displayed in the previous step.
The output shows that the PV was provisioned in response to PVC request
spec.claimRef.name: local-hostpath-pvc
.
note
A few important characteristics of an OpenEBS Local PV can be seen from the above output:
spec.nodeAffinity
specifies the Kubernetes node where the Pod using the Hostpath volume is scheduled.spec.local.path
specifies the unique subdirectory under theBasePath (/var/local/openebs)
defined in the corresponding StorageClass.
#
Deploy Stateful WorkloadsThe application developers will launch their application (stateful workloads) that will in turn create Persistent Volume Claims for requesting the Storage or Volumes for their pods. The Platform teams can provide templates for the applications with associated PVCs or application developers can select from the list of Storage Classes available for them.
As an application developer, all you have to do is substitute the StorageClass
in your PVCs with the OpenEBS Storage Classes available in your Kubernetes cluster.
Here are examples of some applications using OpenEBS:
- PostgreSQL
- Percona
- Redis
- MongoDB
- Cassandra
- Prometheus
- Elastic
- MinIO
#
Managing the Life Cycle of OpenEBS ComponentsOnce the workloads are up and running, the platform or the operations team can observe the system using the cloud native tools like Prometheus, Grafana, and so forth. The operational tasks are a shared responsibility across the teams:
- Application teams can watch out for the capacity and performance and tune the PVCs accordingly.
- Platform or Cluster teams can check for the utilization and performance of the storage per node and decide on expansion and spreading out of the Data Engines.
- Infrastructure team will be responsible for planning the expansion or optimizations based on the utilization of the resources.