docker build -t example.com/frontend:1.0 ./App/v1/
creates example.com/frontend:1.0
docker build -t example.com/frontend:2.0 ./App/v2/
creates example.com/frontend:2.0
kubectl apply -f ./Pods/pod.yml
kubectl get pods --watch
kubectl apply -f ./Pods/multi-pod.yml
main and helper can talk on a localhost scraper exports nginx to prometheus logs...
kubectl get pods --watch
kubectl delete --all pods
*as a service, ip can change, usually do not connect directly
kubectl get pods -o wide
service has ip and DNS, access by DNS
- programmatically expose hello-pod (from pod.yml)
kubectl apply -f ./Pods/pod.yml
kubectl expose pod hello-pod \
--name=hello-svc \
--target-port=8080 \
--type=NodePort
#does not work in docker
minikube ip
#192.168.49.2
kubectl get service
#hello-svc 8080:31515/TCP
curl http://127.0.0.1:31515
curl 192.168.49.2:31515
#hello-svc 8080:31515/TCP
#Services of type NodePort can be exposed via the minikube service <service-name> --url command. It must be run in a separate terminal window to keep the tunnel open. Ctrl-C in the terminal can be used to terminate the process at which time the network routes will be cleaned up.
minikube service hello-svc --url
# http://127.0.0.1:33053 Because you are using a Docker driver on linux, the terminal needs to be open to run it.
kubectl delete service --all
kubectl delete --all pods
kubectl apply -f ./Pods/pod.yml
kubectl apply -f ./Services/svc-nodeport.yml
kubectl describe service ps-nodeport
minikube service ps-nodeport --url
kubectl apply -f ./Pods/pod.yml
kubectl apply -f ./Services/svc-lb.yml
kubectl describe service ps-lb
minikube service ps-lb --url
- or with tunnel
- https://minikube.sigs.k8s.io/docs/handbook/accessing/#:~:text=own%20IP%20address.-,Using%20minikube%20tunnel,routes%20will%20be%20cleaned%20up.
kubectl apply -f ./Services/svc-lb.yml
kubectl apply -f ./Services/svc-nodeport.yml
kubectl apply -f Deployments/deploy.yml
kubectl delete service --all
kubectl delete pods --all
kubectl delete deployment --all
kubectl get svc
kubectl get deployment
kubectl get pod
kubectl get rs
kubectl describe service ps-lb
kubectl describe ep ps-lb
kubectl get pods --show-labels
minikube service ps-lb --url
*starts browser automatically
minikube service ps-lb
minikube dashboard
- tunnel to loadbalancer - 80
minikube tunnel
curl http://127.0.0.1/
-
scaling... change replicas, apply deploy
-
versioning
kubectl apply -f Deployments/deploy-complete.yml
kubectl rollout status deploy web-deploy