mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 10:15:22 +00:00
docs: Add documentation for namespace transformer
Add a short description of the namespace transformer and example usage to examples/transformerconfigs/README.md. References: #629 Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>
This commit is contained in:
@@ -117,6 +117,66 @@ commonAnnotations:
|
|||||||
oncallPager: 800-555-1212
|
oncallPager: 800-555-1212
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Namespace
|
||||||
|
|
||||||
|
The namespace transformer is used to update namespace references in your manifests when you set the `namespace` declaration in your `kustomization.yaml`.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
kustomization.yaml
|
||||||
|
|
||||||
|
```
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: example
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources.yaml
|
||||||
|
|
||||||
|
configurations:
|
||||||
|
- namespace.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
namespace.yaml
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
namespace:
|
||||||
|
- kind: AnimalPark
|
||||||
|
path: spec/gorillaRef/namespace
|
||||||
|
create: true
|
||||||
|
```
|
||||||
|
|
||||||
|
resources.yaml
|
||||||
|
|
||||||
|
```
|
||||||
|
apiVersion: animal/v1
|
||||||
|
kind: AnimalPark
|
||||||
|
metadata:
|
||||||
|
name: ap
|
||||||
|
spec:
|
||||||
|
gorillaRef:
|
||||||
|
name: gg
|
||||||
|
kind: Gorilla
|
||||||
|
apiVersion: animal/v1
|
||||||
|
```
|
||||||
|
|
||||||
|
Output of `kustomize build`:
|
||||||
|
|
||||||
|
```
|
||||||
|
apiVersion: animal/v1
|
||||||
|
kind: AnimalPark
|
||||||
|
metadata:
|
||||||
|
name: ap
|
||||||
|
namespace: example
|
||||||
|
spec:
|
||||||
|
gorillaRef:
|
||||||
|
apiVersion: animal/v1
|
||||||
|
kind: Gorilla
|
||||||
|
name: gg
|
||||||
|
namespace: example
|
||||||
|
```
|
||||||
|
|
||||||
## Name reference transformer
|
## Name reference transformer
|
||||||
|
|
||||||
`nameReference` Transformer is used to tie a target resource's name to a list of other resources' referrers' names.
|
`nameReference` Transformer is used to tie a target resource's name to a list of other resources' referrers' names.
|
||||||
|
|||||||
Reference in New Issue
Block a user