Add Generator Tasks to Documentation (#5368)

* Update tasks index description

* Create generators folder

* Update tasks/generators titles

* Add rollouts placeholder

* Add generate configmap from file example

* Add literals and env file example

* Add propogation example

* Consistent punctuation

* Update grammar

* Clean up configmaps page

* Remove examples from configMapGenerator ref page

* Move secret examples to Tasks

* Clean up spacing

* Consolidate cm and secret

* Consistent grammar

* Cleanup

* Address feedback

* Bump date

* Fix propagate spelling

* Remove roll out updates section

* Separate configmap and secret generator tasks

* Add secret from file example

* Add secret from literals example

* Update tls secret example

* Update task page weights

* Link cm generator reference

* Add link to secret reference

* Remove secretGenerator example from reference section

* Add configmap options task, clean up reference

* Add file with key example

* Secrets are base64 encoded
This commit is contained in:
Nick
2023-10-27 13:26:37 -07:00
committed by GitHub
parent a869386996
commit bd435d4154
8 changed files with 519 additions and 467 deletions

View File

@@ -10,86 +10,3 @@ description: >
Each entry in the argument list results in the creation of one Secret resource (it's a generator of N secrets).
This works like the [configMapGenerator](/docs/reference/api/kustomization-file/configmapgenerator).
```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
secretGenerator:
- name: app-tls
files:
- secret/tls.crt
- secret/tls.key
type: "kubernetes.io/tls"
- name: app-tls-namespaced
# you can define a namespace to generate
# a secret in, defaults to: "default"
namespace: apps
files:
- tls.crt=catsecret/tls.crt
- tls.key=secret/tls.key
type: "kubernetes.io/tls"
- name: env_file_secret
envs:
- env.txt
type: Opaque
- name: secret-with-annotation
files:
- app-config.yaml
type: Opaque
options:
annotations:
app_config: "true"
labels:
app.kubernetes.io/name: "app2"
```
Secret Resources may be generated much like ConfigMaps can. This includes generating them
from literals, files or environment files.
{{< alert color="success" title="Secret Syntax" >}}
Secret type is set using the `type` field.
{{< /alert >}}
## Example
### File Input
```yaml
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
secretGenerator:
- name: app-tls
files:
- "tls.crt"
- "tls.key"
type: "kubernetes.io/tls"
```
```yaml
# tls.crt
LS0tLS1CRUd...tCg==
```
```yaml
# tls.key
LS0tLS1CRUd...0tLQo=
```
### Build Output
```yaml
apiVersion: v1
data:
tls.crt: TFMwdExTMUNSVWQuLi50Q2c9PQ==
tls.key: TFMwdExTMUNSVWQuLi4wdExRbz0=
kind: Secret
metadata:
name: app-tls-c888dfbhf8
type: kubernetes.io/tls
```
{{< alert color="warning" title="Important" >}}
It is important to note that the secrets are `base64` encoded
{{< /alert >}}