mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 02:27:37 +00:00
docs: added docs for template support in k8s operator
This commit is contained in:
@@ -162,6 +162,10 @@ spec:
|
|||||||
secretName: managed-secret
|
secretName: managed-secret
|
||||||
secretNamespace: default
|
secretNamespace: default
|
||||||
creationPolicy: "Orphan" ## Owner | Orphan
|
creationPolicy: "Orphan" ## Owner | Orphan
|
||||||
|
# template:
|
||||||
|
# includeAllSecrets: true
|
||||||
|
# data:
|
||||||
|
# CUSTOM_KEY: "{{ .KEY.SecretPath }} {{ .KEY.Value }}"
|
||||||
# secretType: kubernetes.io/dockerconfigjson
|
# secretType: kubernetes.io/dockerconfigjson
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -674,6 +678,51 @@ The namespace of the managed Kubernetes secret to be created.
|
|||||||
<Accordion title="managedSecretReference.secretType">
|
<Accordion title="managedSecretReference.secretType">
|
||||||
Override the default Opaque type for managed secrets with this field. Useful for creating kubernetes.io/dockerconfigjson secrets.
|
Override the default Opaque type for managed secrets with this field. Useful for creating kubernetes.io/dockerconfigjson secrets.
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
<Accordion title="managedSecretReference.template">
|
||||||
|
Templates enable you to transform data from Infisical before storing it as a Kubernetes Secret.
|
||||||
|
</Accordion>
|
||||||
|
<Accordion title="managedSecretReference.template.includeAllSecrets">
|
||||||
|
When set to true, this option injects all secrets retrieved from Infisical into your configuration.
|
||||||
|
Secrets defined in the template will override the automatically injected secrets.
|
||||||
|
</Accordion>
|
||||||
|
<Accordion title="managedSecretReference.template.data">
|
||||||
|
Define secret keys and their corresponding templates.
|
||||||
|
Each data value uses a Golang template with access to all secrets retrieved from the specified scope.
|
||||||
|
|
||||||
|
Secrets are structured as follows:
|
||||||
|
```golang
|
||||||
|
type TemplateSecret struct {
|
||||||
|
Value string `json:"value"`
|
||||||
|
SecretPath string `json:"secretPath"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Example template configuration:
|
||||||
|
```golang
|
||||||
|
managedSecretReference:
|
||||||
|
secretName: managed-secret
|
||||||
|
secretNamespace: default
|
||||||
|
template:
|
||||||
|
includeAllSecrets: true
|
||||||
|
data:
|
||||||
|
NEW_KEY: "{{ .KEY1.SecretPath }} {{ .KEY1.Value }}"
|
||||||
|
```
|
||||||
|
|
||||||
|
When you run the following command:
|
||||||
|
```bash
|
||||||
|
kubectl get secret managed-secret -o jsonpath='{.data}'
|
||||||
|
```
|
||||||
|
|
||||||
|
You'll receive Kubernetes secrets output that includes the NEW_KEY:
|
||||||
|
```bash
|
||||||
|
{... "KEY":"d29ybGQ=","NEW_KEY":"LyBoZWxsbw=="}
|
||||||
|
```
|
||||||
|
|
||||||
|
When you set `includeAllSecrets` as `false` the Kubernetes secrets outputs will be:
|
||||||
|
```bash
|
||||||
|
{"NEW_KEY":"LyBoZWxsbw=="}
|
||||||
|
```
|
||||||
|
</Accordion>
|
||||||
<Accordion title="managedSecretReference.creationPolicy">
|
<Accordion title="managedSecretReference.creationPolicy">
|
||||||
Creation polices allow you to control whether or not owner references should be added to the managed Kubernetes secret that is generated by the Infisical operator.
|
Creation polices allow you to control whether or not owner references should be added to the managed Kubernetes secret that is generated by the Infisical operator.
|
||||||
This is useful for tools such as ArgoCD, where every resource requires an owner reference; otherwise, it will be pruned automatically.
|
This is useful for tools such as ArgoCD, where every resource requires an owner reference; otherwise, it will be pruned automatically.
|
||||||
|
|||||||
Reference in New Issue
Block a user