Resource name constraints (4) (#19121)

xref: #17969, #19099, #18746
This commit is contained in:
Kubernetes Prow Robot
2020-03-05 11:28:38 -08:00
committed by GitHub
parent 066b9f3b8c
commit 6635262bbc
10 changed files with 36 additions and 7 deletions
@@ -90,10 +90,11 @@ To limit the access to the `nginx` service so that only Pods with the label `acc
{{< codenew file="service/networking/nginx-policy.yaml" >}}
The name of a NetworkPolicy object must be a valid
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
{{< note >}}
NetworkPolicy includes a `podSelector` which selects the grouping of Pods to which the policy applies. You can see this policy selects Pods with the label `app=nginx`. The label was automatically added to the Pod in the `nginx` Deployment. An empty `podSelector` selects all pods in the namespace.
{{< /note >}}
## Assign the policy to the service
@@ -95,6 +95,9 @@ metadata:
EOF
```
The name of a ServiceAccount object must be a valid
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
If you get a complete dump of the service account object, like this:
```shell