Skip to content

Commit fe801c0

Browse files
authored
Update README.md
1 parent 4a7a309 commit fe801c0

File tree

1 file changed

+30
-0
lines changed
  • kubernetes/beginners/workshop/lab01-creating-nginx-pod

1 file changed

+30
-0
lines changed

kubernetes/beginners/workshop/lab01-creating-nginx-pod/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,36 @@ $ kubectl get pods
8080
nginx-pod 1/1 Running 0 22s
8181
```
8282

83+
## Create a Deployment
84+
85+
The folowing example will create a Deployment with 3 replicas of NGINX base image. Let's begin with the template:
86+
87+
apiVersion: extensions/v1beta1
88+
kind: Deployment # kubernetes object type
89+
metadata:
90+
name: nginx-deployment # deployment name
91+
spec:
92+
replicas: 3 # number of replicas
93+
template:
94+
metadata:
95+
labels:
96+
app: nginx # pod labels
97+
spec:
98+
containers:
99+
- name: nginx # container name
100+
image: nginx:1.12.1 # nginx image
101+
imagePullPolicy: IfNotPresent # if exists, will not pull new image
102+
ports: # container and host port assignments
103+
- containerPort: 80
104+
- containerPort: 443
105+
106+
This deployment will create 3 instances of NGINX image.
107+
108+
Run the following command to create Deployment:
109+
110+
$ kubectl create -f nginx-deployment.yaml
111+
deployment "nginx-deployment" created
112+
83113

84114
## Verify that the pod came up fine:
85115

0 commit comments

Comments
 (0)