Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # api version of the kubernetes : apps/v1 -current stable
- apiVersion: apps/v1
- # Kind describes the type of the object/resource to be created.
- # Supported kind are :
- ### componentstatuses
- ### configmaps
- ### daemonsets
- ### deployments
- ### events
- ### endpoints
- ### horizontalpodautoscalers
- ### ingress
- ### jobs
- ### limitranges
- ### namespaces
- ### nodes
- ### pods
- ### persistentvolumes
- ### persistentvolumeclaims
- ### resourcequotas
- ### replicasets
- ### replicationcontrollers
- ### serviceaccounts
- ### services
- kind: Deployment
- # Set of data to uniquely identify K8 objects
- # It takes:
- # labels
- # name
- # namespace
- # annotations
- metadata:
- name: nginx-deployment #Name of the deployment created
- # Key-value pairs primarily used to group and categorize deployment object.
- # It is intended for an object to object grouping and mapping using selectors.
- # kubernetes service uses the pod labels in its selectors to send traffic to the right pods.
- labels:
- app: nginx
- # declare the desired state and characteristics of the object we want to have
- # Spec has three important subfields:
- ## replicas
- ## selector
- ## template
- spec:
- # replicas - It will make sure the numbers of pods running all the time for the deployment
- replicas: 3
- # Selector - It defines the labels that match the pods for the deployments to manage.
- selector:
- matchLabels:
- app: nginx
- # Template - It has its own metadata and spec. Spec will have all the container information a pod should have.
- # Container image info, port information, ENV variables, command arguments etc.
- template:
- metadata:
- labels:
- app: nginx
- spec:
- containers:
- - name: nginx
- image: nginx:1.7.9
- ports:
- - containerPort: 80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement