Exploring Kubernetes Deployments with Meshery
Introduction
In this tutorial, weβll learn about Kubernetes Deployments. Using Meshery Playground, an interactive live environment, weβll perform hands-on exercises to gain practical experience in deploying, managing, and understanding a Kubernetes Deployment without writing any YAML.
NOTE: If this your first time working with Meshery Playground, consider starting with the Exploring Kubernetes Pods with Meshery Playground tutorial first.
Prerequisites
- Basic understanding of containerization and Kubernetes concepts.
- Access to the Meshery Playground. If you donβt have an account, sign up at Meshery Playground.
Lab Scenario
Launch a sample app in a Kubernetes cluster using Deployments.
Objective
Learn how to create, manage, and explore Kubernetes Deployments within the context of a microservices architecture.
Steps
Access Meshery Playground
- Log in to the Meshery Playground using your credentials. On successful login, you should be at the dashboard. Press the X on the Where do you want to start? popup to close it (if required).
-
Click Kanvas from the left menu to navigate to the Kanvas design page.
NOTE: Kanvas is still in beta.
Create a Deployment
- In the Kanvas Design page, start by renaming the design to a name of your choice for easier identification later.
- From the floating dock below, click the Kubernetes icon and then click Deployment from the list. This will create the Deployment component on the design canvas.
- Click once to select the Deployment component and choose Configure.
- Change the Name of the deployment and the Namespace if required. For this demonstration, we will leave them as they are and deploy this to the default namespace.
- A deployment consists of replicas. We must set a value for Replicas. If nothing is set, the default is 1. For this example we will set it to 2. We must also set the Selector property. To do this, expand Selector and click MatchLabels. Set a matchLabel pair. Here we have set
tutorial:deployment
. - Next, expand Templates and open Metadata configuration modal. On the metadata modal, click + next to Labels and set the label to the same key-value pair as in the previous step. Here it is
tutorial:deployment
. - While still under Template and click Spec to load the spec configuration modal. Then scroll down and click + next to Containers. This will create a container.
- Expand Containers-1 and fill in the mandatory details such as Image and Name. For this example we set the Image to
meshery/meshery-milestone:latest
and Name tomeshery-milestone
. - Click on an empty area in the canvas to close the configuration modals. This completes designing the Deployment and should looks similar to the screenshot below.
Validating and deploying the Deployment
In the next set of steps we will validate the design and deploying it.
-
To validate the design, click Actions and then Validate from the top menu.
This should show a pop-up with details such as the number of components, annotations and validation errors (if any). Ensure there are no errors before deploying. If there are errors, fix them before moving forward.
-
To deploy, click Actions and then Deploy to load the deployment workflow. The first step is design validation which should already be marked as done. Click Next.
-
In the following step, select the Deployment Targets where you want to deploy this. When done click Next.
-
In the third step, a Dry Run is performed. Fix any errors displayed here.
-
Finally, click Deploy in the next step. You may choose to open the design in Operate mode after this step to explore the resources by checking the Open in Operator checkbox.
-
Click Finish to close the workflow.
You should see a few alerts on the bottom right about the deployment.
Viewing and Operating the Deployment
To view and perform operations on the resources deployed, i.e. the Deployment in this exmaple, we will use the Operate functionality of Kanvas. You can open the design in Operate mode during the Deploy workflow or later by click the Operate tab. It will load the deployed resources in Operate view similar to the screenshot below.
You can click on any of the resources to view various details and actions applicable to them. For example, click on the Deployment i.e. deployment-bl
in this case (shown with a green border in the image below), to view deployment details such as Age, Kind, Pods, Replicas, Namespace etc.
Take some time to explore other resources such as Pod, Container etc.
Deleting the Deployment
To delete the deployment, click Actions and select Undeploy.
Follow the Undeploy workflow (similar to the Deploy workflow) and click Undeploy in the Finalize Deployment step.
Conclusion
Congratulations! Youβve successfully completed the lab on Exploring Kubernetes Deployments with Meshery Playground.
Continue exploring more scenarios in the Meshery Playground to enhance your skills.
Suggested Reading
- Deploy AWS EC2 Instances with Meshery - Learn how to deploy and manage AWS EC2 instances through Kubernetes with Meshery, utilizing AWS Controllers for Kubernetes (ACK) to enhance cloud resource management
- Deploying Apache Cassandra with a StatefulSet in Meshery Playground - Deploy Apache Cassandra with a StatefulSet using Meshery Playground in an interactive live cluster environment.
- Deploying PHP Guestbook application with Redis in Meshery - In this tutorial, we will deploy guest book built with PHP and Redis in Kubernetes. We will make use of Meshery Playground in an interactive live cluster environment.
- Embedding a Meshery Design in a WordPress Post - Learn how to Embed a Meshery Design in a WordPress Post
- Exploring Kubernetes CronJobs - In this tutorial, we will explore how to use Meshery Playground, an interactive live cluster environment, to perform hands-on labs for managing Kubernetes CronJobs.
- Understanding Kubernetes ConfigMaps and Secrets with Meshery - In this tutorial, we will explore how to effectively use Kubernetes ConfigMaps and Secrets for managing configuration data and sensitive information. Leveraging Meshery Playground, an interactive live cluster environment, we'll perform hands-on labs to understand the practical aspects of working with ConfigMaps and Secrets in Kubernetes.
- Exploring Kubernetes Pods with Meshery - Explore Kubernetes Pods using Meshery in an interactive live cluster environment, through a series of hands-on exercises.
- Publishing Meshery Designs to ArtifactHub - Step by step example for how to export Meshery Designs and publish them to an ArtifactHub repository.
- Deploying WordPress and MySQL with Persistent Volumes with Meshery - Deploy a WordPress site and a MySQL database with Persistent Volumes using Meshery Playground in an interactive live cluster environment.