From 949ae5cb3871a3f3ffe8034501843fb389126e6a Mon Sep 17 00:00:00 2001 From: rock Date: Mon, 12 Oct 2026 20:54:00 +0800 Subject: [PATCH] feat(argocd): let ArgoCD reconcile azhi-infra from its private GitHub repo The homelab AppProject allowlist had no azhi repository, so an Application pointing at ToyoGlobal/azhi-infra fails admission with 'repository not permitted'. Adding the URL is the whole gate. The Application itself targets the repository default branch (harness/staging-slice), not main, and path k8s/overlays/azi-riotpiao. That overlay renders postgres and the API into namespace azi-riotpiao. The two Secrets the namespace needs stay out of Git: acr-pull carries the ACR pull credential and azhi-riotpiao-app-env carries the database credentials, the JWT secrets and the AES key. --- k8s/argocd/apps/72-azhi-riotpiao.yaml | 36 ++++++++++++++++++++++++ k8s/argocd/projects/homelab-project.yaml | 6 ++++ 2 files changed, 42 insertions(+) create mode 100644 k8s/argocd/apps/72-azhi-riotpiao.yaml diff --git a/k8s/argocd/apps/72-azhi-riotpiao.yaml b/k8s/argocd/apps/72-azhi-riotpiao.yaml new file mode 100644 index 0000000..f218065 --- /dev/null +++ b/k8s/argocd/apps/72-azhi-riotpiao.yaml @@ -0,0 +1,36 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: azhi-riotpiao + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: '8' +spec: + project: homelab + source: + # Private GitHub. The read-only credential is Secret azhi-infra-github in + # namespace argocd, created out-of-band. + repoURL: https://github.com/ToyoGlobal/azhi-infra.git + # The repository's default branch. It is not `main`: this repo's work + # happens on the staging slice branch, and `main` is behind it. + targetRevision: harness/staging-slice + # One directory, because ArgoCD reads a single path per source. That + # directory is a root kustomization over foundation, postgres and + # azhi-server. + path: k8s/overlays/azi-riotpiao + destination: + server: https://kubernetes.default.svc + namespace: azi-riotpiao + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + # The two Secrets this namespace needs are credentials, so they are created + # by hand and NOT by this Application: + # acr-pull — the private Alibaba ACR pull credential + # azhi-riotpiao-app-env — DB credentials, JWT secrets, AES key + # A missing imagePullSecret fails the pod outright and a missing app-env + # Secret leaves it in CreateContainerConfigError, which is the intended + # loud failure rather than a pod that runs against unknown values. diff --git a/k8s/argocd/projects/homelab-project.yaml b/k8s/argocd/projects/homelab-project.yaml index bc38dce..eeb1e25 100644 --- a/k8s/argocd/projects/homelab-project.yaml +++ b/k8s/argocd/projects/homelab-project.yaml @@ -16,6 +16,12 @@ spec: - https://github.com/Riotpiaole/Poimen-memory.git - https://github.com/Riotpiaole/Poimen-workflows.git - https://github.com/Riotpiaole/poimen*.git + # ToyoGlobal (GitHub, private). The azhi-infra Application reads its + # manifests from here, so the URL must be listed or ArgoCD rejects the + # Application with "repository not permitted". A read-only credential for + # this repo lives in Secret azhi-infra-github in namespace argocd; it is + # created out-of-band and is not committed, because it is a credential. + - https://github.com/ToyoGlobal/azhi-infra.git # In-cluster Forgejo repos — explicit allowlist (no wildcard) - https://forgejo.riotpiao.com/riotpiao-poimen/homelab.git - https://forgejo.riotpiao.com/riotpiao-poimen/homelab-frontend.git -- 2.54.0