Skip to content

Commit

Permalink
update transformerconfigs/crd example
Browse files Browse the repository at this point in the history
  • Loading branch information
Liujingfang1 committed Feb 27, 2019
1 parent 76c6655 commit f4eef1d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
1 change: 0 additions & 1 deletion examples/transformerconfigs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@ nameReference:

Kustomize has a default set of configurations. They can be saved to local directory through `kustomize config save -d`. Kustomize allows modifying those configuration files and using them in kustomization.yaml file. This tutorial shows how to customize those configurations to
- [support a CRD type](crd/README.md)
- disabling adding commonLabels to fields in some kind of resources
- add extra fields for variable substitution
- add extra fields for name reference
39 changes: 1 addition & 38 deletions examples/transformerconfigs/crd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,6 @@ Create a workspace by
DEMO_HOME=$(mktemp -d)
```

### Get the native config as a starting point

Get the default transformer configurations using this command:

<!-- @saveConfig @test -->
```
kustomize config save -d $DEMO_HOME/kustomizeconfig
```
The default configurations are saved
in the directory `$DEMO_HOME/kustomizeconfig` as several files

> ```
> commonannotations.yaml
> commonlabels.yaml
> nameprefix.yaml
> namereference.yaml
> namespace.yaml
> varreference.yaml
> ```
These files contain the field specifications for native resources
that transformation directives like `namePrefix`, `commonLabels`, etc.
need to do their work.

These default configurations already include some common
field specifictions for all types:

- nameprefix is added to `.metadata.name`
- namespace is added to `.metadata.namespace`
- labels is added to `.metadata.labels`
- annotations is added to `.metadata.annotations`

### Adding a custom resource

Consider a CRD of kind `MyKind` with fields
Expand All @@ -51,6 +19,7 @@ Consider a CRD of kind `MyKind` with fields
Add the following file to configure the transformers for the above fields
<!-- @addConfig @test -->
```
mkdir $DEMO_HOME/kustomizeconfig
cat > $DEMO_HOME/kustomizeconfig/mykind.yaml << EOF
commonLabels:
Expand Down Expand Up @@ -148,12 +117,6 @@ in the kustomization file:
cat >> $DEMO_HOME/kustomization.yaml << EOF
configurations:
- kustomizeconfig/mykind.yaml
- kustomizeconfig/commonannotations.yaml
- kustomizeconfig/commonlabels.yaml
- kustomizeconfig/nameprefix.yaml
- kustomizeconfig/namereference.yaml
- kustomizeconfig/namespace.yaml
- kustomizeconfig/varreference.yaml
EOF
```

Expand Down

0 comments on commit f4eef1d

Please sign in to comment.