Compare commits

...
2 Commits
Author SHA1 Message Date
Jeffrey 14ef1c6e91 zipline: migrate to envFrom with per-container InfisicalSecrets
Flat CR narrowed to recursive: false so it keeps serving the SMB mount credentials that zipline-uploads-pv references by name.
2026-08-23 20:08:43 +02:00
Jeffrey 3bec829396 infisical: repoint secret CRs at the rebuilt machine identity
Also tracks the auth ServiceAccounts and RBAC in Git so a namespace rebuild restores Kubernetes auth on its own.
2026-08-23 20:08:28 +02:00
26 changed files with 143 additions and 47 deletions
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -8,7 +8,7 @@ spec:
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "9f65814e-bf4c-42fc-b382-26be15b11416"
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
@@ -17,7 +17,9 @@ spec:
projectSlug: "kubernetes"
envSlug: "prod"
secretsPath: "/zipline"
recursive: true
# Root only: /zipline holds the SMB mount credentials (username, password)
# consumed by zipline-uploads-pv. Per-container env lives in subfolders.
recursive: false
managedSecretReference:
secretName: zipline-secrets
secretNamespace: zipline
@@ -0,0 +1,63 @@
# Kubernetes-native auth for the InfisicalSecret operator.
# infisical-auth: the identity the CRDs mint short-lived tokens for.
# infisical-token-reviewer: its JWT is pasted into Infisical's Kubernetes Auth
# config so Infisical can call TokenReview. Bound to system:auth-delegator below.
apiVersion: v1
kind: ServiceAccount
metadata:
name: infisical-auth
namespace: infisical
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: infisical-token-reviewer
namespace: infisical
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: infisical-token-reviewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: infisical-token-reviewer
namespace: infisical
---
# The operator needs to mint tokens for infisical-auth; without this it falls
# back to the legacy SA .secrets[] lookup and never gets a token.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: infisical-operator-token-creator
rules:
- apiGroups: [""]
resources: ["serviceaccounts/token"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: infisical-operator-token-creator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: infisical-operator-token-creator
subjects:
- kind: ServiceAccount
name: infisical-opera-controller-manager
namespace: infisical-operator
---
# Long-lived token for the reviewer SA. `kubectl create token` expires; the
# value pasted into Infisical's Kubernetes Auth config must not.
apiVersion: v1
kind: Secret
metadata:
name: infisical-token-reviewer
namespace: infisical
annotations:
kubernetes.io/service-account.name: infisical-token-reviewer
type: kubernetes.io/service-account-token
@@ -0,0 +1,25 @@
apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalSecret
metadata:
name: zipline-postgres-secrets
namespace: infisical
spec:
hostAPI: https://infisical.jsme.be
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
autoCreateServiceAccountToken: true
secretsScope:
projectSlug: "kubernetes"
envSlug: "prod"
secretsPath: "/zipline/postgres"
# Non-recursive: keys are already named as the container expects.
recursive: false
managedSecretReference:
secretName: zipline-postgres-secrets
secretNamespace: zipline
secretType: Opaque
@@ -31,22 +31,10 @@ spec:
volumeMounts:
- name: zipline-postgresql-database
mountPath: /var/lib/postgres
envFrom:
- secretRef:
name: zipline-postgres-secrets
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: zipline-secrets
key: db_password
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: zipline-secrets
key: db_user
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: zipline-secrets
key: db_name
- name: PGDATA
value: /var/lib/postgres/data
volumes:
@@ -0,0 +1,25 @@
apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalSecret
metadata:
name: zipline-app-secrets
namespace: infisical
spec:
hostAPI: https://infisical.jsme.be
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
autoCreateServiceAccountToken: true
secretsScope:
projectSlug: "kubernetes"
envSlug: "prod"
secretsPath: "/zipline/zipline"
# Non-recursive: keys are already named as the container expects.
recursive: false
managedSecretReference:
secretName: zipline-app-secrets
secretNamespace: zipline
secretType: Opaque
@@ -35,17 +35,10 @@ spec:
mountPath: /zipline/public
- name: themes
mountPath: /zipline/themes
envFrom:
- secretRef:
name: zipline-app-secrets
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: zipline-secrets
key: database_url
- name: CORE_SECRET
valueFrom:
secretKeyRef:
name: zipline-secrets
key: core_secret
- name: CORE_TRUSTED_PROXIES
value: "10.42.0.0/16"
restartPolicy: Always