Skip to content

kangsheng89/k8s_practise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

k8s_practise

k8s_practise

minikube usage

This is example on minikube

    minikube start

To view minikube on web, run

    minikube dashboard

Deployment and Service

-- 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

Reference

https://kubernetes.io/docs/tutorials/hello-minikube/

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands

https://www.katacoda.com/courses/kubernetes/playground

About

k8s_practise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published