feat(k8s): pushsecret go templating

This commit is contained in:
Daniel Hougaard
2025-03-28 08:09:55 +04:00
parent c765c20539
commit 03b0334fa0
11 changed files with 282 additions and 67 deletions

View File

@@ -0,0 +1,39 @@
apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalPushSecret
metadata:
name: infisical-api-secret-sample-push
spec:
resyncInterval: 1m
hostAPI: http://localhost:8080/api
# Optional, defaults to replacement.
updatePolicy: Replace # If set to replace, existing secrets inside Infisical will be replaced by the value of the PushSecret on sync.
# Optional, defaults to no deletion.
deletionPolicy: Delete # If set to delete, the secret(s) inside Infisical managed by the operator, will be deleted if the InfisicalPushSecret CRD is deleted.
destination:
projectId: <project-id>
environmentSlug: <env-slug>
secretsPath: <secret-path>
push:
secret:
secretName: push-secret-demo # Secret CRD
secretNamespace: default
template:
includeAllSecrets: false
data:
# Encodes the data so it's stored as base64 in Infisical.
API_KEY: "{{ .API_KEY.Value }}"
DATABASE_URL: "{{ .DATABASE_URL.Value }}"
ENCRYPTION_KEY: "{{ .ENCRYPTION_KEY.Value }}"
OTHER_VALUE: "{{ encodeBase64 .API_KEY.Value }} {{ encodeBase64 .DATABASE_URL.Value }} {{ encodeBase64 .ENCRYPTION_KEY.Value }}"
# Only have one authentication method defined or you are likely to run into authentication issues.
# Remove all except one authentication method.
authentication:
universalAuth:
credentialsRef:
secretName: universal-auth-credentials
secretNamespace: default