You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR deals with the getting started guides (windows) and tutorials
sections. Since the YAML files in the windows directory currently are not
referenced at all, this PR refactored the markdown file to correct this
problem. When appropriate, we use the YAML content from the markdown in
the extracted version.
@@ -261,112 +261,24 @@ The examples listed below assume running Windows nodes on Windows Server 1709. I
261
261
### Scheduling Pods on Windows
262
262
Because your cluster has both Linux and Windows nodes, you must explicitly set the `nodeSelector` constraint to be able to schedule pods to Windows nodes. You must set nodeSelector with the label `beta.kubernetes.io/os` to the value `windows`; see the following example:
263
263
264
-
```yaml
265
-
{
266
-
"apiVersion": "v1",
267
-
"kind": "Pod",
268
-
"metadata": {
269
-
"name": "iis",
270
-
"labels": {
271
-
"name": "iis"
272
-
}
273
-
},
274
-
"spec": {
275
-
"containers": [
276
-
{
277
-
"name": "iis",
278
-
"image": "microsoft/iis:windowsservercore-1709",
279
-
"ports": [
280
-
{
281
-
"containerPort": 80
282
-
}
283
-
]
284
-
}
285
-
],
286
-
"nodeSelector": {
287
-
"beta.kubernetes.io/os": "windows"
288
-
}
289
-
}
290
-
}
291
-
```
264
+
{{< codenew file="windows/simple-pod.yaml" >}}
265
+
266
+
{{< note >}}
292
267
**Note:** This example assumes you are running on Windows Server 1709, so uses the image tag to support that. If you are on a different version, you will need to update the tag. For example, if on Windows Server 2016, update to use `"image": "microsoft/iis"` which will default to that OS version.
268
+
{{< /note >}}
293
269
294
270
### Secrets and ConfigMaps
295
271
Secrets and ConfigMaps can be utilized in Windows Server Containers, but must be used as environment variables. See limitations section below for additional details.
296
272
297
273
**Examples:**
298
274
299
-
Windows pod with secrets mapped to environment variables
300
-
```yaml
301
-
apiVersion: v1
302
-
kind: Secret
303
-
metadata:
304
-
name: mysecret
305
-
type: Opaque
306
-
data:
307
-
username: YWRtaW4=
308
-
password: MWYyZDFlMmU2N2Rm
309
-
310
-
---
311
-
312
-
apiVersion: v1
313
-
kind: Pod
314
-
metadata:
315
-
name: my-secret-pod
316
-
spec:
317
-
containers:
318
-
- name: my-secret-pod
319
-
image: microsoft/windowsservercore:1709
320
-
env:
321
-
- name: USERNAME
322
-
valueFrom:
323
-
secretKeyRef:
324
-
name: mysecret
325
-
key: username
326
-
- name: PASSWORD
327
-
valueFrom:
328
-
secretKeyRef:
329
-
name: mysecret
330
-
key: password
331
-
nodeSelector:
332
-
beta.kubernetes.io/os: windows
333
-
```
334
-
335
-
Windows pod with configMap values mapped to environment variables
275
+
Windows pod with secrets mapped to environment variables
336
276
337
-
```yaml
338
-
kind: ConfigMap
339
-
apiVersion: v1
340
-
metadata:
341
-
name: example-config
342
-
data:
343
-
example.property.1: hello
344
-
example.property.2: world
277
+
{{< codenew file="windows/secret-pod.yaml" >}}
345
278
346
-
---
279
+
Windows Pod with configMap values mapped to environment variables
347
280
348
-
apiVersion: v1
349
-
kind: Pod
350
-
metadata:
351
-
name: my-configmap-pod
352
-
spec:
353
-
containers:
354
-
- name: my-configmap-pod
355
-
image: microsoft/windowsservercore:1709
356
-
env:
357
-
- name: EXAMPLE_PROPERTY_1
358
-
valueFrom:
359
-
configMapKeyRef:
360
-
name: example-config
361
-
key: example.property.1
362
-
- name: EXAMPLE_PROPERTY_2
363
-
valueFrom:
364
-
configMapKeyRef:
365
-
name: example-config
366
-
key: example.property.2
367
-
nodeSelector:
368
-
beta.kubernetes.io/os: windows
369
-
```
281
+
{{< codenew file="windows/configmap-pod.yaml" >}}
370
282
371
283
### Volumes
372
284
Some supported Volume Mounts are local, emptyDir, hostPath. One thing to remember is that paths must either be escaped, or use forward slashes, for example `mountPath: "C:\\etc\\foo"` or `mountPath: "C:/etc/foo"`.
@@ -375,76 +287,19 @@ Persistent Volume Claims are supported for supported volume types.
Hyper-V containers are supported as experimental in v1.10. To create a Hyper-V container, kubelet should be started with feature gates `HyperVContainer=true` and Pod should include annotation `experimental.windows.kubernetes.io/isolation-type=hyperv`.
Copy file name to clipboardExpand all lines: content/en/docs/tutorials/k8s101.md
+18-20Lines changed: 18 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ For more information, see [Pods](/docs/concepts/workloads/pods/pod/).
35
35
36
36
The simplest Pod definition describes the deployment of a single container. For example, an nginx web server Pod might be defined as:
37
37
38
-
{{< code file="pod-nginx.yaml" >}}
38
+
{{< codenew file="pods/simple-pod.yaml" >}}
39
39
40
40
A Pod definition is a declaration of a _desired state_. Desired state is a very important concept in the Kubernetes model. Many things present a desired state to the system, and Kubernetes' ensures that the current state matches the desired state. For example, when you create a Pod and declare that the containers in it to be running. If the containers happen not to be running because of a program failure, Kubernetes continues to (re-)create the Pod in order to drive the pod to the desired state. This process continues until you delete the Pod.
41
41
@@ -44,10 +44,10 @@ For more information, see [Kubernetes Design Documents and Proposals](https://gi
44
44
45
45
#### Pod Management
46
46
47
-
Create a Pod containing an nginx server ([pod-nginx.yaml](/docs/tutorials/pod-nginx.yaml)):
47
+
Create a Pod containing an nginx server ([simple-pod.yaml](/examples/pods/simple-pod.yaml)):
0 commit comments