Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions deploy/external-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Materializes the provider-upjet-github credentials Secret from OpenBao.
# Tenant-owned (applied by the github-config app's own ServiceAccount) and reads
# through the platform-provisioned NAMESPACED SecretStore `openbao` — NOT the
# shared cluster store — whose dedicated `github-config` Vault role is scoped to
# secret/data/infrastructure/github/* only. namespace is omitted on purpose: the
# platform tenant Kustomization injects it via targetNamespace (= github-config).
#
# The provider expects ONE JSON document ({"app_auth":[…],"owner":…}) whose
# pem_file value carries \n-escaped newlines — the template builds it from the
# three plain keys (toJson does the escaping), so the PEM lives in OpenBao as a
# normal multiline string. The values are placeholders until the maintainer
# overwrites secret/infrastructure/github/app in OpenBao (see the platform
# docs/github-management.md).
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: github-app-credentials
spec:
refreshInterval: 1h
secretStoreRef:
name: openbao
kind: SecretStore
target:
name: github-app-credentials
creationPolicy: Owner
template:
engineVersion: v2
type: Opaque
data:
credentials: '{"app_auth":[{"id":"{{ .app_id }}","installation_id":"{{ .installation_id }}","pem_file":{{ .pem | toJson }}}],"owner":"devantler-tech"}'
data:
- secretKey: app_id
remoteRef:
key: infrastructure/github/app
property: app_id
- secretKey: installation_id
remoteRef:
key: infrastructure/github/app
property: installation_id
- secretKey: pem
remoteRef:
key: infrastructure/github/app
property: pem
5 changes: 5 additions & 0 deletions deploy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Tenant-owned auth wiring: the namespaced ProviderConfig + the GitHub App
# credential ExternalSecret (read via the platform-provisioned namespaced
# SecretStore). See the platform repo's docs/github-management.md.
- external-secret.yaml
- provider-config.yaml
- repositories/
18 changes: 18 additions & 0 deletions deploy/provider-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Namespaced ProviderConfig (Crossplane v2): authenticates provider-upjet-github
# against the devantler-tech org as a GitHub App. Tenant-owned (applied by the
# github-config app's ServiceAccount). It is referenced by the namespaced
# Repository/… managed resources in this same namespace. The credentials Secret
# is local (same namespace), materialized by external-secret.yaml from OpenBao.
# namespace is omitted on purpose — the platform tenant Kustomization injects it
# via targetNamespace (= github-config). The github.m.upbound.io CRD is installed
# by the provider package (platform infrastructure layer).
apiVersion: github.m.upbound.io/v1beta1
kind: ProviderConfig
metadata:
name: default
spec:
credentials:
source: Secret
secretRef:
name: github-app-credentials
key: credentials