Bootstrap FreeKB - Helm - Deploy Hello OpenShift using Helm
Helm - Deploy Hello OpenShift using Helm

Updated:   |  Helm articles

You may want to first check out my article FreeKB - OpenShift - Deploy Hello Openshift.

This also assumes you've already installed the helm CLI on the system that you want to use to create the Helm chart to deploy Hello OpenShift.

Let's use the helm create comment to create a directory named my-chart.

helm create my-chart

 

The my-chart directory should contain the following.

├── my-chart (directory)
│   ├── Chart.yaml
│   ├── values.yaml
│   ├── charts (directory)
│   └── templates (directory)
│       └── deployment.yaml
│       └── _helpers.tpl
│       └── hpa.yaml
│       └── ingress.yaml
│       └── NOTES.txt
│       └── serviceaccount.yaml
│       └── service.yaml
│       └── tests(directory)
│           └── test-connection.yaml

 

Let's remove all of the files in the templates directory and create a file named pod.yaml in the templates directory.

rm -rf my-chart/templates/tests/
rm my-chart/templates/*
touch my-chart/templates/pod.yaml

 

You should now have the following.

├── my-chart (directory)
│   ├── Chart.yaml
│   ├── values.yaml
│   ├── charts (directory)
│   └── templates (directory)
│       └── pod.yaml
│       └── tests(directory)
│           └── test-connection.yaml

 

Let's update pod.yaml to have the following.

apiVersion: v1
kind: Pod
metadata:
  name: {{ .Values.name }}
spec:
  containers:
  - image: {{ .Values.image }}
    name: {{ .Values.name }}
    ports:
    - containerPort: {{ .Values.httpport }}
      protocol: TCP
    - containerPort: {{ .Values.managementport }}

 

Since pod.yaml expects certain .Values, let's update my-chart/values.yaml to have the following.

~]$ cat my-chart/values.yaml
name: hello-openshift
image: registry.redhat.io/openshift4/ose-hello-openshift-rhel8
httpport: 8080
managementport: 8888

 

The helm lint command can be used to determine if there are any syntax errors in the files in the my-chart directory.

~]$ helm lint my-chart
==> Linting my-chart
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed

 

The helm template command can be used to see what the pod.yaml manifest file will be.

~]$ helm template my-chart
---
# Source: my-chart/templates/pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: hello-openshift
spec:
  containers:
  - image: registry.redhat.io/openshift4/ose-hello-openshift-rhel8
    name: hello-openshift
    ports:
    - containerPort: 8080
      protocol: TCP
    - containerPort: 8888

 

Assuming the pod.yaml manifest looks accurate, the helm install command can then be used to deploy pod.yaml to a particular namespace.

~]$ helm install my-release my-chart --namespace my-project
NAME: my-release
LAST DEPLOYED: Wed Nov 19 13:07:04 2025
NAMESPACE: my-project
STATUS: deployed
REVISION: 1
TEST SUITE: None

 

The helm list command should now return the installed helm chart.

]$ helm list --namespace my-project
NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
my-release      my-project      1               2025-11-19 13:07:04.258693346 -0600 CST deployed        my-chart-0.1.0  0.0.1

 

And then the oc get all command can be used to see if the pod was created in the namespace.

~]$ oc get all --namespace my-project

NAME                  READY   STATUS    RESTARTS   AGE
pod/hello-openshift   1/1     Running   0          6s

 

The oc exec command can be used to verify that the pod returns Hello Openshift!

~]$ oc exec pod/hello-openshift --namespace my-project -- curl --silent localhost:8080
Hello OpenShift!

 

The helm uninstall command can be used to un-deploy Hello OpenShift.

helm uninstall my-release --namespace my-project

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter adef65 in the box below so that we can be sure you are a human.