Improved static pod task documentation (#16709)

Improved indentation

Apply suggestions from code review

Co-Authored-By: Zach Corleissen <zacharysarah@users.noreply.github.com>

Removing bullets points

Same have been added inline as per suggestions

Removed trailing space
This commit is contained in:
Manish Bansal
2019-10-10 13:54:54 +05:30
committed by Kubernetes Prow Robot
parent af66c0a274
commit d468afa016
@@ -48,7 +48,7 @@ Instructions for other distributions or Kubernetes installations may vary.
## Create a static pod {#static-pod-creation} ## Create a static pod {#static-pod-creation}
You can configure a static Pod two different ways: either by using configuration file(s) or by HTTP. You can configure a static Pod with either a [file system hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#configuration-files) or a [web hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#pods-created-via-http).
### Filesystem-hosted static Pod manifest {#configuration-files} ### Filesystem-hosted static Pod manifest {#configuration-files}
@@ -86,12 +86,12 @@ spec:
EOF EOF
``` ```
3. Configure your kubelet on the node to use this directory by running it with `--pod-manifest-path=/etc/kubelet.d/` argument or add the `staticPodPath: <the directory>` field in the [KubeletConfiguration file](/docs/tasks/administer-cluster/kubelet-config-file). 3. Configure your kubelet on the node to use this directory by running it with `--pod-manifest-path=/etc/kubelet.d/` argument. On Fedora edit `/etc/kubernetes/kubelet` to include this line:
On Fedora edit `/etc/kubernetes/kubelet` to include this line:
``` ```
KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --pod-manifest-path=/etc/kubelet.d/" KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --pod-manifest-path=/etc/kubelet.d/"
``` ```
or add the `staticPodPath: <the directory>` field in the [KubeletConfiguration file](/docs/tasks/administer-cluster/kubelet-config-file).
4. Restart the kubelet. On Fedora, you would run: 4. Restart the kubelet. On Fedora, you would run:
@@ -108,7 +108,9 @@ Similar to how [filesystem-hosted manifests](#configuration-files) work, the kub
refetches the manifest on a schedule. If there are changes to the list of static refetches the manifest on a schedule. If there are changes to the list of static
Pods, the kubelet applies them. Pods, the kubelet applies them.
If you want to use this approach, create a YAML file: To use this approach:
1. Create a YAML file and store it on a web server so that you can pass the URL of that file to the kubelet.
```yaml ```yaml
apiVersion: v1 apiVersion: v1
@@ -127,25 +129,21 @@ spec:
protocol: TCP protocol: TCP
``` ```
and store it on a web server so that you can pass the URL of that file to the kubelet.
Configure the kubelet on your selected node to use this web manifest by running it with `--manifest-url=<manifest-url>`
On Fedora, edit `/etc/kubernetes/kubelet` to include this line: 2. Configure the kubelet on your selected node to use this web manifest by running it with `--manifest-url=<manifest-url>`. On Fedora, edit `/etc/kubernetes/kubelet` to include this line:
``` ```
KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=<manifest-url>` KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=<manifest-url>`
``` ```
Now, restart the kubelet. On Fedora, you would run: 3. Restart the kubelet. On Fedora, you would run:
```shell ```shell
# Run this command on the node where the kubelet is running # Run this command on the node where the kubelet is running
systemctl restart kubelet systemctl restart kubelet
``` ```
## Observe static pod behavior {#behavior-of-static-pods} ## Observe static pod behavior {#behavior-of-static-pods}
When the kubelet starts, it automatically starts all defined static Pods. As you have When the kubelet starts, it automatically starts all defined static Pods. As you have