Add common Tasks to documentation (#5383)

* Add labels, annotations, namespaces, and names tasks

* Remove redundant information from ref/labels ref/annotations

* Update labels and annotations example names for consistency

* Remove name, prefix and suffix api examples

* Add link to tasks in reference

* Add link to tasks section for ref/configMapGenerator and ref/secretGenerator

* Add Labels/Annotatations headers

* Add Labels

* Add Template Labels

* Cleanup Add Template Labels

* Consolidate commonLabels and labels.includeSelectors

* Improve commonAnnotations example

* Add labels and annotations ref links

* Add generated ConfigMap to namespace example

* Add name headers

* Change header weights so they appear in sidebar

* Add namespace/name links

* Add generated ConfigMap to namePrefix example

* Add name propagation example

* Add more description of name propagation

* template labels

* Address feedback for labels

* Address names feedback

* Update for consistency

* Address feedback

* Remove API
This commit is contained in:
Nick
2023-11-25 12:34:10 -08:00
committed by GitHub
parent 0122aa82ef
commit bfb00ecb27
10 changed files with 547 additions and 531 deletions

View File

@@ -7,52 +7,4 @@ description: >
Adds namespace to all resources.
---
Will override the existing namespace if it is set on a resource, or add it
if it is not set on a resource.
## Example
### File Input
```yaml
# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: the-deployment
namespace: the-namespace
spec:
replicas: 5
template:
containers:
- name: the-container
image: registry/container:latest
```
```yaml
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kustomize-namespace
resources:
- deployment.yaml
```
### Build Output
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: the-deployment
namespace: kustomize-namespace
spec:
replicas: 5
template:
containers:
- image: registry/container:latest
name: the-container
```
The Tasks section contains examples of how to use [`namespace`](/docs/tasks/namespaces_and_names/).