Commit 692a35a7 authored by Jon Tavernier's avatar Jon Tavernier

tidy up setup and helm deploy

parent 3a60d87f
......@@ -11,6 +11,20 @@ My goals are to:
1. Docker is installed
1. Minikube is installed and running k8s
## Setup
If Minikube is setup for the first time or nuked and recreated:
1. Enable the ingress addon.
- `minikube addons enable ingress`
1. Create a container registry within k8s.
```bash
eval $(minikube docker-env)
docker run -d -p 5000:5000 --restart=always --name registry registry:2
```
1. Add the minikube IP to `/etc/hosts`
- `echo "$(minikube ip) jonk8s.info" | sudo tee -a /etc/hosts`
## Helpers
I created some scripts to get up and running.
......
......@@ -34,7 +34,7 @@ create_ingresses(){
delete_helm_chart(){
local api=$1
helm delete "jon-${api}-release"
helm delete --purge "jon-${api}-release"
}
install_helm_chart(){
......@@ -49,19 +49,40 @@ show_info(){
kubectl get deployments
kubectl get pods
minikube service list
helm list
}
main(){
# Let's practice creating k8s resources using both k8s
# config files and helm charts.
############################################################
# k8s config files
############################################################
delete_ingresses || true
delete_services || true
delete_deployments || true
delete_helm_chart books || true
create_deployments
create_services
create_ingresses
############################################################
# helm charts
############################################################
# This is not how things would work in production. Normamly,
# we would do something like this:
#
# if chart exists then upgrade
# else install;
#
# For this exercise, I'm taking a simpler approach of
# destroying everything then recreating.
delete_helm_chart books || true
install_helm_chart books
echo "Pausing then showing k8s state"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment