https://github.com/donalshortt/containerisation
To deploy on minikube using helm follow the steps in start-minikube-and-deploy.sh
or just run the script from the root folder of the project.
chmod +x start-minikube-and-deploy.sh
./start-minikube-and-deploy.sh
This script will
- Delete existing minkube cluster if present
- Start a new minikube cluster with calico container network interface
- Build the docker images and load into minikube cluster registry
- Enable and configure ingress addon for TLS
- Lint and install helm charts
- Check the state of the pods after deploying
curl https://$(minikube ip) -k
curl https://$(minikube ip)/api/number -k
curl https://$(minikube ip)/api/number -k -X POST
https://
enforces TLS port 443 and -k
ignores self-signed issue.
cd
to containerization/helm- Lint the helm chart
helm lint
- Make sure docker images for api/ and front/ are built.
- Push docker images for api and front again to minikube (see deploy.sh).
- Install helm chart (on empty cluster!)
helm install containerization .
- Upgrade deployment with
helm upgrade containerization .
- Rollback to previous version with
helm rollback containerization <optional revision num>
- Uninstall chart with
helm uninstall containerization
Generate private key, certificate signing request and self-signed certificate.
openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr
openssl x509 -signkey domain.key -in domain.csr -req -days 365 -out domain.crt
Create secret
kubectl create secret tls tls-certificate --key domain.key --cert domain.crt