To make an army of minions in minikube.
Docker (https://docs.docker.com/install/) and minikube (https://kubernetes.io/docs/tasks/tools/install-minikube/) installed.
Start minikube:
minikube start --memory 4000 --cpus 3
Build minion image for minikube - from this directory run
eval $(minikube docker-env)
docker build . -t minion
Deploy the army
kubectl create -f minion-army.yml
To see the troop types:
open http://$(minikube ip):30080
open http://$(minikube ip):30081
open http://$(minikube ip):30082
open http://$(minikube ip):30083
To see the whole army
kubectl get pods
To create more troops of each type do minikube dashboard
and go to the deployment and change the number of replicas
Choose the host of one the minions open in your browser. To kill it:
kubectl delete pod <host>
Refresh the browser (it will take a little while) and see that another pod is already there
Change the version in the Controller class to 0.2. Do:
docker build . -t minion:0.2
Then open minion-army.yml and find-replace all the "latest" with "0.2". Save the changes and do:
kubectl apply -f minion-army.yml --record
Refresh the browser of one of the minion types to see the version change in line with what you see from kubectl rollout status deployment <deployment_name>
where <deployment_name> is a minion type (e.g. one-eyed-minion).
To see the history of what was deployed do kubectl rollout history deployment <deployment_name>
and to rollback do kubectl rollout undo deployment <deployment_name> --to-revision=1
(can take a little while)
kubectl delete -f minion-army.yml
Stop minikube with minikube stop