From 8c9c9c543cfb6fc78dab6407647ea18c5db3a5db Mon Sep 17 00:00:00 2001 From: chenxuc Date: Fri, 25 Jun 2021 17:08:52 +0800 Subject: [PATCH] static pod not support configmap or secret --- content/en/docs/concepts/configuration/configmap.md | 5 +++++ content/en/docs/concepts/configuration/secret.md | 5 ++++- content/en/docs/concepts/workloads/pods/_index.md | 7 +++++++ .../en/docs/tasks/configure-pod-container/static-pod.md | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/content/en/docs/concepts/configuration/configmap.md b/content/en/docs/concepts/configuration/configmap.md index cb98bf7439..47ecaedba6 100644 --- a/content/en/docs/concepts/configuration/configmap.md +++ b/content/en/docs/concepts/configuration/configmap.md @@ -61,6 +61,11 @@ You can write a Pod `spec` that refers to a ConfigMap and configures the contain in that Pod based on the data in the ConfigMap. The Pod and the ConfigMap must be in the same {{< glossary_tooltip text="namespace" term_id="namespace" >}}. +{{< note >}} +The `spec` of a {{< glossary_tooltip text="static Pod" term_id="static-pod" >}} cannot refer to a ConfigMap +or any other API objects. +{{< /note >}} + Here's an example ConfigMap that has some keys with single values, and other keys where the value looks like a fragment of a configuration format. diff --git a/content/en/docs/concepts/configuration/secret.md b/content/en/docs/concepts/configuration/secret.md index 45792179b8..5d30c80763 100644 --- a/content/en/docs/concepts/configuration/secret.md +++ b/content/en/docs/concepts/configuration/secret.md @@ -822,7 +822,10 @@ are obtained from the API server. This includes any Pods created using `kubectl`, or indirectly via a replication controller. It does not include Pods created as a result of the kubelet `--manifest-url` flag, its `--config` flag, or its REST API (these are -not common ways to create Pods.) +not common ways to create Pods). +The `spec` of a {{< glossary_tooltip text="static Pod" term_id="static-pod" >}} cannot refer to a Secret +or any other API objects. + Secrets must be created before they are consumed in Pods as environment variables unless they are marked as optional. References to secrets that do diff --git a/content/en/docs/concepts/workloads/pods/_index.md b/content/en/docs/concepts/workloads/pods/_index.md index 20dbdcb9e8..5a46fe4e07 100644 --- a/content/en/docs/concepts/workloads/pods/_index.md +++ b/content/en/docs/concepts/workloads/pods/_index.md @@ -282,6 +282,13 @@ on the Kubernetes API server for each static Pod. This means that the Pods running on a node are visible on the API server, but cannot be controlled from there. +{{< note >}} +The `spec` of a static Pod cannot refer to other API objects +(e.g., {{< glossary_tooltip text="ServiceAccount" term_id="service-account" >}}, +{{< glossary_tooltip text="ConfigMap" term_id="configmap" >}}, +{{< glossary_tooltip text="Secret" term_id="secret" >}}, etc). +{{< /note >}} + ## Container probes A _probe_ is a diagnostic performed periodically by the kubelet on a container. To perform a diagnostic, the kubelet can invoke different actions: diff --git a/content/en/docs/tasks/configure-pod-container/static-pod.md b/content/en/docs/tasks/configure-pod-container/static-pod.md index 9126243462..cc38928199 100644 --- a/content/en/docs/tasks/configure-pod-container/static-pod.md +++ b/content/en/docs/tasks/configure-pod-container/static-pod.md @@ -31,6 +31,13 @@ Pods to run a Pod on every node, you should probably be using a instead. {{< /note >}} +{{< note >}} +The `spec` of a static Pod cannot refer to other API objects +(e.g., {{< glossary_tooltip text="ServiceAccount" term_id="service-account" >}}, +{{< glossary_tooltip text="ConfigMap" term_id="configmap" >}}, +{{< glossary_tooltip text="Secret" term_id="secret" >}}, etc). +{{< /note >}} + ## {{% heading "prerequisites" %}} {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}