Helm Charts with minikube

1 minute read

helm repo list
helm repo add bitnami https://charts.bitnami.com/bitnami

helm repo remove bitnami

Search the repository:

helm search repo mysql

helm search repo database

helm search repo database --versions

Installation

Default namespace

helm install mydb bitnami/mysql

custom namespace

# Create a namespace
kubectl create ns non-prod

helm install --namespace non-prod mydb bitnami/mysql
helm install --n non-prod mydb2 bitnami/mysql

Check the cluster and docker

kubectl get pods

minikube ssh

docker images

To check the installation status:

helm status mydb

Upgrade:

Get the default password

ROOT_PASSWORD=$(kubectl get secret --namespace default mydb-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode)

helm upgrade --namespace default mysql-release bitnami/mysql --set auth.rootPassword=$ROOT_PASSWORD

Uninstallation

helm uninstall mysql-release

Create custom helm charts

helm create my-first-chart
helm package my-first-chart
helm repo index .

Update the repo

helm repo update

Install

helm repo add myrepo https://nitinkc.github.io/HelmCharts
helm install myapp myrepo/my-first-chart

Changes in the values file

Docker image

helm create todo-app
  • Remove hpa, ingress, serviceaccount yamls
  • remove anything related to serviceaccount from helper and deployment yml

Docker hub https://hub.docker.com/repository/docker/nitinkc/todo-app/tags

Changes pertaining to Dockerimage https://github.com/nitinkc/HelmCharts/commit/bb599c519d66dcb7de5a4457b9e36d33f64cdf0e

After helm file changes

helm package todo-app
helm repo index . 

# Git push
helm repo update 

Install

helm install todo-service-app myrepo/todo-app 

Upgrade

helm upgrade --install todo-service-app myrepo/todo-app

to avoid the hassles of commit and repo update, try

cd todo-app
helm upgrade --install todo-service-app myrepo/todo-app -f values.yaml

Interact with the pod

Get the IP’s, names etc from minikube dashboard

Check logs

#pod name from minikube Dashboard
kubectl logs todo-service-app-todo-app-7b45c8749b-ltmfw  
kubectl logs -f todo-service-app-todo-app-7b45c8749b-ltmfw    

Test Connectivity from Inside the Pod

use a temporary pod to check if the application is reachable from within the cluster

kubectl run -it --rm --restart=Never busybox --image=busybox -- sh

Then, inside the busybox shell, try to curl your application:

wget -qO- http://<your-pod-ip>:5000/actuator/health