There are some instances in which a chart for your application might not exist and one must be created; in other cases, you might have a Kubernetes deployment that you want to convert into a Helm chart. In this hands-on lab, we will take an existing deployment and convert it into a Helm chart.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Convert the Service Manifest into a Service Template in a New Helm Chart
Create a folder for the new chart and name it
blog
. Create the minimum necessary scaffolding for the new chart. Locate the existing manifest for the service in the/home/cloud_user/kubernetes
directory. Copy theservice.yaml
file into the new charts template directory. Take the necessary values from theservice.yaml
file and create entries in thevalues.yaml
file. Create the necessary directives to set the values in theservice.yaml
template. Make sure the service type isNodePort
and the nodePort value is30080
.- Convert the Application Manifest into a Deployment Template in a New Helm Chart
Locate the existing manifest for the application in the
/home/cloud_user/kubernetes
directory. Copy theapplication.yaml
file into the new charts template directory and name itdeployment.yaml
. Take the necessary values from thedeployment.yaml
file and create entries invalues.yaml
. Create the necessary directives to set the values in the service.yaml template.- Ensure the Manifests Render Correctly and Deploy the Application as a NodePort Application
Use the
--dry-run
option of theinstall
command to review the manifests and ensure they render correctly. After they are verified, deploy the application, then access the appliation on the primary server’s public IP address at the node port.