Skip to content

Commit

Permalink
Document AnnotationsTransformer
Browse files Browse the repository at this point in the history
Setup documentation for the build-in go plugin transformers and document
AnnotationsTransformer.
  • Loading branch information
annasong20 committed Jul 21, 2023
1 parent cd7ba17 commit 4c0da8b
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "AnnotationsTransformer"
linkTitle: "AnnotationsTransformer"
date: 2023-07-21
weight: 2
description: >
Specification of AnnotationsTransformer behavior
---
<!-- [kustomization reference]: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/ -->

<!-- TODO(annasong): What is "weight"? What is this "kustomization reference"? -->
<!-- TODO(annasong): Add Reference, Transformers, Utility/FieldSpec page descriptions -->

## _AnnotationTransformer_

### Usage via `kustomization.yaml`

#### field name: `commonAnnotations`

Adds annotations (non-identifying metadata) to
all resources. Like labels, these are key value
pairs.

```bash
commonAnnotations:
oncallPager: 800-555-1212
```

### Usage via `transformers` field

#### Arguments

> Annotations map\[string\]string
>
> FieldSpecs \[\][config.FieldSpec]
#### Example
>
> ```
> apiVersion: builtin
> kind: AnnotationsTransformer
> metadata:
> name: not-important-to-example
> annotations:
> app: myApp
> greeting/morning: a string with blanks
> fieldSpecs:
> - path: metadata/annotations
> create: true
> ```
43 changes: 43 additions & 0 deletions site/content/en/docs/Reference/Transformers/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Transformers"
linkTitle: "Transformers"
weight: 1
description: >
TODO
---

{{% pageinfo %}}
This is a placeholder page that shows you how to use this template site.
{{% /pageinfo %}}

If your project has an API, configuration, or other reference - anything that users need to look up that’s at an even lower level than a single task - put (or link to it) here. You can serve and link to generated reference docs created using Doxygen,
Javadoc, or other doc generation tools by putting them in your `static/` directory. Find out more in [Adding static content](https://docsy.dev/docs/adding-content/content/#adding-static-content). For OpenAPI reference, Docsy also provides a [Swagger UI layout and shortcode](https://www.docsy.dev/docs/adding-content/shortcodes/#swaggerui) that renders [Swagger UI](https://swagger.io/tools/swagger-ui/) using any OpenAPI YAML or JSON file as source.


A list of kustomize's built-in
generators and transformers.

For each, an example is given for

* triggering the feature via a dedicated kustomization
file field (e.g. the `AnnotationsTransformer` is
triggered by the `commonAnnotations` field).

* triggering the feature via the `generators` or `transformers` field
(by providing a config file specifying the feature's own configuration object).

The former method is convenient but limited in
power as most of the configuration options must
be defaulted. The latter method allows for
complete argument specification.

[types.GeneratorOptions]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/generatoroptions.go
[types.SecretArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/secretargs.go
[types.ConfigMapArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/configmapargs.go
[config.FieldSpec]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go
[types.ObjectMeta]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/objectmeta.go
[types.Selector]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/selector.go
[types.Replica]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/replica.go
[types.PatchStrategicMerge]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchstrategicmerge.go
[types.PatchTarget]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchtarget.go
[image.Image]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/image.go
2 changes: 1 addition & 1 deletion site/content/en/docs/Reference/glossary.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Glossary"
linkTitle: "Glossary"
weight: 3
weight: 20
date: 2017-01-05
description: >
Definitions of the terminology used when interacting with kustomize
Expand Down

0 comments on commit 4c0da8b

Please sign in to comment.