Skip to content

Learning kubernetes, minikube, AWS EKS with some example project,

Notifications You must be signed in to change notification settings

mjuyelrana/kubernetes-learning

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-learning

Imperative Approach for Kubernetes control commands

1. Create a deployment [first-app=deployment name, mjuyelrana/kub-first-app=docker hub image name]

kubectl create deployment first-app --image=mjuyelrana/kub-first-app

2. To show all the deployments

kubectl get deployments

3. To show all running pods

kubectl get pods

4. To delete a deployment [first-app=deployment name]

kubectl delete deployment first-app

5. To show the running services

kubectl get services 

6. To delete a service [first-app = service name]

kubectl delete service first-app

7. Expose a deployment

kubectl expose deployment first-app --type=LoadBalancer --port=8080

8. Create replicas of PODS [deployment/first-app=deployment pod]

kubectl scale deployment/first-app --replicas=3

9. Attaching new build to deployment [kub-first-app = Container name, mjuyelrana/kub-first-app= docker-hub image name]

kubectl set image deployment/first-app kub-first-app=mjuyelrana/kub-first-app 

10. Rollout the new deployment

kubectl rollout status deployment/first-app

11. Show the histories of all deployments

kubctl rollout history deployment/first-app
kubctl rollout history deployment/first-app --revision=1

12. Undo an old deployment

kubectl rollout undo deployment/first-app --to-revision=1

Declarative Approach for kubernetes control

1. Create a deployment by deployment.yaml file

kubectl apply -f=deployment.yaml

2. Create a service by service.yaml file

kubectl apply -f service.yaml

3. Create multiple deployment

kubectl apply -f=deployment.yaml, service.yaml

4. Delete resources by yaml file/ Declarative fole [deployment.yaml=Yaml file for running deployment, service.yaml=Yaml file for attaching deployment]

kubectl delete -f=deployment.yaml,service.yaml

5. Delete deployment by labels

kubectl delete deployments,services -l group=second-app-label

6. Show default storage class

kubectl get sc

7. Show the persistent volume

kubectl get pv

8. Show the persistent volume claims

kubectl get pvc

9. Show the configMap

kubectl get configMap

10. Show the cluster namespaces/domain name

kubectl get namespaces

Minikube Commands

1. To start or stop minikube

minikube start
minikube stop

2. To show minikube status

minikube status 

3. To show minikube dashboard in browser

minikube dashboard

4. Attach a deployment to minikube [first-app=deployment name]

minikube service first-app 

About

Learning kubernetes, minikube, AWS EKS with some example project,

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.6%
  • Dockerfile 6.7%
  • HTML 4.8%
  • CSS 2.9%