Add docs to illustrate how to schedule pod to specific node (#12871)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
c34527a3ed
commit
268c9473a5
@@ -86,6 +86,13 @@ a `disktype=ssd` label.
|
||||
NAME READY STATUS RESTARTS AGE IP NODE
|
||||
nginx 1/1 Running 0 13s 10.200.0.4 worker0
|
||||
```
|
||||
## Create a pod that gets scheduled to specific node
|
||||
|
||||
You can also schedule a pod to one specific node via setting `nodeName`.
|
||||
|
||||
{{< codenew file="pods/pod-nginx-specific-node.yaml" >}}
|
||||
|
||||
Use the configuration file to create a pod that will get scheduled on `foo-node` only.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
@@ -446,6 +446,7 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"commands": {&api.Pod{}},
|
||||
"init-containers": {&api.Pod{}},
|
||||
"lifecycle-events": {&api.Pod{}},
|
||||
"pod-nginx-specific-node": {&api.Pod{}},
|
||||
"pod-nginx": {&api.Pod{}},
|
||||
"pod-with-node-affinity": {&api.Pod{}},
|
||||
"pod-with-pod-affinity": {&api.Pod{}},
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
nodeName: foo-node # schedule pod to specific node
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
imagePullPolicy: IfNotPresent
|
||||
Reference in New Issue
Block a user