Creating, Developing, and Testing a Helm Chart
Installing and Testing the Chart Locally
After testing the chart locally, we can install it in our cluster using the helm install command and a custom values file. This will let us verify that the chart works as expected in a real Kubernetes environment. The installation will pull the image from our Harbor registry, which is protected with a login and a password. Therefore, in addition to the custom values file, we need to create a Docker registry secret and link it to the ServiceAccount used by our application Pods.
To do this, let's create a folder to store our custom values file:
# Create another directory to store the custom values file
mkdir -p $HOME/todo-chart-custom
Then, run the following command to create the custom values file:
# Create the custom values file
cat < $HOME/todo-chart-custom/values.yaml
replicaCount: 1
image:
repository: $MASTER_PUBLIC_IP:30003/todo-app/todo-app
tag: "1.0.0"
pullPolicy: IfNotPresent
imagePullSecrets:
- name: harbor-registry-secret
serviceAccount:
create: true
name: todo-chart-service-account
imageCredentials:
create: true
registry: "$MASTER_PUBLIC_IP:30003"
username: "admin"
password: "Harbor12345"
secretName: "harbor-registry-secret"
EOF
We can install the chart using the custom values file and a dry run to simulate the installation at the beginning:
Helm in Practice
Designing, Deploying, and Operating Kubernetes Applications at ScaleEnroll now to unlock current content and receive all future updates for free. Your purchase supports the author and fuels the creation of more exciting content. Act fast, as the price will rise as the course nears completion!
Hurry! This limited time offer ends in:
To redeem this offer, copy the coupon code below and apply it at checkout:
