-
Install vagrant, ansible, kubectl and virtualbox in your local env.
-
To start the cluster run
vagrant up
(change N in Vagranfile for the number of nodes needed)
-
run
scp -r [email protected]:/home/vagrant/.kube/config .
(usevagrant
as password, this will copy config file to your local env ) -
run
KUBECONFIG=~/.kube/config:$PWD/config kubectl config view --flatten > ~/.kube/config
(merge current config file with the one we copied from cluster)
-
Run deployment hello-node
kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node
-
Run service hello-node
kubectl apply -f hello-node-service.yaml
-
Verify deployments, pods and services with
kubectl get deployments
,kubectl get pods
andkubectl get rs
-
Copy the pods name example:
hello-node-78cd77d68f-sqc2p
-
forward port 8080 to localhost with
kubectl port-forward hello-node-78cd77d68f-sqc2p 8080:8080
-
Test the app hello-node with
curl http://localhost:8080
should see the outputHello World!