Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titleAdd, update and list repo
$ helm repo add stable https://charts.helm.sh/stable
# Make sure we get the latest list of charts
$ helm repo update
# List chart repositories
$ helm repo listls
NAME                    URL
stable                  https://charts.helm.sh/stable

...

Code Block
languagebash
titleInstall chart
collapsetrue
$ helm install <name<chart_chart>name> stable/mysql [-n <namespace>]
WARNING: This chart is deprecated
NAME: mysql-1612351953
LAST DEPLOYED: Wed Feb  3 11:32:36 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
MySQL can be accessed via port 3306 on the following DNS name from within your cluster:
mysql-1612351953.default.svc.cluster.local

To get your root password run:

    MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default mysql-1612351953 -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo)

To connect to your database:

1. Run an Ubuntu pod that you can use as a client:

    kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il

2. Install the mysql client:

    $ apt-get update && apt-get install mysql-client -y

3. Connect using the mysql cli, then provide your password:
    $ mysql -h mysql-1612351953 -p

To connect to your database directly from outside the K8s cluster:
    MYSQL_HOST=127.0.0.1
    MYSQL_PORT=3306

    # Execute the following command to route the connection:
    kubectl port-forward svc/mysql-1612351953 3306

    mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD}

You get a simple idea of the features of a chart, even before installing it, by running helm show chart <name<chart_chart>name>

It's easy to see what has been released using the helm list function, that will show you a list of all deployed releases

...

This will uninstall the chart from Kubernetes, which will remove all resources associated with the release as well as the release history. If the flag --keep-history is provided, release history will be kept. In this case, you will be able to request information about that release using helm status <namestatus <chart_chart>name>. Because Helm tracks your releases even after you've uninstalled them, you can audit a cluster's history, and even undelete a release (with helm rollback).