Files
Homelabv4/infrastructure/vps-standby/gitlab/manifests/mirror-sync-secret.yaml
T
Scooby HuskyandClaude Sonnet 5 a104008111 Add VPS GitLab mirror-sync CronJob for Homelabv4 repo
GitLab's native pull-mirror feature is Premium/Ultimate-gated on this
chart/version - confirmed live: the project API rejects 'mirror' and
'import_url' as unrecognized params on this CE instance entirely.
Plain git equivalent instead: CronJob every 15min does
'git clone --mirror' from home's Scooby/Homelabv4 (read-only deploy
token) then 'git push --mirror' to the VPS copy (write_repository
PAT, since deploy tokens can't push - not a valid scope for them
either). Matches the original plan's 'Gitea pull mirror of the GitOps
source' intent now that real GitLab replaced Gitea. Both tokens in
Vault at secret/vps/gitlab-mirror, pulled via ExternalSecret.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 23:55:20 -05:00

40 lines
1.4 KiB
YAML

# Credentials for mirror-sync-cronjob.yaml. GitLab's native repository
# mirroring (pull mirror) is a Premium/Ultimate-gated feature as of this
# chart version - confirmed live 2026-08-21: the API rejects `mirror`
# and `import_url` as valid params on this CE instance entirely
# ("allow_merge_on_skipped_pipeline, ... are missing" - i.e. neither
# field is even recognized). So this CronJob does the plain-git
# equivalent (clone --mirror / push --mirror) on a schedule instead.
#
# - pull_username/pull_token: read-only deploy token on HOME's
# Scooby/Homelabv4 project (deploy tokens can't have write_repository
# - it's not a valid scope for them, confirmed live).
# - push_username/push_token: a write_repository-scoped Personal Access
# Token for VPS GitLab's root user (deploy tokens can't push either).
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: gitlab-mirror-sync
namespace: gitlab
spec:
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: vault-backend
target:
name: gitlab-mirror-sync-secret
creationPolicy: Owner
data:
- secretKey: pull_username
remoteRef:
key: vps/gitlab-mirror
property: username
- secretKey: pull_token
remoteRef:
key: vps/gitlab-mirror
property: token
- secretKey: push_token
remoteRef:
key: vps/gitlab-mirror
property: push_token