k8s_practise
This is example on minikube
minikube start
To view minikube on web, run
minikube dashboard
-- Skip the minikube part if using katokoda playground
Deployment yaml file can be generated and create deployment in declaritive way:
kubectl create deployment web --image=nginxdemos/hello --dry-run=client -o yaml > web.yaml
kubectl apply -f web.yaml
To check the deployment
kubectl get deployment web
kubectl describe deployment web
Generate Service yaml for service and create service in declaritive way:
kubectl expose deployment web --port=80 --target-port=80 --dry-run=client -o yaml > service.yaml
kubectl apply -f service.yaml
To check the service, ip can be get from the info below:
kubectl get service web
kubectl describe service web
To test the application
run the below command to tunnel for the service web
minikube service web
at kotakoda, u can use curl directly
curl http://xx.xx.xxx.xx
https://kubernetes.io/docs/tutorials/hello-minikube/
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands