POD.yaml
apiVersion: v1
kind: Pod
metadata:
name: hello-world
spec:
containers:
- name: hello-world
image: gcr.io/google-samples/hello-app:1.0
ssh aen@c1-master1
cd ~/content/course/m2/demos
#Get information about our current context, ensure we're logged into the correct cluster.
kubectl config get-contexts
#Change our context if needed.
kubectl config use-context kubernetes-admin@kubernetes
#Get information about the API Server for our current context, which should be kubernetes-admin@kubernetes
kubectl cluster-info
#Get a list of API Resources available in the cluster
kubectl api-resources | more
#Using kubectl explain
kubectl explain pods | more
#Creating a pod with YAML
kubectl apply -f pod.yaml
#Let's look more closely at what we need in pod.spec and pod.spec.containers
kubectl explain pod.spec | more
kubectl explain pod.spec.containers | more
#Get a list of our currently running pods
kubectl get pod
#Remove our pod
kubectl delete pod hello-world
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND