Deploying The Application With Helm 3
Video
Setting Up To Deploy With Helm 3
Helm helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
We do not have the time to completely explain creating a Helm chart for this application, and besides we want you to come back in couple of weeks when my colleague Jamie Land will be telling you about Helm. In this case, we're just going to customized some values in a chart to deploy our application.
- Ensure you are logged in to your Kubernetes or OpenShift cluster If you are using Minikube or KInD it should log you in on start
- Ensure you are currently associated with a namespace where you can deploy resources (kubectl use <namespace> or oc project <namespace>)
- Look at the
values.yaml
file in the<solution root>/helm
directory- Note the image name/repository and change it to point to where you have published your container
- Install the application using the Helm 3 CLIbash
cd <solution root>/helm helm install <identifier> ./
- The identifier just needs to be unique, but it can be almost any random string. Best practices indicate it should be numerical and probably align with your application version.
- Take a look at your namespace and you should see the ASP.NET application running and the PostgreSQL StatefulSet running as well.
NOTE: Something to be aware of is that when you deploy your application, the database may not have been initialized. You will need to manually initialize the database using your schema migrations or some other mechanism. Here's how one COULD do it in OpenShift:
bash
cd <solution root>/src/RedHat.TodoList
oc port-forward pod/<db pod> 5432 // Forwards the PostgreSQL port from the cluster to this local machine
In another terminal, because the port-forward has to remain running
bash
dotnet ef database update