File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
kubernetes/beginners/workshop/lab01-creating-nginx-pod Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,36 @@ $ kubectl get pods
80
80
nginx-pod 1/1 Running 0 22s
81
81
```
82
82
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
+
83
113
84
114
## Verify that the pod came up fine:
85
115
You can’t perform that action at this time.
0 commit comments