mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-23 12:56:46 +00:00
GitLab cross-site replication Phase 2a (corrected): ignoreDifferences approach
The CONFIG_TEMPLATE_DIRECTORY redirect from the previous commit doesn't work - confirmed live that extraVolumes is a dead values key for the Praefect subchart specifically (its statefulset.yaml never calls the gitlab.extraVolumes helper in its volumes: list, only volumeMounts calls the corresponding helper - a real chart limitation, not a config mistake). A dangling volumeMount with no matching volume would have failed to schedule. Real fix: ignoreDifferences on ConfigMap gitlab-praefect's data field (argocd-apps/apps/gitlab.yaml) lets Helm create the object normally while ArgoCD stops reconciling its content afterward - the actual config gets kubectl-patched onto the live object directly. praefect-ha-configmap.yaml is now a git-tracked reference/documentation copy (deployed under its own harmless name) rather than something Helm/ArgoCD wires in on its own. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
a309495e1e
commit
6cf1d89278
@@ -1,4 +1,4 @@
|
|||||||
# GitLab cross-site replication Phase 2a (see
|
# GitLab cross-site replication (see
|
||||||
# /home/scooby/.claude/plans/jiggly-snacking-iverson.md) - the chart has
|
# /home/scooby/.claude/plans/jiggly-snacking-iverson.md) - the chart has
|
||||||
# no support for registering an externally-hosted Gitaly node into an
|
# no support for registering an externally-hosted Gitaly node into an
|
||||||
# existing Praefect virtual storage (confirmed live: no
|
# existing Praefect virtual storage (confirmed live: no
|
||||||
@@ -6,24 +6,34 @@
|
|||||||
# gitalyReplicas just counts StatefulSet ordinals). Overriding Praefect's
|
# gitalyReplicas just counts StatefulSet ordinals). Overriding Praefect's
|
||||||
# rendered config.toml is the only way to add one.
|
# rendered config.toml is the only way to add one.
|
||||||
#
|
#
|
||||||
# The chart's own gitlab-praefect ConfigMap (auto-rendered from
|
# A values-only CONFIG_TEMPLATE_DIRECTORY redirect (extraEnv +
|
||||||
# global.praefect.virtualStorages) is mounted at /etc/gitaly/templates,
|
# extraVolumes/extraVolumeMounts) was tried first and confirmed NOT to
|
||||||
# which CONFIG_TEMPLATE_DIRECTORY already points at - can't just add data
|
# work: charts/gitlab/charts/praefect/templates/statefulset.yaml's own
|
||||||
# to that SAME ConfigMap (ArgoCD/Helm fully owns and would revert it),
|
# volumes: list never calls the gitlab.extraVolumes helper (only
|
||||||
# and can't mount a second volume at the SAME path/name (Kubernetes
|
# volumeMounts does) - a chart limitation specific to this subchart, no
|
||||||
# rejects duplicate volume names). So this ConfigMap mounts at a
|
# values-only fix exists.
|
||||||
# DIFFERENT path (values.yaml's gitlab.praefect.extraVolumes), and
|
|
||||||
# CONFIG_TEMPLATE_DIRECTORY gets overridden via extraEnv to point at it
|
|
||||||
# instead - env var duplicate-key "last wins" IS legitimate documented
|
|
||||||
# Kubernetes behavior for a container's env: list, unlike volumes.
|
|
||||||
#
|
#
|
||||||
# Phase 2a content is intentionally byte-identical to the chart's own
|
# THIS ConfigMap (praefect-ha-config) is deployed as a harmless,
|
||||||
# current rendering (confirmed live via `kubectl -n gitlab get cm
|
# otherwise-unused object - it exists purely as a git-tracked reference
|
||||||
# gitlab-praefect -o jsonpath='{.data.config\.toml\.tpl}'`) - this
|
# copy of the content that actually matters. The REAL live config lives
|
||||||
# commit only proves the override mechanism itself doesn't break
|
# on the chart's own gitlab-praefect ConfigMap, which
|
||||||
# anything, before Phase 2b switches addressing to floating hostnames
|
# argocd-apps/apps/gitlab.yaml's ignoreDifferences now exempts from
|
||||||
# and adds the VPS as a 4th node (no reason to change addressing scheme
|
# ArgoCD's normal drift-reconciliation (its `data` field specifically) -
|
||||||
# before there's an actual cross-site node that needs it).
|
# apply this file's content to it directly:
|
||||||
|
# kubectl -n gitlab patch configmap gitlab-praefect --type merge \
|
||||||
|
# -p "{\"data\":{\"config.toml.tpl\":\"$(kubectl -n gitlab get cm \
|
||||||
|
# praefect-ha-config -o jsonpath='{.data.config\.toml\.tpl}' | \
|
||||||
|
# python3 -c 'import sys,json; print(json.dumps(sys.stdin.read())[1:-1])')\"}}"
|
||||||
|
# (or simpler: kubectl -n gitlab get cm praefect-ha-config -o
|
||||||
|
# jsonpath='{.data}' | kubectl -n gitlab patch cm gitlab-praefect --type
|
||||||
|
# merge -p "{\"data\":$(cat -)}")
|
||||||
|
#
|
||||||
|
# Content below is intentionally byte-identical to the chart's own
|
||||||
|
# current rendering for the first pass (confirmed live via `kubectl -n
|
||||||
|
# gitlab get cm gitlab-praefect -o jsonpath='{.data.config\.toml\.tpl}'`)
|
||||||
|
# - proves the ignoreDifferences + manual-patch mechanism itself doesn't
|
||||||
|
# break anything, before a follow-up switches addressing to floating
|
||||||
|
# hostnames and adds the VPS as a 4th node.
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
+23
-24
@@ -308,30 +308,29 @@ gitlab:
|
|||||||
# this one, so gitalyReplicas: 3 up there always won regardless of
|
# this one, so gitalyReplicas: 3 up there always won regardless of
|
||||||
# what this said. See global.praefect.virtualStorages above for the
|
# what this said. See global.praefect.virtualStorages above for the
|
||||||
# real config.)
|
# real config.)
|
||||||
|
#
|
||||||
# GitLab cross-site replication Phase 2a (see
|
# GitLab cross-site replication (see
|
||||||
# /home/scooby/.claude/plans/jiggly-snacking-iverson.md) - redirects
|
# /home/scooby/.claude/plans/jiggly-snacking-iverson.md): tried a
|
||||||
# Praefect's config template source so a hand-written config.toml.tpl
|
# values-only CONFIG_TEMPLATE_DIRECTORY redirect (extraEnv +
|
||||||
# (praefect-ha-configmap.yaml) can add a VPS-hosted Gitaly node the
|
# extraVolumes/extraVolumeMounts) to add a VPS-hosted Gitaly node the
|
||||||
# chart itself has no mechanism to register. The chart's own
|
# chart has no mechanism to register - confirmed live this doesn't
|
||||||
# gitlab-praefect ConfigMap is already mounted at
|
# work: extraVolumeMounts and extraEnv both render correctly, but
|
||||||
# /etc/gitaly/templates (which CONFIG_TEMPLATE_DIRECTORY points at by
|
# extraVolumes is a dead values key for THIS subchart specifically -
|
||||||
# default) - can't add a second volume at that same path/name
|
# charts/gitlab/charts/praefect/templates/statefulset.yaml's own
|
||||||
# (Kubernetes rejects duplicate volume names), so this mounts the
|
# volumes: list never calls the gitlab.extraVolumes helper at all
|
||||||
# override at a different path and points CONFIG_TEMPLATE_DIRECTORY
|
# (only volumeMounts does), so the mount has nothing to mount and the
|
||||||
# there instead. Duplicate env var names in a container's env: list
|
# pod would fail to schedule. No values-only fix exists.
|
||||||
# resolve last-wins (documented Kubernetes behavior) - this entry
|
#
|
||||||
# renders after the chart's own, so it's the one that takes effect.
|
# Real fix: argocd-apps/apps/gitlab.yaml's ignoreDifferences now
|
||||||
extraEnv:
|
# covers ConfigMap gitlab-praefect's `data` field, so Helm creates
|
||||||
CONFIG_TEMPLATE_DIRECTORY: /etc/gitaly/templates-ha
|
# the object (with its own 3-node content) but ArgoCD stops
|
||||||
extraVolumes:
|
# reconciling its content afterward. The actual multi-node content
|
||||||
- name: praefect-ha-config
|
# lives in apps/gitlab/manifests/praefect-ha-configmap.yaml as a
|
||||||
configMap:
|
# git-tracked reference/documentation copy (deployed under its own
|
||||||
name: praefect-ha-config
|
# name, praefect-ha-config, harmless and otherwise unused) - the
|
||||||
extraVolumeMounts:
|
# live gitlab-praefect ConfigMap gets kubectl-patched with that same
|
||||||
- name: praefect-ha-config
|
# content directly, same "documented but manually-applied"
|
||||||
mountPath: /etc/gitaly/templates-ha
|
# convention as every other cross-cluster secret in this plan.
|
||||||
readOnly: true
|
|
||||||
|
|
||||||
# GitLab Exporter for Prometheus metrics
|
# GitLab Exporter for Prometheus metrics
|
||||||
gitlab-exporter:
|
gitlab-exporter:
|
||||||
|
|||||||
@@ -33,6 +33,19 @@ spec:
|
|||||||
jsonPointers:
|
jsonPointers:
|
||||||
- /spec/ports
|
- /spec/ports
|
||||||
- /spec/selector
|
- /spec/selector
|
||||||
|
# GitLab cross-site replication (see
|
||||||
|
# /home/scooby/.claude/plans/jiggly-snacking-iverson.md) - the chart
|
||||||
|
# has no mechanism to register an externally-hosted (VPS) Gitaly node
|
||||||
|
# into Praefect's virtual storage. Lets the live ConfigMap's `data`
|
||||||
|
# be kubectl-patched directly (see apps/gitlab/manifests/
|
||||||
|
# praefect-ha-configmap.yaml for the content + patch command) without
|
||||||
|
# ArgoCD reverting it on the next sync - Helm still creates the
|
||||||
|
# object and everything else about it stays normally managed.
|
||||||
|
- group: ""
|
||||||
|
kind: ConfigMap
|
||||||
|
name: gitlab-praefect
|
||||||
|
jsonPointers:
|
||||||
|
- /data
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
automated:
|
automated:
|
||||||
prune: true
|
prune: true
|
||||||
|
|||||||
Reference in New Issue
Block a user