Skip to content

IBM/ubi-helm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ubi-helm

Deploy a pure ubi image as a container with Helm. With the values.yaml in the Helm chart we can configure replica count of the pods. The deployed containers are only a basic ubi operating system.

replicaCount: 2

Step 1: Log on to OpenShift

oc login --token=YOUR_TOKEN --server=YOUR_MASTERNODE_SERVER

Step 2: Create an OpenShift project

export PROJECT_NAME=ubi-helm
oc new-project $PROJECT_NAME

Step 3: Clone the repository

git clone https://github.com/thomassuedbroecker/ubi-helm.git

Step 4: Navigate to the Helm chart directory

export CHART_NAME=ubi-helm
cd ./charts/$CHART_NAME

Step 5: Verify the values.yaml content

cat values.yaml
  • Example output:
# Default values for chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 2
image:
  repository: "ubi8/ubi"
  tag: latest

Step 6: Verify the Helm chart

helm dependency update .
helm install --dry-run --debug $CHART_NAME .
helm lint

Step 7: (optionl) Create a Helm package

helm package .
  • Example output:
Successfully packaged chart and saved it to: /ubi-helm/charts/ubi-helm/ubi-helm-v1.0.0.tgz

Step 8: Install helm chart

helm install $CHART_NAME .

Step 9: Verify the running pods

oc get pods
POD=$(oc get -n $PROJECT_NAME pods | grep $CHART_NAME | head -n 1 | awk '{print $1;}')
oc exec -n $PROJECT_NAME $POD --container $CHART_NAME -- ls
  • Example output:
NAME                                 READY   STATUS             RESTARTS         AGE
ubi-helm-ubi-helm-74d44b5c77-tzbcb   1/1     Running            7 (22s ago)      10m
ubi-helm-ubi-helm-74d44b5c77-wljvr   1/1     Running            7 (27s ago)      10m
bin
boot
dev
etc
home
...

Step 10: Uninstall helm chart

helm uninstall $CHART_NAME