Deployment configuration file

$ vi nginx-deployment.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: webapp
spec:
replicas: 2
selector:
matchLabels:
app: nginx
minReadySeconds: 5
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: webapp
image: nginx
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80

The previous configuration is mentioning the following things:

  • The kind of file is deployed, and the name is webapp.
  • The number of replicas will be two, and the name of application is nginx.
  • The name of the container is webapp and the image nginx is used.
  • ImagePullPolicy is IfNotPresent, meaning that the image is not present in the cluster or pulled from registry. If its there, then use that image.
  • Container port is using 80.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.205.232