<!-- TOC -->

- [Prerequisites to develop and test Helm Charts](#prerequisites-to-develop-and-test-helm-charts)
- [General Packages](#general-packages)
- [Kubernetes cluster](#kubernetes-cluster)
- [Docker](#docker)
- [asdf](#asdf)
- [Helm](#helm)
- [Helm Docs](#helm-docs)
- [Kubectl](#kubectl)

<!-- TOC -->

# Prerequisites to develop and test Helm Charts

# General Packages

Install the follow packages in your operating system:

- ``git``
- ``make``

# Kubernetes cluster

You will need to create a Kubernetes cluster locally using [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube), [microk8s](https://microk8s.io), [kind](https://kind.sigs.k8s.io), [k3s](https://k3s.io) or other tools.

Or use Kubernetes cluster in [EKS](https://aws.amazon.com/eks), [GKE](https://cloud.google.com/kubernetes-engine), [AKS](https://docs.microsoft.com/en-us/azure/aks), [DOKS](https://www.digitalocean.com/products/kubernetes) or other cloud provider.

# Docker

Follow instructions of page for install Docker-CE.

- Ubuntu: https://docs.docker.com/engine/install/ubuntu/
- Debian: https://docs.docker.com/engine/install/debian/
- CentOS: https://docs.docker.com/engine/install/centos/
- MacOS: https://docs.docker.com/desktop/mac/install/

Start the Docker service, configure Docker to boot up with the OS and add your user to the Docker group.

```bash
# Start the Docker service
sudo systemctl start docker

# Configure Docker to boot up with the OS
sudo systemctl enable docker

# Add your user to the Docker group
sudo usermod -aG docker $USER
sudo setfacl -m user:$USER:rw /var/run/docker.sock
```

Source: https://docs.docker.com/engine/install/linux-postinstall/#configure-docker-to-start-on-boot

# asdf

> Attention!!!
> To update ``asdf``, ONLY use the following command. If you try to reinstall or update by changing the version in the following commands, it will be necessary to reinstall all plugins/commands installed before, so it is very important to back up the ``$HOME/.asdf`` directory.

```bash
asdf update
```

Run the following commands:

```bash
ASDF_VERSION="v0.15.0"
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch $ASDF_VERSION

echo ". \"\$HOME/.asdf/asdf.sh\"" >> ~/.bashrc
echo ". \"\$HOME/.asdf/completions/asdf.bash\"" >> ~/.bashrc
source ~/.bashrc
```

Reference: https://asdf-vm.com/guide/introduction.html

# Helm

Execute these commands to install helm.

```bash
VERSION="3.21.2"

asdf plugin list all | grep helm
asdf plugin add helm https://github.com/Antiarchitect/asdf-helm.git
asdf latest helm

asdf install helm $VERSION
asdf list helm

asdf global helm $VERSION
asdf list helm
```

# Helm Docs

Run the following commands to install ``helm-docs``.

```bash
VERSION="1.14.2"

asdf plugin list all | grep helm-docs
asdf plugin add helm-docs https://github.com/sudermanjr/asdf-helm-docs.git
asdf latest helm-docs

asdf install helm-docs $VERSION
asdf list helm-docs

asdf global helm-docs $VERSION
asdf list helm-docs
```

Documentation: https://github.com/norwoodj/helm-docs 

The documentation generated by ``helm-docs`` is based on the contents of the ``values.yaml``, ``README.md.gotmpl`` and ``Chart.yaml`` file. It tries to overwrite the contents of the ``README.md`` file within the chart directory.

# Kubectl

Simple shell function for Kubectl installation in Linux 64 bits. Copy and paste this code:

```bash
VERSION_OPTION_1="1.36.2"

asdf plugin list all | grep kubectl
asdf plugin add kubectl https://github.com/asdf-community/asdf-kubectl.git
asdf latest kubectl

asdf install kubectl $VERSION_OPTION_1
asdf list kubectl

asdf global kubectl $VERSION_OPTION_1
asdf list kubectl
```

Kubectl documentation:

https://kubernetes.io/docs/reference/kubectl/overview/
