GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — educka/exam-prep at master · caprigit/educka

Expand file tree

/

exam-prep

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

exam-prep

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
CKA-Part1.pdf
CKA-Part1.pdf
 
 
CKA-Part2.pdf
CKA-Part2.pdf
 
 
CKA-Part3.pdf
CKA-Part3.pdf
 
 
CKA-Part4.pdf
CKA-Part4.pdf
 
 
CKA-Part5.pdf
CKA-Part5.pdf
 
 
README-Kube-1.17.md
README-Kube-1.17.md
 
 
README.md
README.md
 
 
app-redis.yml
app-redis.yml
 
 
not-running.yml
not-running.yml
 
 
pod-scenarios.txt
pod-scenarios.txt
 
 
problem-pod.yml
problem-pod.yml
 
 

README.md

Outline

Kubernetes 1.18 & above Versions Only

Generate Pod Yamls

kubectl run nginx --image=nginx --dry-run=client -o yaml  ## generate pod yaml file
kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml  ## generate pod yaml file with restartPolicy: Never
kubectl run nginx --image=nginx -l="app=web,env=dev" --dry-run=client -o yaml  ## generate pod yaml file with labels provided
kubectl run nginx --image=nginx --env="hello=world" --env="me=naresh" --dry-run=client -o yaml ## generate pod yaml with env variables
kubectl run nginx --image=nginx --restart=OnFailure --env='hello=world' -l='app=web' --limits='cpu=100m,memory=150Mi' --dry-run=client -o yaml ## generate pod yaml with various parametes
kubectl run nginx --image=nginx --port=80 --expose --dry-run=client -o yaml ## generate pod yaml file & Service yaml file together

Create Pod

## Note: remove --dry-run -o yaml from all above commands to create pods ex as below. 
kubectl run nginx --image=nginx  # create a pod 

Generate Deployment Yamls

kubectl create deployment nginx --image=nginx --dry-run=client -o yaml  ## generate Deployment yaml file

Create Deployment

## Note: remove --dry-run -o yaml from all above commands to create Deployment ex as below. 

kubectl create deployment nginx --image=nginx  ## creates a Deployment 

scale up/down number of replicas

kubectl scale deployment nginx --replicas=3  ## scale a deployment named nginx 
kubectl scale replicaset nginx --replicas=3  ## scale a replicaset named nginx
kubectl scale statefulset nginx --replicas=3  ## scale a statefulset named nginx

Generate Service yamls

kubectl create service nodeport nginx --tcp=80:80 --dry-run=client -o yaml  ## generate a service yaml with type: NodePort name: 'nginx' & selector app: nginx
kubectl create service nodeport nginx --tcp=80:80 --node-port=30080 --dry-run=client -o yaml  ## generate a service yaml with type: NodePort, name: 'nginx' & selector app: nginx with nodeport given
kubectl create service clusterip nginx --tcp=80:80 --dry-run=client -o yaml ## generate a service yaml with type: ClusterIP

Generate Service yaml for to expose/access running pods/deployment

## Note: to use below commands, the pod/deployment must be created first

kubectl expose pod mypod --port=80 --target-port=8080 --type=NodePort --dry-run=client -o yaml
kubectl expose deployment mydep --port=80 --target-port=8080 --type=NodePort --dry-run=client -o yaml 
kubectl expose -f pod.yaml  --port=80 --target-port=8080 --type=NodePort --dry-run=client -o yaml

kubectl expose pod mypod --port=80 --target-port=8080 --type=ClusterIP --dry-run=client -o yaml
kubectl expose deployment mydep --port=80 --target-port=8080 --type=ClusterIP --dry-run=client -o yaml 
kubectl expose -f pod.yaml  --port=80 --target-port=8080 --type=ClusterIP --dry-run=client -o yaml
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.