deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
labels:
app: hello-world
spec:
replicas: 4
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image: gcr.io/google-samples/hello-app:1.0
ports:
- containerPort: 8080
#Let's ask the API Server for the API Groups it knows about.
kubectl api-resources | more
#A list of the objects available in that API Group
kubectl api-resources --api-group=apps
#We can use explain to dig further into a specific API Object
#Check out KIND and VERSION, we'll see the API Group in the from group/version
#Which is extensions/v1beta1 and that's deprecated.
kubectl explain deployment | head
#Follow the version specified in the deprecation warning. That's deprecated too!
kubectl explain deployment --api-version apps/v1beta2 | head
#Follow the version specified in THAT deprecation warning. Ah...the one we should use.
kubectl explain deployment --api-version apps/v1 | head
#Print the supported API versions on the API server again in the form group/version.
#Here we see apps/v1,apps/v1beta1 and apps/v1beta2
kubectl api-versions | sort | more
#Now, we're in a transition period of where Deployments are moving from v1beta1, to v1beta2 to apps/v1
#Deployment went GA under apps/v1 in version 1.9, as of 1.13 it's still a work in progress.
#Follow the issue on GitHub - https://github.com/kubernetes/kubernetes/issues/43214
kubectl apply -f deployment.yaml
#Our 1.13 API Server converts apiVersion to v1beta1
#let's look at a Deployment
kubectl get deployment hello-world -o yaml | head
#Let's clean up after this demo
kubectl delete deployment hello-world
Kubernetes Tutorials using EKS – Part 1 – Introduction and Architecture
Kubernetes Tutorials using EKS – Part 2 – Architecture with Master and worker
Kubernetes Tutorials using EKS – Part 3 – Architecture with POD – RC – Deploy – Service
Kubernetes Tutorials using EKS – Part 4 – Setup AWS EKS Clustor
Kubernetes Tutorials using EKS – Part 5 – Namespaces and PODs
Kubernetes Tutorials using EKS – Part 6 – ReplicationControllers and Deployment
Kubernetes Tutorials using EKS – Part 7 – Services
Kubernetes Tutorials using EKS – Part 8 – Volume
Kubernetes Tutorials using EKS – Part 9 – Volume
Kubernetes Tutorials using EKS – Part 10 – Helm and Networking
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024