-
Notifications
You must be signed in to change notification settings - Fork 218
Getting started with Minikube in Ubuntu
Thien Nguyen Le Quynh edited this page Jul 7, 2022
·
2 revisions
-
Get the latest source code
-
Install minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube
-
Create folders
mkdir -p -v $HOME/k8s-yas-data/postgres \ $HOME/k8s-yas-data/pgadmin \ $HOME/k8s-yas-data/var/lib/postgres \ $HOME/k8s-yas-data/var/lib/pgadmin
-
Start minikube
minikube start --driver=docker --mount-string $HOME/k8s-yas-data:/k8s-yas-data/ --mount
-
Install kubectl
minikube kubectl -- get pods -A echo 'alias kubectl="minikube kubectl --"' >> ~/.bashrc source ~/.bashrc
-
Enable the Ingress controller
minikube addons enable ingress
-
Update volume mounts in yaslocal.yaml
-
In the postgres deployment update:
- mountPath of postgres to "/k8s-yas-data/var/lib/postgresql/data"
- mountPath of pgadmin to "/k8s-yas-data/var/lib/pgadmin"
-
In the postgres-pv-volume PersistentVolume replace path to "/k8s-yas-data/postgres" and matchExpressions->key->values from docker-desktop to minikube
-
In the pgadmin-pv-volume PersistentVolume replace path to "/k8s-yas-data/pgadmin" and matchExpressions->key->values from docker-desktop to minikube
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- minikube
-
Run
kubectl apply -f yaslocal.yaml
-
Run to add to your host file
echo -e "$(minikube ip) api.yas.local\ \n$(minikube ip) storefront.yas.local\ \n$(minikube ip) backoffice.yas.local\ \n$(minikube ip) identity\ \n$(minikube ip) pgadmin.yas.local" | sudo tee -a /etc/hosts