Compare commits

..

8 Commits

Author SHA1 Message Date
020b248bbe fix: force ServerSideApply on envoy-gateway Application
Gateway API CRDs (httproutes, envoyproxies) have schemas large enough that
client-side apply's last-applied-configuration annotation exceeds the
262144-byte annotation limit. SSA skips that annotation entirely.
2026-07-21 12:07:59 +07:00
fef69d587f fix: register envoy-gateway OCI repo declaratively in argocd values
ArgoCD only builds a helm-pull command for oci:// sources when the repo is
registered with enableOCI: true; otherwise it falls back to classic --repo
handling, which errors on an oci:// URL. Registered via configs.repositories
in argocd's own values.yaml (Git-managed), Application source updated to
the bare host/path form ArgoCD expects for OCI repos.
2026-07-21 12:02:02 +07:00
2a07b6decf fix: use OCI registry for envoy-gateway helm chart source
https://charts.gateway.envoyproxy.io no longer resolves (NXDOMAIN); chart is
now published at oci://docker.io/envoyproxy/gateway-helm.
2026-07-21 11:24:21 +07:00
7dda8715c1 fix: disable auto-sync on argocd Application
Allows manual Service edits (e.g. NodePort for temp access) without self-heal reverting them.
2026-07-21 10:41:20 +07:00
02b4f1f926 fix: ignore CRD status/caBundle drift on metallb Application
Prevents perpetual OutOfSync on bgppeers.metallb.io and other metallb CRDs caused by apiserver-populated .status fields not present in the Helm chart source.
2026-07-21 10:39:39 +07:00
2e5037d6f4 docs: trim README explanations, keep steps short 2026-07-14 19:35:34 +07:00
c2c265c898 docs: never store argocd admin password hash in git
Drop .env/envsubst/bake-hash-into-values.yaml flow entirely. Chart's
configs.secret block is removed for good, so the rendered manifest
never declares admin.password/admin.passwordMtime. Password hash is
set once directly on the live argocd-secret via kubectl patch, and
survives every self-heal sync since ArgoCD never owns those fields.
2026-07-14 18:52:46 +07:00
cffaa7449d fix argocd install + add root bootstrap Application manifest
- remove server.httproute from argocd values.yaml: helm install failed
  since Gateway API CRDs (installed by envoy-gateway, wave 2) don't
  exist yet; HTTPRoute is already applied manually in Phase 6
- add bootstrap-app.yaml as the Git-committed root/seed Application,
  replacing ad-hoc UI creation (GitOps anti-pattern: apps not stored
  in Git can't be recreated)
2026-07-14 17:50:06 +07:00
7 changed files with 56 additions and 73 deletions

View File

@@ -1,2 +0,0 @@
# Generate with: htpasswd -nbBC 10 "" YOUR_PASSWORD | tr -d ':\n' | sed 's/$2y/$2a/'
ARGOCD_ADMIN_PASSWORD_HASH=

View File

@@ -46,27 +46,13 @@ helm version
---
## Phase 2 — Set credentials
Install tools (one-time):
## Phase 2 — Install tools
```bash
sudo dnf install -y httpd-tools gettext
sudo dnf install -y httpd-tools
```
Copy and fill in `.env`:
```bash
cp .env.example .env
```
Generate bcrypt hash and set it in `.env`:
```bash
htpasswd -nbBC 10 "" YOUR_PASSWORD | tr -d ':\n' | sed 's/$2y/$2a/'
```
`.env` is gitignored — never commit it.
`htpasswd` generates the admin password hash used in Phase 3.1.
---
@@ -82,65 +68,45 @@ helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
```
Install ArgoCD (`envsubst` fills `$ARGOCD_ADMIN_PASSWORD_HASH` from `.env` before helm reads the values):
Install ArgoCD (`values.yaml` has no `configs.secret` block — chart auto-generates a random admin password):
```bash
source .env
helm install argocd argo/argo-cd -n argocd --create-namespace -f manifests/argocd/values.yaml
```
```bash
envsubst < manifests/argocd/values.yaml | helm install argocd argo/argo-cd -n argocd --create-namespace -f -
```
Wait for ArgoCD to be ready:
Wait for ready:
```bash
kubectl wait --for=condition=available deployment/argocd-server -n argocd --timeout=120s
```
Port-forward to access UI (MetalLB + Envoy not running yet):
(Optional) inspect manually: `kubectl port-forward svc/argocd-server -n argocd 8080:443``https://localhost:8080`. Not needed for bootstrap.
### 3.1 Set admin password on the Secret
Patched directly on `argocd-secret`, never in `values.yaml`/Git — keeps `configs.secret` absent so self-heal (wave -1) never touches it, password stays stable forever:
```bash
kubectl port-forward svc/argocd-server -n argocd 8080:443
read -s -p "ArgoCD admin password: " PW; echo
HASH=$(htpasswd -nbBC 12 "" "$PW" | tr -d ':\n' | sed 's/$2y/$2a/')
kubectl patch secret argocd-secret -n argocd --type merge -p \
"{\"stringData\":{\"admin.password\":\"$HASH\",\"admin.passwordMtime\":\"$(date -u +%FT%TZ)\"}}"
unset PW HASH
```
Open `https://localhost:8080` — login with `admin` and the password you chose.
### 3.1 Bake the hash into values.yaml for self-management
ArgoCD won't run `envsubst` when it self-manages — replace the placeholder with the real hash so future syncs work:
```bash
source .env
sed -i "s|\$ARGOCD_ADMIN_PASSWORD_HASH|$ARGOCD_ADMIN_PASSWORD_HASH|" manifests/argocd/values.yaml
```
```bash
git add manifests/argocd/values.yaml && git commit -m "set argocd admin password hash"
```
```bash
git push origin main
```
Rotate: repeat with new hash + new `admin.passwordMtime` (required for ArgoCD to accept the change).
---
## Phase 4 — Create bootstrap app in ArgoCD UI
## Phase 4 — Apply the root bootstrap Application
In ArgoCD UI, create a new Application:
`bootstrap-app.yaml` (repo root) is the seed manifest, committed to Git — not created via UI/CLI. Only manifest ever applied by hand:
| Field | Value |
|-------|-------|
| Application Name | `bootstrap` |
| Project | `default` |
| Sync Policy | Automated (enable Prune + Self Heal) |
| Repository URL | `https://gitea.fireflylab.cc/duynguyen/cluster-bootstrap.git` |
| Revision | `main` |
| Path | `bootstrap/apps` |
| Cluster URL | `https://kubernetes.default.svc` |
| Namespace | `argocd` |
```bash
kubectl apply -f bootstrap-app.yaml
```
Click **Create**. ArgoCD syncs all child Applications in wave order automatically.
ArgoCD syncs all child Applications in wave order automatically, including self-managing itself (`bootstrap/apps/argocd.yaml`, wave -1).
Monitor progress:
@@ -273,6 +239,7 @@ All Applications should be `Synced` / `Healthy`.
```
cluster-bootstrap/
├── README.md
├── bootstrap-app.yaml # root seed Application — the only manifest applied by hand
├── bootstrap/
│ └── apps/ # ArgoCD Application CRDs
│ ├── argocd.yaml # wave -1 — self-managed ArgoCD

18
bootstrap-app.yaml Normal file
View File

@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: bootstrap
namespace: argocd
spec:
project: default
source:
repoURL: https://gitea.fireflylab.cc/duynguyen/cluster-bootstrap.git
targetRevision: main
path: bootstrap/apps
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@@ -20,7 +20,3 @@ spec:
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@@ -8,7 +8,7 @@ metadata:
spec:
project: default
sources:
- repoURL: https://charts.gateway.envoyproxy.io
- repoURL: docker.io/envoyproxy
chart: gateway-helm
targetRevision: "v1.7.1"
helm:
@@ -26,3 +26,4 @@ spec:
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true

View File

@@ -26,3 +26,9 @@ spec:
selfHeal: true
syncOptions:
- CreateNamespace=true
ignoreDifferences:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
jsonPointers:
- /status
- /spec/conversion/webhook/clientConfig/caBundle

View File

@@ -18,15 +18,12 @@ global:
configs:
params:
server.insecure: true # TLS terminated at Envoy Gateway
secret:
argocdServerAdminPassword: "$ARGOCD_ADMIN_PASSWORD_HASH"
argocdServerAdminPasswordMtime: "2025-01-01T00:00:00Z"
repositories:
envoy-gateway-oci:
url: docker.io/envoyproxy
name: envoy-gateway-oci
type: helm
enableOCI: "true"
server:
replicas: 1
httproute:
enabled: true
parentRefs:
- name: envoy-gateway
namespace: gateway-system
sectionName: http