Helm for beginer - Deploy nginx to Google Kubernetes Engine
Introduction
Helm is a package manager for Kubernetes, which simplifies the process of deploying and managing applications on Kubernetes clusters. Helm uses a packaging format called charts, which are collections of files that describe a related set of Kubernetes resources.Key Components of Helm
- Charts: Helm packages are called charts. A chart is a collection of files that describe a related set of Kubernetes resources. A single chart might be used to deploy something simple, like a memcached pod, or something complex, like a full web app stack with HTTP servers, databases, caches, and so on.
- Values: Charts can be customized with values, which are configuration settings that specify how the chart should be installed on the cluster. These values can be set in a `values.yaml` file or passed on the command line.
- Releases: When you install a chart, a new release is created. This means that one chart can be installed multiple times into the same cluster, and each can be independently managed and upgraded.
Prerequisites
- Have some knowledge about Kubernetes. You can check out this article for basic information.
- A Google Account with the necessary permissions to use Kubernetes.
- Installed gcloud and kubectl
Practical Steps
To create a helm chart, use the following command:
After executing, a template is created that includes files like development.yaml, service.yaml, and others, similar to working with Kubernetes. Among these files, pay special attention to values.yaml. The values in this file are bound to the template when Helm is installed. By simply changing these values according to your needs, you can easily modify the deployment configuration.
Next, in the values.yaml file, look for the following information:
- The repository is a Docker image used for deployment, which you can customize as needed.
- The current service type is ClusterIP, using port 80.
Here, you can change the service type to LoadBalancer. Then, install helm chart as follows:
The change to a LoadBalancer service type allows your cloud provider to supply an EXTERNAL-IP. You can then retrieve the EXTERNAL-IP information as follows:
If you keep the original content of the values.yaml file, you can install helm chart and change the service type to LoadBalancer like this:
Access the EXTERNAL-IP to see the following results:
Result |
Comments
Post a Comment