Cloudplex

Cloudplex

  • Product
  • Features
  • About
  • GET STARTED FREE

›Docusaurus

Docusaurus

  • AKS Provider Managed KubePlex
  • AWS User Managed KubePlex
  • Pods And Containers Lab
  • Container Service with Persistent Volume
  • Container Service with Secret
  • AKS Provider Managed Infrastructure
  • AWS User Managed Infrastructure

Container Service with Persistent Volume

Objective

In this lab, you will learn how to deploy a MySQL server using Cloudplex integrated Docker-Hub which will be used to pull pre-build MySQL image and use Persistent Volume to store data.

Prerequisite

If you want to deploy this lab, you need to deploy at least one infrastructure. We have labs on infrastructure as well, you can follow them to deploy infrastructure

Add Application Info

Give name to your application and specify the version, you can also give tags to your application of your choice.

app-info

Click on the next button on the top right corner.

Add Secret Service

CloudPlex platform provides a secret management service that provides the ability to store sensitive data such as passwords, tokens, and certificates in Cloudplex. Any data entered in this service is stored in a secure vault with at-rest encryption. This eventually becomes a Kubernetes Secret in a deployed application.

To configure the service, Drag-n-drop Secret service from pallet to the canvas.

secret-service

Click on the service to open the configuration panel on the right side.

The platform will populate the default values of service (Service Id, Service Name, Namespace)

secret-service-info

Click on Add secret string and type MYSQL_ROOT_PASSWORD in key and the Password in the value field. For this lab, type (the password as shown) 5dzo2MsriVJNYTTtud8gOyDc3A in the value field.

secret-key-password

key : MYSQL_ROOT_PASSWORD
value : 5dzo2MsriVJNYTTtud8gOyDc3A

Click on save button to save service

button-save

Configure the MySQL Container

Drag-n-drop the Docker Hub service from pallet to the canvas.

docker-hub-service

Drag the arrow from Secret service to Container service.

dockerhub-secret-link

Click on the service to open the configuration panel on the right side.

docker-hub-service-configuration

Type MySQL in the search bar and click on the search button.

mysql-search

Select MySQL service.

mysql-service

CloudPlex automatically pulls all the tags and metadata of the image and populates default values of service (Service Id, Service Name, Namespace, Type)

Add Environment Variables

Click on the Environment variables section to add a new environment variable.

Cloudplex provides two types of variables (Static, Dynamic). We are going to use Dynamic variable in this lab to use the Secret key in our container

dynamic-parameters

Select the secret service from the service drop-down and type MYSQL_ROOT_PASSWORD in the key field.

dynamic-variables-key

Expand Service Attributes and Secrets Data and select MYSQL_ROOT_PASSWORD. Cloudplex automatically generates dynamic parameters for you.

dynamic-variables-key-select

Click on the save button to save the parameters.

save-button-2

A new environment variable with the key MYSQL_ROOT_PASSWORD will be added in the list of Environment Variables.

saved-environment-variable

Click on the back button on top of the configurations.

Add new Port

Ports are required to access your applications. Click on the Port section to add a new port

Add-Ports-01

Cloudplex automatically discovers ports from Docker images and populates them in the ports section of the service.

Add-Ports-02

Click on the save button to save the service.

service-save

Add Volume Service

A PersistentVolume (PV) is a piece of storage in the cluster that has been dynamically provisioned by Kubernetes using a StorageClass.

MySQL service used this block of storage to store its data.

To add a persistent storage to your MySQL Service, Click on the MySQL service to open the service configurations on the right side and click on Advanced Configurations

container-service-advanced-configuration

Select container volumes. CloudPlex has integrated with all the volumes and provides an easy to use interface for all of them.

container-volumes

For this lab, let's select persistent volume. Select Volume from service dropdown. If you don't have any volume available on canvas, you can create a new volume config by providing simple configurations.

Click on new from the service dropdown and CloudPlex will take you to the volume configurations panel.

new-volume-service

CloudPlex automatically populates default values of service (Service Id, Service Name, Namespace)

Enter desired capacity 10Gi and Reclaim policy Delete from dropdown. The reclaim policy for a PersistentVolume tells the cluster what to do with the volume after it has been released of its claim

policy-and-capacity

Click on the save button to save the configuration

button-save

Now you are back to your container service where you left it, Click on the label of the attached volume and provide mount path.

mount-path

Click on the save button to save the service.

save-service

All the Kubernetes manifest required to create a persistent volume (persistent volume claim, storageclass) is automatically created by the platform.

A PersistentVolumeClaim (PVC) is a request for storage by a user and a StorageClass provides a way for administrators to describe the "classes" of storage they offer

Deploy Application

Click on the Deploy button at the top right corner and select the Infrastruture from the drop down list of your deployed infrastructures, your deployment will start right after saving the application and it will redirect you to the logs tabs or you can save it by clicking on the Save button to deploy it later.

In the log window, you can see the logs of your application.

app-deployment-logs

!! Deployment will take around 2 minutes!!

You can see the status of the application you just deployed by clicking on the app tab and click on Table view to see the realtime status of the services.

app-status

Cleanup

To avoid unnecessary costs, don’t forget to terminate your application when you are done. Click on the Terminate button to terminate your application and dont forget to Terminate the infrastrusture(s) that you used to deploy this lab.

Conclusion

Congratulations! you just completed this lab and learned how to run a My-SQL server with Persistent Volume on Kubernetes using Cloudplex platform.

← Pods And Containers LabContainer Service with Secret →

PRODUCT

  • Product
  • Features

RESOURCES

  • Blogs & Tutorials
  • Free eBooks
  • Video
  • Documentation
  • Hands-on Labs

COMPANY

  • About
  • Terms of Service
  • Privacy Policy
  • Terms of Website Use

GET YOUR KUBERNETES APPLICATIONS UP AND RUNNING IN MINUTES

GET STARTED FREE
footer-logo