chore(release): 瘦身为纯客户账本——移除工具文件(ci/.drone.yml/bootstrap/docs/networking/storageclasses)

release 分支定位 = 受保护账本(environments/<客户>/ + applications/<客户>/ +
db-scripts/),工具单一真相在 master(流水线 checkout master 取工具);
此前 release 拖着 8 月分叉时的旧 promote.sh/.drone.yml,既落后又有
「手动在 release 触发旧流水线」的误用面。db-scripts/ 由 promote pin 步骤
按 DB_CHANGE 从 master 树同步(见 master 同批提交)。
environments|applications 下的 demo/dev 历史数据保留不动。
This commit is contained in:
Drone Release committed 2026-09-08 15:26:08 +08:00
1 parent b0299a7181
commit 0c76ca3f02
30 files changed
-35532

No files matched your search

-85
View File
@@ -1,85 +0,0 @@
# ============================================================================
# .drone.yml — MixingX 交付晋级流水线(release-promote)— 本仓库第一条流水线
#
# 触发方式: 手动 (Drone Web 界面 → 打开 mixingx.deploy → NEW BUILD)
# 参数(可选,均有默认):
# RELEASE_VERSION — 交付版本号 v1.0.1;不传则自动递增 patch(查 chart 仓库上一个 tag)
# CUSTOMER — 客户目录名,默认 mxlexus
# PROMOTE_PROTOCOLS — true 时连 protocol mock 镜像一起晋级,默认 false(现场不部署)
#
# 职责(五步,详见 ci/promote.sh):
# prepare: 解析版本号 + 读 demo 交付基线 + 核对交付镜像清单
# retag : 16 业务镜像 develop-* → v1.0.x,bit 级复制推 ACR(ADR-0067)
# chart : chart 仓库 bump Chart.yaml + 打 tag chart-v1.0.x
# pin : release 分支客户目录钉版(镜像 tag + chart tag)
#
# 边界:
# - 不构建任何镜像(构建属于 9 个源码仓库的流水线)
# - 不触碰 deploy master(demo 写回由构建流水线负责)
# - git push 凭证走 Drone netrc 自动注入;推 ACR 走 secrets(acr_push_*)
# - 凭证禁止走构建参数(会明文进构建历史,ADR-0066)
#
# Secrets (Drone → mixingx.deploy → Settings → Secrets):
# acr_push_username / acr_push_password — ACR 推送凭证(✅ 已配置)
# ============================================================================
kind: pipeline
type: docker
name: release-promote
trigger:
event:
- custom # 仅手动触发;push 事件(demo 写回)不触发任何东西
steps:
# ═══════════════════════════════════════════
# Step 1: 准备 — 版本号 + 交付基线 + 镜像清单核对
# ═══════════════════════════════════════════
- name: prepare
image: 192.168.1.119:8888/mixingx/gitops-tools:latest
pull: if-not-exists
commands:
- sh ci/promote.sh prepare
# ═══════════════════════════════════════════
# Step 2: 镜像晋级 — pull 119 → tag ACR → push
# ═══════════════════════════════════════════
- name: retag-images
image: docker:24-dind
pull: if-not-exists
privileged: true
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
ACR_USER:
from_secret: acr_push_username
ACR_PASS:
from_secret: acr_push_password
ACR_REGISTRY: mx-imserver-registry.cn-shanghai.cr.aliyuncs.com
HARBOR_REGISTRY: 192.168.1.119:8888/mixingx
commands:
- sh ci/promote.sh retag
# ═══════════════════════════════════════════
# Step 3: chart 版本化 — bump Chart.yaml + tag chart-v1.0.x
# ═══════════════════════════════════════════
- name: chart-tag
image: 192.168.1.119:8888/mixingx/gitops-tools:latest
pull: if-not-exists
commands:
- sh ci/promote.sh chart
# ═══════════════════════════════════════════
# Step 4: 交付分支钉版 — release 分支客户目录
# ═══════════════════════════════════════════
- name: pin-release
image: 192.168.1.119:8888/mixingx/gitops-tools:latest
pull: if-not-exists
commands:
- sh ci/promote.sh pin
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
-43
View File
@@ -1,43 +0,0 @@
# MixingX Deploy
This repository is the GitOps environment state for MixingX deployments.
Responsibilities:
- `applications/`: Argo CD Application manifests.
- `environments/`: environment-specific Helm values.
- Helm chart templates live in `mixingx.hub.chart.git`.
- Application source code and CI live in `mixingx.hub.git`.
Demo environment:
1. Register both repositories in Argo CD:
- `https://gitee.com/mixing-tech/mixingx.deploy.git`
- `https://gitee.com/mixing-tech/mixingx.hub.chart.git`
2. Apply or create `bootstrap/mixingx-demo-root.yaml`.
3. Argo CD will create/sync the applications under `applications/`.
Agent and edge fleets:
- `applications/agents.yaml` is an Argo CD ApplicationSet.
- `applications/edges.yaml` is an Argo CD ApplicationSet.
- `environments/demo/agent-common-values.yaml` contains shared Helm values for all agents.
- `environments/demo/edge-common-values.yaml` contains shared Helm values for all edges.
- Add or remove agent or edge instances by editing `spec.generators[0].list.elements` in the matching ApplicationSet.
- Prefer `nodeLabel` over `nodeName`; label the target node so Kubernetes scheduler can still bind local-path PVCs.
Example:
```bash
kubectl label node node1 mixingx.io/edge-node=shanghai
```
```yaml
- id: shanghai
description: Shanghai Agent
nodeLabel: shanghai
- id: beijing
description: Beijing Edge
nodeLabel: beijing
```
-35
View File
@@ -1,35 +0,0 @@
# release 分支纪律(ADR-0068)
本分支(`release`)是全部客户现场 ArgoCD 的唯一真相源。**平时静止,动即交付。**
## 谁能推
- 只有发布流水线(release-promote,mixingx.deploy 仓库的 Drone 流水线)可以推本分支。
- Gitee 分支保护:白名单 = 发布流水线机器账号,禁止 force push。(首次推送后配置,见改造清单 B1)
## 什么可以改
| 位置 | 谁改 | 怎么改 |
|------|------|--------|
| `environments/<customer>/image-version.yaml` | **仅流水线** | pin 步骤自动钉版 |
| `applications/<customer>/*.yaml` 的 chart targetRevision | **仅流水线** | pin 步骤自动替换 |
| `environments/<customer>/` 其余 values(站点参数) | 人工(走评审) | 直接 commit:密码、DNS、edge 清单等现场配置 |
| `environments/_common/` | 人工(走评审) | **铁律:只放非版本性内容(地址/secret 名/时区),禁止任何镜像 tag**——改这里会同时触发所有客户 |
| 其余一切(master 带来的 demo/dev 等) | **无人** | 只能通过 merge master 进入 |
## 共享变更怎么流
chart 结构/新应用等共享变化:先落 master(demo 验证),发布时流水线 pin 步骤前 `merge master`
(或人工 merge),一次惠及全部客户。
## 升级与回滚
- 升级 = 流水线推本分支 → 各现场 ArgoCD ~3 分钟自动 sync(leaf apps: automated + selfHeal,prune 关)
- 回滚 = revert 本分支上该客户目录的版本 commit → push
- 现场任何人手工 kubectl 的改动,selfHeal 会在几分钟内打回 git 版本
## 多客户演进
新客户 = 复制 `environments/mxlexus/` + `applications/mxlexus/` 为新目录 + `bootstrap/` 加 root app,
零结构改动。出现"某客户停机检修期间分支必须绝对静止"或客户数 >~5 时,再把该客户目录拆成
独立分支(结构不变,ADR-0068 Considered Options)。
-76
View File
@@ -1,76 +0,0 @@
# Argo CD Offline Bootstrap
This directory is the supported installation and recovery path for Argo CD on the demo k3s server `192.168.1.173`.
It allows Argo CD to restart while Harbor `192.168.1.119:8888` is unavailable, provided the exact pinned images are already present in the server's k3s containerd cache. It does not make new or uncached image versions available offline.
## Pinned sources
- Argo CD release: `v3.4.4`
- Upstream manifest: `https://raw.githubusercontent.com/argoproj/argo-cd/v3.4.4/manifests/install.yaml`
- Vendored manifest: `vendor/install-v3.4.4.yaml`
- SHA-256: `b0f9119821f2e19b852c842b9cb235eb9c3ef1549554fbda6aa5904e8d440eae`
The Kustomize overlay rewrites the upstream images to:
```text
192.168.1.119:8888/argoproj/argocd:v3.4.4
192.168.1.119:8888/dexidp/dex:v2.45.0
192.168.1.119:8888/library/redis:8.2.3-alpine
```
All Argo CD Deployment and StatefulSet containers, including init containers, explicitly use `imagePullPolicy: IfNotPresent`.
## Install or recover
Copy this entire directory to the k3s server, then run:
```bash
sudo ./apply.sh
```
The script is idempotent. Before applying anything, it:
1. Renders and verifies the local vendored manifest.
2. Rejects upstream images and any `imagePullPolicy: Always`.
3. Verifies all three exact Harbor image references are in the local k3s image cache.
4. Records the existing Argo CD Applications.
It then applies the render with Kubernetes Server-Side Apply and conflict resolution, waits up to 300 seconds per workload, verifies the live pull policies, rejects image-pull failures, and confirms that pre-existing Applications remain present.
Server-Side Apply is required for Argo CD 3.3 and later because the ApplicationSet CRD exceeds Kubernetes' 262144-byte annotation limit for client-side apply. The flags match the official Argo CD install and upgrade procedure:
```text
--server-side --force-conflicts
```
The script never pulls, retags, deletes, or garbage-collects images. If an image is missing, restore Harbor or deliberately import that exact image before retrying.
Do not apply the upstream `install.yaml` directly. Its `Always` policies will make Argo CD depend on Harbor again after pods or the server restart.
## Verify
```bash
sudo k3s kubectl -n argocd get pods
sudo k3s kubectl -n argocd get deploy,statefulset \
-o jsonpath='{range .items[*]}{.kind}{"/"}{.metadata.name}{"\n"}{range .spec.template.spec.initContainers[*]} init:{.name}={.imagePullPolicy}{"\n"}{end}{range .spec.template.spec.containers[*]} container:{.name}={.imagePullPolicy}{"\n"}{end}{end}'
sudo k3s kubectl -n argocd get applications.argoproj.io -o name
```
Every listed container and init container must report `IfNotPresent`. No pod may report `ErrImagePull` or `ImagePullBackOff`.
## Upgrade
For each Argo CD upgrade:
1. Download `manifests/install.yaml` from an exact Argo CD release tag, never `stable`.
2. Replace the vendored manifest and record its new SHA-256 here.
3. Update the Argo CD, Dex, and Redis versions in `kustomization.yaml`, `verify-render.sh`, and `apply.sh`.
4. Compare upstream workload and container names with `tests/expected-workloads.txt`; update the inventory and patches if upstream changed them.
5. Run `kubectl kustomize .` and `./verify-render.sh <rendered-file>` locally.
6. Push the new images to Harbor and ensure the exact Harbor references are cached or explicitly imported on `192.168.1.173`.
7. Run only `sudo ./apply.sh`, then verify rollouts, pull policies, pods, and Applications.
Never apply an upgrade until the cache precheck passes.
-121
View File
@@ -1,121 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INVENTORY_FILE="$SCRIPT_DIR/tests/expected-workloads.txt"
VERIFY_SCRIPT="$SCRIPT_DIR/verify-render.sh"
ROLLOUT_TIMEOUT="${ROLLOUT_TIMEOUT:-300s}"
EXPECTED_IMAGES=(
"192.168.1.119:8888/argoproj/argocd:v3.4.4"
"192.168.1.119:8888/dexidp/dex:v2.45.0"
"192.168.1.119:8888/library/redis:8.2.3-alpine"
)
fail() {
echo "ERROR: $*" >&2
exit 1
}
[[ "${EUID:-$(id -u)}" -eq 0 ]] || fail "this script must run as root (use sudo)"
command -v k3s >/dev/null 2>&1 || fail "k3s is required"
[[ -x "$VERIFY_SCRIPT" ]] || fail "render verifier is missing or not executable: $VERIFY_SCRIPT"
[[ -s "$INVENTORY_FILE" ]] || fail "workload inventory is missing or empty: $INVENTORY_FILE"
temporary_dir="$(mktemp -d)"
trap 'rm -rf "$temporary_dir"' EXIT
rendered_manifest="$temporary_dir/argocd-install.yaml"
cached_images="$temporary_dir/cached-images.txt"
applications_before="$temporary_dir/applications-before.txt"
applications_after="$temporary_dir/applications-after.txt"
echo "Rendering pinned Argo CD offline manifest..."
k3s kubectl kustomize "$SCRIPT_DIR" > "$rendered_manifest" \
|| fail "kustomize render failed"
"$VERIFY_SCRIPT" "$rendered_manifest"
echo "Checking the local k3s containerd image cache..."
k3s ctr images list -q | sort -u > "$cached_images" \
|| fail "could not read the k3s containerd image cache"
missing_images=()
for expected_image in "${EXPECTED_IMAGES[@]}"; do
if ! grep -Fxq "$expected_image" "$cached_images"; then
missing_images+=("$expected_image")
fi
done
if (( ${#missing_images[@]} > 0 )); then
echo "ERROR: required images are missing from the local k3s cache:" >&2
printf ' %s\n' "${missing_images[@]}" >&2
fail "restore Harbor or import the exact images before applying"
fi
if k3s kubectl get crd applications.argoproj.io >/dev/null 2>&1; then
k3s kubectl -n argocd get applications.argoproj.io -o name 2>/dev/null \
| sort > "$applications_before"
else
: > "$applications_before"
fi
echo "Applying the verified manifest..."
k3s kubectl apply --server-side --force-conflicts -f "$rendered_manifest"
while read -r resource _containers; do
[[ -n "$resource" ]] || continue
resource_kind="${resource%%/*}"
resource_name="${resource#*/}"
resource_kind="$(printf '%s' "$resource_kind" | tr '[:upper:]' '[:lower:]')"
echo "Waiting for $resource_kind/$resource_name..."
k3s kubectl -n argocd rollout status "$resource_kind/$resource_name" \
--timeout="$ROLLOUT_TIMEOUT"
done < "$INVENTORY_FILE"
echo "Verifying live pull policies..."
while read -r resource containers; do
[[ -n "$resource" && -n "$containers" ]] || continue
resource_kind="${resource%%/*}"
resource_name="${resource#*/}"
resource_kind="$(printf '%s' "$resource_kind" | tr '[:upper:]' '[:lower:]')"
live_policies="$temporary_dir/${resource_kind}-${resource_name}-policies.txt"
k3s kubectl -n argocd get "$resource_kind/$resource_name" \
-o jsonpath='{range .spec.template.spec.initContainers[*]}{.name}={.imagePullPolicy}{"\n"}{end}{range .spec.template.spec.containers[*]}{.name}={.imagePullPolicy}{"\n"}{end}' \
| sort > "$live_policies"
expected_count=0
for container in $containers; do
expected_count=$((expected_count + 1))
grep -Fxq "$container=IfNotPresent" "$live_policies" \
|| fail "$resource does not have IfNotPresent for container $container"
done
actual_count="$(wc -l < "$live_policies" | tr -d '[:space:]')"
[[ "$actual_count" -eq "$expected_count" ]] \
|| fail "$resource container inventory changed: expected $expected_count, found $actual_count"
done < "$INVENTORY_FILE"
k3s kubectl -n argocd get applications.argoproj.io -o name 2>/dev/null \
| sort > "$applications_after"
missing_applications="$(comm -23 "$applications_before" "$applications_after")"
if [[ -n "$missing_applications" ]]; then
echo "ERROR: pre-existing Argo CD Applications are missing after apply:" >&2
printf '%s\n' "$missing_applications" >&2
exit 1
fi
pod_waiting_reasons="$(
k3s kubectl -n argocd get pods \
-o jsonpath='{range .items[*]}{.metadata.name}{" "}{range .status.initContainerStatuses[*]}{.state.waiting.reason}{" "}{end}{range .status.containerStatuses[*]}{.state.waiting.reason}{" "}{end}{"\n"}{end}'
)"
if printf '%s\n' "$pod_waiting_reasons" | grep -Eq 'ErrImagePull|ImagePullBackOff'; then
printf '%s\n' "$pod_waiting_reasons" >&2
fail "an Argo CD pod is still in an image-pull failure state"
fi
echo "Argo CD offline bootstrap completed successfully."
k3s kubectl -n argocd get pods -o wide
echo "Retained pre-existing Applications: $(wc -l < "$applications_before" | tr -d '[:space:]')"
@@ -1,28 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: argocd
resources:
- namespace.yaml
- vendor/install-v3.4.4.yaml
images:
- name: quay.io/argoproj/argocd
newName: 192.168.1.119:8888/argoproj/argocd
newTag: v3.4.4
- name: ghcr.io/dexidp/dex
newName: 192.168.1.119:8888/dexidp/dex
newTag: v2.45.0
- name: public.ecr.aws/docker/library/redis
newName: 192.168.1.119:8888/library/redis
newTag: 8.2.3-alpine
patches:
- path: patches/application-controller.yaml
- path: patches/applicationset-controller.yaml
- path: patches/dex-server.yaml
- path: patches/notifications-controller.yaml
- path: patches/redis.yaml
- path: patches/repo-server.yaml
- path: patches/server.yaml
-4
View File
@@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: argocd
@@ -1,10 +0,0 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: argocd-application-controller
spec:
template:
spec:
containers:
- name: argocd-application-controller
imagePullPolicy: IfNotPresent
@@ -1,10 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-applicationset-controller
spec:
template:
spec:
containers:
- name: argocd-applicationset-controller
imagePullPolicy: IfNotPresent
@@ -1,13 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-dex-server
spec:
template:
spec:
containers:
- name: dex
imagePullPolicy: IfNotPresent
initContainers:
- name: copyutil
imagePullPolicy: IfNotPresent
@@ -1,10 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-notifications-controller
spec:
template:
spec:
containers:
- name: argocd-notifications-controller
imagePullPolicy: IfNotPresent
@@ -1,13 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-redis
spec:
template:
spec:
containers:
- name: redis
imagePullPolicy: IfNotPresent
initContainers:
- name: secret-init
imagePullPolicy: IfNotPresent
@@ -1,13 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-repo-server
spec:
template:
spec:
containers:
- name: argocd-repo-server
imagePullPolicy: IfNotPresent
initContainers:
- name: copyutil
imagePullPolicy: IfNotPresent
@@ -1,10 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-server
spec:
template:
spec:
containers:
- name: argocd-server
imagePullPolicy: IfNotPresent
@@ -1,7 +0,0 @@
Deployment/argocd-applicationset-controller argocd-applicationset-controller
Deployment/argocd-dex-server dex copyutil
Deployment/argocd-notifications-controller argocd-notifications-controller
Deployment/argocd-redis redis secret-init
Deployment/argocd-repo-server argocd-repo-server copyutil
Deployment/argocd-server argocd-server
StatefulSet/argocd-application-controller argocd-application-controller
File diff suppressed because it is too large. Load diff
-160
View File
@@ -1,160 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INVENTORY_FILE="$SCRIPT_DIR/tests/expected-workloads.txt"
fail() {
echo "ERROR: $*" >&2
exit 1
}
[[ $# -eq 1 ]] || fail "usage: $0 <rendered-manifest>"
rendered_manifest="$1"
[[ -s "$rendered_manifest" ]] || fail "rendered manifest is missing or empty: $rendered_manifest"
[[ -s "$INVENTORY_FILE" ]] || fail "workload inventory is missing or empty: $INVENTORY_FILE"
expected_images=(
"192.168.1.119:8888/argoproj/argocd:v3.4.4"
"192.168.1.119:8888/dexidp/dex:v2.45.0"
"192.168.1.119:8888/library/redis:8.2.3-alpine"
)
for expected_image in "${expected_images[@]}"; do
grep -Fq "image: $expected_image" "$rendered_manifest" \
|| fail "expected image is missing: $expected_image"
done
while IFS= read -r actual_image; do
case "$actual_image" in
"${expected_images[0]}"|"${expected_images[1]}"|"${expected_images[2]}") ;;
*) fail "unexpected workload image in render: $actual_image" ;;
esac
done < <(awk '$1 == "image:" {gsub(/"/, "", $2); print $2}' "$rendered_manifest" | sort -u)
if grep -Eq 'image:[[:space:]]+(quay\.io|ghcr\.io|public\.ecr\.aws)/' "$rendered_manifest"; then
fail "upstream image reference remains in render"
fi
if grep -Fq 'imagePullPolicy: Always' "$rendered_manifest"; then
fail "imagePullPolicy Always remains in render"
fi
verify_workload() {
local resource="$1"
shift
local expected_containers="$*"
local expected_kind="${resource%%/*}"
local expected_name="${resource#*/}"
awk \
-v expected_kind="$expected_kind" \
-v expected_name="$expected_name" \
-v expected_containers="$expected_containers" '
function reset_document() {
delete lines
line_count = 0
}
function validate_document( i, kind, name, in_metadata, in_containers,
policy_count, container_count, field_name,
field_value, expected_count, expected,
container_name) {
kind = ""
name = ""
in_metadata = 0
in_containers = 0
policy_count = 0
container_count = 0
delete seen_containers
for (i = 1; i <= line_count; i++) {
if (lines[i] ~ /^kind: /) {
kind = lines[i]
sub(/^kind: /, "", kind)
} else if (lines[i] == "metadata:") {
in_metadata = 1
} else if (in_metadata && lines[i] ~ /^ name: /) {
name = lines[i]
sub(/^ name: /, "", name)
in_metadata = 0
}
}
if (kind != expected_kind || name != expected_name) {
return
}
found_workload = 1
for (i = 1; i <= line_count; i++) {
if (lines[i] ~ /^ (containers|initContainers):$/) {
in_containers = 1
continue
}
if (in_containers && lines[i] ~ /^ [[:alnum:]][[:alnum:]-]*:/) {
in_containers = 0
}
if (!in_containers) {
continue
}
if (lines[i] ~ /^ name: /) {
container_name = lines[i]
sub(/^ name: /, "", container_name)
seen_containers[container_name]++
container_count++
} else if (lines[i] ~ /^ imagePullPolicy: /) {
field_value = lines[i]
sub(/^ imagePullPolicy: /, "", field_value)
if (field_value != "IfNotPresent") {
printf "ERROR: %s/%s has non-offline pull policy: %s\n", kind, name, field_value > "/dev/stderr"
errors++
}
policy_count++
}
}
expected_count = split(expected_containers, expected, /[[:space:]]+/)
for (i = 1; i <= expected_count; i++) {
if (seen_containers[expected[i]] != 1) {
printf "ERROR: %s/%s expected container exactly once: %s\n", kind, name, expected[i] > "/dev/stderr"
errors++
}
}
if (container_count != expected_count) {
printf "ERROR: %s/%s container inventory mismatch: expected %d, found %d\n", kind, name, expected_count, container_count > "/dev/stderr"
errors++
}
if (policy_count != container_count) {
printf "ERROR: %s/%s requires explicit IfNotPresent on every container: %d containers, %d policies\n", kind, name, container_count, policy_count > "/dev/stderr"
errors++
}
}
/^---$/ {
validate_document()
reset_document()
next
}
{ lines[++line_count] = $0 }
END {
validate_document()
if (!found_workload) {
printf "ERROR: expected workload is missing: %s/%s\n", expected_kind, expected_name > "/dev/stderr"
errors++
}
exit(errors > 0 ? 1 : 0)
}
' "$rendered_manifest"
}
while read -r resource containers; do
[[ -n "$resource" && -n "$containers" ]] || fail "invalid workload inventory entry"
# shellcheck disable=SC2086
verify_workload "$resource" $containers
done < "$INVENTORY_FILE"
echo "Argo CD offline render verification passed."
-20
View File
@@ -1,20 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mixingx-demo-root
namespace: argocd
spec:
project: default
source:
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
targetRevision: master
path: applications/demo
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: false
selfHeal: true
syncOptions:
- CreateNamespace=true
-20
View File
@@ -1,20 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mixingx-dev-root
namespace: argocd
spec:
project: default
source:
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
targetRevision: master
path: applications/dev
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: false
selfHeal: true
syncOptions:
- CreateNamespace=true
-24
View File
@@ -1,24 +0,0 @@
# mxlexus 现场 root app(一次性手工 apply,runbook 见改造清单 D3)
#
# 闸门语义(ADR-0068):targetRevision 钉 release 分支——平时静止,仅发布流水线可推;
# path 钉 applications/mxlexus——只感知本目录变化,其他客户互不影响。
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mixingx-mxlexus-root
namespace: argocd
spec:
project: default
source:
repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
targetRevision: release
path: applications/mxlexus
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: false
selfHeal: true
syncOptions:
- CreateNamespace=true
-25
View File
@@ -1,25 +0,0 @@
#!/bin/sh
# ============================================================================
# ci/auto-bump.sh — 交付版本号自动递增(release-promote 未传 RELEASE_VERSION 时调用)
#
# 规则: 查 chart 仓库已有 chart-vX.Y.Z tag 的最大值,patch +1;
# 无任何 tag 时从 v1.0.1 起步(与现有 appVersion 1.0.1 谱系对齐)。
# 输出: v1.0.2 这样的版本号(stdout,单行)
# ============================================================================
set -eu
CHART_REPO="${CHART_REPO:-https://gitee.com/mixing-tech/mixingx.hub.chart.git}"
latest=$(git ls-remote --tags "$CHART_REPO" 'refs/tags/chart-v*' \
| sed -E 's#.*refs/tags/chart-v##' \
| sort -t. -k1,1n -k2,2n -k3,3n | tail -1 || true)
if [ -z "$latest" ]; then
echo "v1.0.1"
exit 0
fi
major=$(echo "$latest" | cut -d. -f1)
minor=$(echo "$latest" | cut -d. -f2)
patch=$(echo "$latest" | cut -d. -f3)
patch=$((patch + 1))
echo "v${major}.${minor}.${patch}"
-248
View File
@@ -1,248 +0,0 @@
#!/bin/sh
# ============================================================================
# ci/promote.sh — 交付晋级脚本(release-promote 流水线的执行体)— ADR-0067
#
# 子命令(由 .drone.yml 的四个 step 分别调用,状态经 /drone/src/.release-env
# 与 /drone/src/.baseline 文件在 step 间传递):
#
# prepare 解析 RELEASE_VERSION/CUSTOMER,读 demo image-version 的 develop tag
# 组合(= 交付基线),克隆 chart 仓库核对交付镜像清单
# retag 交付基线镜像 pull 119 → tag ACR:v1.0.x → push(bit 级复制,不重新构建)
# chart chart 仓库 10 个 Chart.yaml bump + commit + tag chart-v1.0.x + push
# pin deploy release 分支:客户 image-version 钉 v1.0.x +
# applications 客户目录 targetRevision 钉 chart tag + push
#
# 原则:
# - 交付基线 = demo 正在跑且回归过的 develop tag 组合(只读 master,不改 master)
# - 客户目录只允许本流水线写(release 分支受保护,ADR-0068)
# - 任何一步失败即终止,不留半成品(ACR 里的 v1.0.x tag 幂等可重推)
# ============================================================================
set -eu
WS="${DRONE_WORKSPACE:-/drone/src}"
ENV_FILE="$WS/.release-env"
BASELINE_FILE="$WS/.baseline"
CHART_DIR="$WS/.ci/chart"
DEPLOY_REPO="${DEPLOY_REPO:-https://gitee.com/mixing-tech/mixingx.deploy.git}"
CHART_REPO="${CHART_REPO:-https://gitee.com/mixing-tech/mixingx.hub.chart.git}"
CHARTS_DIR="release-charts"
log() { echo "[promote] $*"; }
die() { echo "[promote] 错误: $*" >&2; exit 1; }
git_setup() {
git config --global url."https://gitee.com/".insteadOf "git@gitee.com:" 2>/dev/null || true
git config user.name "Drone Release"
git config user.email "drone-release@mixingx.local"
}
require_env() {
[ -f "$ENV_FILE" ] || die "缺少 $ENV_FILE,请先运行 prepare 步骤"
. "$ENV_FILE"
[ -n "${RELEASE_VERSION:-}" ] && [ -n "${CUSTOMER:-}" ] && [ -n "${CHART_TAG:-}" ] \
|| die "$ENV_FILE 内容不完整"
}
# ─────────────────────────────────────────────
# prepare
# ─────────────────────────────────────────────
do_prepare() {
# 客户解析:客户目录在 release 分支上(工作区是 master,不含客户目录)
# 唯一客户目录时可省略 CUSTOMER;多客户时不填即拒绝(防发错现场)
git fetch -q origin release || die "release 分支不存在,请先推送初始 release 分支"
CUSTOMERS=$(git ls-tree --name-only "origin/release" environments/ 2>/dev/null \
| sed 's#^environments/##' | sed 's#/$##' | grep -vE '^(_common|demo|dev)$' || true)
C_COUNT=$(printf '%s\n' "$CUSTOMERS" | grep -c . || true)
if [ -z "${CUSTOMER:-}" ]; then
if [ "$C_COUNT" = "1" ]; then
CUSTOMER="$CUSTOMERS"
log "未指定 CUSTOMER,唯一客户目录: $CUSTOMER"
else
die "检测到 ${C_COUNT} 个客户目录,不填 CUSTOMER 无法确定发给谁。现有客户: $(printf '%s ' $CUSTOMERS)"
fi
fi
printf '%s\n' "$CUSTOMERS" | grep -qx "$CUSTOMER" \
|| die "environments/$CUSTOMER 不在 release 分支上。现有客户: $(printf '%s ' $CUSTOMERS)"
RELEASE_VERSION="${RELEASE_VERSION:-$(sh ci/auto-bump.sh)}"
case "$RELEASE_VERSION" in
v[0-9]*.[0-9]*.[0-9]*) : ;;
*) die "RELEASE_VERSION 格式应为 vX.Y.Z,收到: $RELEASE_VERSION" ;;
esac
CHART_TAG="chart-$RELEASE_VERSION"
log "交付版本: $RELEASE_VERSION 客户: $CUSTOMER chart tag: $CHART_TAG"
# 防重复发布:chart tag 已存在即拒绝(交付版本号不可变)
if git ls-remote --tags "$CHART_REPO" "refs/tags/$CHART_TAG" | grep -q .; then
die "$CHART_TAG 已存在于 chart 仓库,交付版本不可复用;请递增版本号"
fi
# 读 demo 交付基线(此刻 master 的 develop tag 组合 = demo 正跑且回归过的版本)
python3 - "$WS/environments/demo/image-version.yaml" "$BASELINE_FILE" "${PROMOTE_PROTOCOLS:-false}" <<'PY'
import sys, yaml
src, dst, with_protocols = sys.argv[1], sys.argv[2], sys.argv[3] == "true"
data = yaml.safe_load(open(src, encoding="utf-8"))
images = data.get("images") or {}
lines = []
def walk(prefix, node):
for k, v in node.items():
key = f"{prefix}.{k}" if prefix else k
if not isinstance(v, dict):
continue
if "repository" in v and "tag" in v:
lines.append((key, v["repository"], v["tag"]))
else:
walk(key, v)
walk("", images)
out, skipped = [], []
for key, repo, tag in lines:
if key.startswith("protocol.") and not with_protocols:
skipped.append(key); continue
if not repo or not tag:
sys.exit(f"[promote] 错误: demo image-version 中 {key} 缺 repository/tag")
out.append(f"{repo} {tag}")
open(dst, "w", encoding="utf-8").write("\n".join(out) + "\n")
print(f"[promote] 交付基线 {len(out)} 个镜像: " + ", ".join(l.split()[0] for l in out))
if skipped: print(f"[promote] 跳过 protocol 镜像: {', '.join(skipped)}")
PY
# 克隆 chart 仓库(供 chart 步骤复用)并核对交付镜像清单
rm -rf "$WS/.ci"; mkdir -p "$WS/.ci"
git clone -q "$CHART_REPO" "$CHART_DIR"
python3 - "$CHART_DIR/delivery/image-manifest.yaml" <<'PY'
import sys, yaml
m = yaml.safe_load(open(sys.argv[1], encoding="utf-8")) or {}
missing = [e["acr"] for e in m.get("thirdParty", [])
if not e.get("optional") and not e.get("pushed")]
if missing:
sys.exit("[promote] 错误: 交付镜像清单存在未推送 ACR 的非可选镜像: " + ", ".join(missing) +
"\n 请先按 D2 用 cr_temp_user 临时 token 补推,再执行发布")
print("[promote] 交付镜像清单核对通过(第三方镜像齐备)")
PY
cat > "$ENV_FILE" <<EOF
RELEASE_VERSION=$RELEASE_VERSION
CUSTOMER=$CUSTOMER
CHART_TAG=$CHART_TAG
EOF
log "prepare 完成"
}
# ─────────────────────────────────────────────
# retag
# ─────────────────────────────────────────────
do_retag() {
require_env
: "${ACR_REGISTRY:?缺少 ACR_REGISTRY}"
: "${HARBOR_REGISTRY:?缺少 HARBOR_REGISTRY}"
: "${ACR_USER:?缺少 acr_push_username secret}"
: "${ACR_PASS:?缺少 acr_push_password secret}"
# 推 ACR 必须用 docker(ctr 有 blob unknown 问题,见底座 runbook)
printf %s "$ACR_PASS" | docker login "$ACR_REGISTRY" -u "$ACR_USER" --password-stdin \
|| die "ACR 登录失败(检查 secrets 与实例访问授权)"
while IFS=' ' read -r repo tag; do
[ -n "$repo" ] || continue
log "晋级 $repo:$tag → mixingx/$repo:$RELEASE_VERSION"
docker pull "$HARBOR_REGISTRY/$repo:$tag" || die "拉取失败: $repo:$tag(119 上是否存在?)"
docker tag "$HARBOR_REGISTRY/$repo:$tag" "$ACR_REGISTRY/mixingx/$repo:$RELEASE_VERSION"
docker push "$ACR_REGISTRY/mixingx/$repo:$RELEASE_VERSION" || die "推送失败: $repo"
docker rmi "$HARBOR_REGISTRY/$repo:$tag" "$ACR_REGISTRY/mixingx/$repo:$RELEASE_VERSION" >/dev/null 2>&1 || true
done < "$BASELINE_FILE"
log "镜像晋级完成: $(wc -l < "$BASELINE_FILE" | tr -d ' ') 个 → $ACR_REGISTRY/mixingx/*:$RELEASE_VERSION"
}
# ─────────────────────────────────────────────
# chart
# ─────────────────────────────────────────────
do_chart() {
require_env
git_setup
[ -d "$CHART_DIR/.git" ] || { rm -rf "$CHART_DIR"; git clone -q "$CHART_REPO" "$CHART_DIR"; }
cd "$CHART_DIR"
VER="${RELEASE_VERSION#v}"
for f in $CHARTS_DIR/*/Chart.yaml; do
python3 - "$f" "$VER" <<'PY'
import sys, re
path, ver = sys.argv[1], sys.argv[2]
t = open(path, encoding="utf-8").read()
t = re.sub(r'(?m)^version:\s*\S+', f'version: {ver}', t)
t = re.sub(r'(?m)^appVersion:\s*"?[^"\n]+"?', f'appVersion: "{ver}"', t)
open(path, "w", encoding="utf-8").write(t)
PY
done
git add -A
git diff --cached --quiet && die "Chart.yaml 无变化,异常(版本号相同?)"
git commit -q -m "release: bump chart version to $RELEASE_VERSION"
git tag "$CHART_TAG"
git push -q origin HEAD:master "refs/tags/$CHART_TAG" || die "chart 仓库 push 失败(netrc 凭证?)"
log "chart 已发布: $CHART_TAG(10 个 chart version=$VER)"
}
# ─────────────────────────────────────────────
# pin
# ─────────────────────────────────────────────
do_pin() {
require_env
git_setup
cd "$WS"
git fetch -q origin release || die "release 分支不存在,请先推送初始 release 分支(改造清单 B1)"
git checkout -q -B release origin/release
ENVDIR="environments/$CUSTOMER"
APPDIR="applications/$CUSTOMER"
[ -d "$ENVDIR" ] || die "客户目录不存在: $ENVDIR"
[ -d "$APPDIR" ] || die "客户目录不存在: $APPDIR"
# 1) image-version 全部钉到交付版本(保留 repository 映射,protocol 整段删除)
python3 - "$ENVDIR/image-version.yaml" "$RELEASE_VERSION" <<'PY'
import sys, yaml
path, ver = sys.argv[1], sys.argv[2]
data = yaml.safe_load(open(path, encoding="utf-8")) or {}
data.pop("protocol", None)
def pin(node):
for k, v in node.items():
if isinstance(v, dict): pin(v)
elif k == "tag": node[k] = ver
for key in ("images",):
if key in data: pin(data[key])
if "images" in data: data["images"].pop("protocol", None)
data["tag"] = ver
yaml.safe_dump(data, open(path, "w", encoding="utf-8"),
default_flow_style=False, sort_keys=False, allow_unicode=True)
print(f"[promote] {path} 已钉版 {ver}")
PY
# 2) applications 客户目录的 chart targetRevision → 新 chart tag
# (只替换 chart-vX.Y.Z 模式;deploy 仓库自身的 targetRevision: release 不动)
sed -i.bak -E "s/chart-v[0-9]+\\.[0-9]+\\.[0-9]+/$CHART_TAG/g" "$APPDIR"/*.yaml
rm -f "$APPDIR"/*.yaml.bak
grep -rn "$CHART_TAG" "$APPDIR" >/dev/null || die "$APPDIR 中未找到可替换的 chart targetRevision"
git add "$ENVDIR" "$APPDIR"
git diff --cached --quiet && die "钉版后无变化(版本号未变?)"
BASELINE_TAGS=$(sed 's/^/ /' "$BASELINE_FILE")
git commit -q -m "release: $CUSTOMER 钉版 $RELEASE_VERSION
交付基线(develop tag 组合,源自 demo image-version):
$BASELINE_TAGS
chart: $CHART_TAG"
git push -q origin release || die "release 分支 push 失败(分支保护?netrc 凭证?)"
log "交付分支已钉版: environments/$CUSTOMER → $RELEASE_VERSION"
log ""
log "════════ 发布完成 ════════"
log "版本: $RELEASE_VERSION (chart: $CHART_TAG)"
log "现场: ArgoCD 约 3 分钟内自动 sync"
}
case "${1:-}" in
prepare) do_prepare ;;
retag) do_retag ;;
chart) do_chart ;;
pin) do_pin ;;
*) echo "用法: promote.sh prepare|retag|chart|pin" >&2; exit 1 ;;
esac
@@ -1,365 +0,0 @@
# Argo CD Offline Bootstrap Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan.
**Goal:** Make Argo CD on `192.168.1.173` restart from its local k3s image cache when Harbor is offline, and preserve that behavior through server restarts, reinstalls, and controlled upgrades.
**Architecture:** Vendor the exact upstream Argo CD `v3.4.4` install manifest in `mixingx-deploy`, then wrap it with a Kustomize overlay that rewrites its three upstream images to the existing Harbor references and explicitly changes every Argo CD container and init container to `IfNotPresent`. A checked-in verification script validates the rendered manifest, while an idempotent root-only apply script checks the k3s image cache, applies the render, waits for all Argo CD rollouts, and rejects image-pull failures.
**Tech Stack:** Argo CD v3.4.4, Kubernetes/Kustomize, k3s embedded containerd and kubectl, Bash, Git submodules.
**Global constraints:** Do not delete Argo CD Applications or managed workloads. Do not pull, retag, or delete images. Do not apply an unmodified upstream manifest. Do not stage Hub `.zcode/plans/` files. Stop before applying if any required image is absent from the local k3s image store.
---
### Task 1: Add a failing render-verification contract
**Files:**
- Create: `bootstrap/argocd-offline/verify-render.sh`
- Create: `bootstrap/argocd-offline/tests/expected-workloads.txt`
**Step 1: Define the exact supported workload/container inventory**
Add the seven workload names and their expected main/init container names to `tests/expected-workloads.txt`:
```text
Deployment/argocd-applicationset-controller argocd-applicationset-controller
Deployment/argocd-dex-server dex copyutil
Deployment/argocd-notifications-controller argocd-notifications-controller
Deployment/argocd-redis redis secret-init
Deployment/argocd-repo-server argocd-repo-server copyutil
Deployment/argocd-server argocd-server
StatefulSet/argocd-application-controller argocd-application-controller
```
**Step 2: Write the render verifier before the overlay exists**
Implement `verify-render.sh <rendered-manifest>` with `set -euo pipefail`. It must fail unless all of these are true:
- The render contains only the expected Harbor image references for Argo CD, Dex, and Redis.
- No upstream `quay.io`, `ghcr.io`, or `public.ecr.aws` image reference remains in a workload.
- No `imagePullPolicy: Always` remains.
- Each inventory entry is present and each named container/init container has an explicit `imagePullPolicy: IfNotPresent` in its workload block.
- The expected images are exactly:
```text
192.168.1.119:8888/argoproj/argocd:v3.4.4
192.168.1.119:8888/dexidp/dex:v2.45.0
192.168.1.119:8888/library/redis:8.2.3-alpine
```
Keep this verifier dependency-free: Bash plus standard `awk`, `grep`, and `sed` only.
**Step 3: Run it and confirm the contract fails**
Run:
```bash
bootstrap/argocd-offline/verify-render.sh /dev/null
```
Expected: non-zero exit with a clear missing-workload or missing-image error.
**Step 4: Commit the verification contract**
```bash
git add bootstrap/argocd-offline/verify-render.sh \
bootstrap/argocd-offline/tests/expected-workloads.txt
git commit -m "test(gitops): define argocd offline render contract"
```
### Task 2: Vendor Argo CD and build the offline Kustomize overlay
**Files:**
- Create: `bootstrap/argocd-offline/vendor/install-v3.4.4.yaml`
- Create: `bootstrap/argocd-offline/kustomization.yaml`
- Create: `bootstrap/argocd-offline/patches/application-controller.yaml`
- Create: `bootstrap/argocd-offline/patches/applicationset-controller.yaml`
- Create: `bootstrap/argocd-offline/patches/dex-server.yaml`
- Create: `bootstrap/argocd-offline/patches/notifications-controller.yaml`
- Create: `bootstrap/argocd-offline/patches/redis.yaml`
- Create: `bootstrap/argocd-offline/patches/repo-server.yaml`
- Create: `bootstrap/argocd-offline/patches/server.yaml`
**Step 1: Vendor the exact upstream release**
Download only the pinned release URL, record its SHA-256 for the README, and inspect the diff:
```bash
curl -fsSL \
https://raw.githubusercontent.com/argoproj/argo-cd/v3.4.4/manifests/install.yaml \
-o bootstrap/argocd-offline/vendor/install-v3.4.4.yaml
shasum -a 256 bootstrap/argocd-offline/vendor/install-v3.4.4.yaml
git diff --stat
```
Expected: a single vendored upstream manifest, with no generated or unrelated files.
**Step 2: Add the Kustomize image rewrites**
Create `kustomization.yaml` with the vendored manifest as its only resource and these exact replacements:
```yaml
images:
- name: quay.io/argoproj/argocd
newName: 192.168.1.119:8888/argoproj/argocd
newTag: v3.4.4
- name: ghcr.io/dexidp/dex
newName: 192.168.1.119:8888/dexidp/dex
newTag: v2.45.0
- name: public.ecr.aws/docker/library/redis
newName: 192.168.1.119:8888/library/redis
newTag: 8.2.3-alpine
```
Reference all seven strategic-merge patches from the same file.
**Step 3: Patch every main and init container explicitly**
Each patch must target one exact Deployment or StatefulSet in namespace `argocd`. Include the expected container names from Task 1 and set only:
```yaml
imagePullPolicy: IfNotPresent
```
Do not alter replicas, commands, probes, security contexts, volumes, or application resources.
**Step 4: Render and make the verification contract pass**
```bash
tmp="$(mktemp)"
kubectl kustomize bootstrap/argocd-offline > "$tmp"
bootstrap/argocd-offline/verify-render.sh "$tmp"
rm -f "$tmp"
```
Expected: verifier exits zero. Also inspect the render directly:
```bash
kubectl kustomize bootstrap/argocd-offline \
| grep -E 'image:|imagePullPolicy:' \
| sort -u
```
Expected: only the three Harbor images and `imagePullPolicy: IfNotPresent`; no `Always`.
**Step 5: Commit the vendored source and overlay**
```bash
git add bootstrap/argocd-offline
git commit -m "feat(gitops): add offline argocd bootstrap overlay"
```
### Task 3: Add the safe, idempotent server apply workflow
**Files:**
- Create: `bootstrap/argocd-offline/apply.sh`
- Create: `bootstrap/argocd-offline/README.md`
- Modify: `bootstrap/argocd-offline/verify-render.sh`
**Step 1: Add a testable cache-check mode**
Extend the verifier or add a private function in `apply.sh` that compares the three exact expected references with:
```bash
k3s ctr images list -q
```
The comparison must be exact, print every missing image, and return non-zero before any `kubectl apply`. It must not contact a registry.
**Step 2: Implement `apply.sh`**
The script must:
1. Use `set -euo pipefail` and resolve all paths relative to its own directory.
2. Require UID 0, `k3s`, and `k3s kubectl kustomize`.
3. Render into a temporary file and remove it with `trap`.
4. Run `verify-render.sh` against that file.
5. Verify all three images exist in k3s containerd.
6. Snapshot current Argo CD Application names to a temporary file.
7. Apply only the rendered file with `k3s kubectl apply -f`.
8. Wait with explicit timeouts for the six Deployments and one StatefulSet in Task 1.
9. Fail if any Argo CD pod reports `ErrImagePull` or `ImagePullBackOff`.
10. Confirm the pre-existing Application names are still present, then print pod state.
Use a bounded rollout timeout such as `300s`; do not loop indefinitely.
**Step 3: Document the only supported install/upgrade path**
README must include:
- Purpose and offline limitations: only exact cached tags can start without Harbor.
- Pinned upstream URL and SHA-256.
- Required cached image list.
- Install/recovery command: `sudo ./apply.sh`.
- Verification commands for pods, pull policies, and Applications.
- Upgrade checklist: update vendored exact release, image rewrites, patches/inventory if upstream workloads change, checksum, render verification, cache images first, then apply.
- Warning not to run `kubectl apply` directly against upstream `install.yaml`.
**Step 4: Test failure paths without changing the cluster**
Run locally:
```bash
bootstrap/argocd-offline/apply.sh
```
Expected: non-root or missing-k3s failure before apply.
Run the render verification again and shell syntax checks:
```bash
bash -n bootstrap/argocd-offline/apply.sh
bash -n bootstrap/argocd-offline/verify-render.sh
tmp="$(mktemp)"
kubectl kustomize bootstrap/argocd-offline > "$tmp"
bootstrap/argocd-offline/verify-render.sh "$tmp"
rm -f "$tmp"
```
Expected: all syntax/render checks pass.
**Step 5: Commit the operator workflow**
```bash
git add bootstrap/argocd-offline/apply.sh \
bootstrap/argocd-offline/verify-render.sh \
bootstrap/argocd-offline/README.md
git commit -m "feat(gitops): add safe argocd offline apply workflow"
```
### Task 4: Publish the deploy source of truth and Hub pointer
**Files:**
- Modify: Hub submodule pointer `mixingx-deploy`
**Step 1: Rebase and re-run verification before publishing deploy**
```bash
git fetch origin
git rebase origin/master
bash -n bootstrap/argocd-offline/apply.sh
bash -n bootstrap/argocd-offline/verify-render.sh
tmp="$(mktemp)"
kubectl kustomize bootstrap/argocd-offline > "$tmp"
bootstrap/argocd-offline/verify-render.sh "$tmp"
rm -f "$tmp"
git status --short
```
Expected: clean deploy worktree and all verification passes.
**Step 2: Push deploy master**
```bash
git push origin master
```
Expected: remote `master` advances to the verified offline-bootstrap commits.
**Step 3: Update only the Hub submodule pointer**
From the Hub root:
```bash
git fetch origin
git rebase origin/develop/v.1.0.1
git add mixingx-deploy
git diff --cached --submodule=log
```
Expected: the staged diff contains only the `mixingx-deploy` gitlink. The existing untracked `.zcode/plans/` files remain unstaged.
**Step 4: Commit and push the Hub pointer**
```bash
git commit -m "chore(gitops): update deploy offline argocd bootstrap"
git push origin develop/v.1.0.1
```
### Task 5: Recover and verify Argo CD on `192.168.1.173`
**Files:**
- No repository changes expected.
**Step 1: Capture the pre-change cluster inventory**
Over SSH, save or print:
```bash
sudo k3s kubectl -n argocd get applications.argoproj.io -o name
sudo k3s kubectl -n argocd get deploy,statefulset,pods -o wide
sudo k3s ctr images list -q
```
Expected: the existing Applications are visible and all three exact Harbor images exist. If any image is missing, stop without applying.
**Step 2: Transfer the committed bootstrap directory**
From the Hub machine:
```bash
scp -r mixingx-deploy/bootstrap/argocd-offline \
mx@192.168.1.173:/tmp/argocd-offline
```
Use the committed directory that was just pushed; do not assemble a manifest manually on the server.
**Step 3: Apply through the checked entry point**
```bash
ssh mx@192.168.1.173 \
'sudo /tmp/argocd-offline/apply.sh'
```
Expected: render and cache checks pass; all six Deployments and the application-controller StatefulSet complete rollout using cached images.
**Step 4: Verify the permanent live state**
Run:
```bash
sudo k3s kubectl -n argocd get pods
sudo k3s kubectl -n argocd get deploy,statefulset \
-o jsonpath='{range .items[*]}{.kind}{"/"}{.metadata.name}{"\n"}{range .spec.template.spec.initContainers[*]} init:{.name}={.imagePullPolicy}{"\n"}{end}{range .spec.template.spec.containers[*]} container:{.name}={.imagePullPolicy}{"\n"}{end}{end}'
sudo k3s kubectl -n argocd get applications.argoproj.io -o name
```
Expected:
- Every Argo CD pod is Ready.
- Every listed container and init container reports `IfNotPresent`.
- No pod is in `ErrImagePull` or `ImagePullBackOff`.
- The Application inventory matches the pre-change snapshot.
**Step 5: Prove reconciliation and reboot persistence without widening scope**
Confirm Argo CD Applications can refresh from their existing Git sources. Then hand control back to the operator for the planned server reboot. After reboot, repeat Step 4; do not modify application workloads as part of this bootstrap verification.
### Task 6: Final repository and remote verification
**Files:**
- No changes expected.
**Step 1: Verify branch alignment and clean deploy state**
```bash
git -C mixingx-deploy status --short
git -C mixingx-deploy rev-parse HEAD
git -C mixingx-deploy rev-parse origin/master
git status --short
git rev-parse HEAD
git rev-parse origin/develop/v.1.0.1
git submodule status mixingx-deploy
```
Expected:
- Deploy `HEAD` equals `origin/master`.
- Hub `HEAD` equals `origin/develop/v.1.0.1`.
- Hub points at the same deploy commit.
- Only the user's pre-existing untracked `.zcode/plans/` files remain; no implementation files are unstaged.
**Step 2: Record the handoff facts**
Report the deploy commit, Hub commit, live Argo CD pod readiness, pull-policy verification, retained Application count, and that the next user action is the planned reboot test.
@@ -1,96 +0,0 @@
# Disable Audit Default Deployment Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Exclude Audit from the default demo Argo CD app-of-apps deployment while preserving its manifest for manual re-enablement.
**Architecture:** Follow the repository's existing disabled-manifest convention by moving the Audit Argo CD Application from the active `applications/demo` directory into `applications/demo/disabled`. Keep environment values and image metadata unchanged so the service can be restored by moving the manifest back.
**Tech Stack:** Argo CD Application manifests, Kubernetes YAML, Git
## Global Constraints
- Do not modify the Audit Helm chart.
- Keep `environments/demo/audit-values.yaml` unchanged.
- Keep the Audit entry in `environments/demo/image-version.yaml` unchanged.
- Do not delete or alter an existing `mixingx-audit` Application or workload in the current cluster.
---
### Task 1: Move Audit Application to the disabled manifest directory
**Files:**
- Move: `applications/demo/audit.yaml` → `applications/demo/disabled/audit.yaml`
- Verify unchanged: `environments/demo/audit-values.yaml`
- Verify unchanged: `environments/demo/image-version.yaml`
**Interfaces:**
- Consumes: `bootstrap/mixingx-demo-root.yaml`, whose source path is `applications/demo`
- Produces: A preserved Audit Argo CD Application manifest outside the root application's active top-level manifest set
- [ ] **Step 1: Capture checksums of configuration files that must remain unchanged**
Run:
```bash
shasum -a 256 environments/demo/audit-values.yaml environments/demo/image-version.yaml
```
Expected: two checksum lines. Save the output for comparison in Step 5.
- [ ] **Step 2: Move the Audit Application manifest**
Apply a file move with no content changes:
```bash
mkdir -p applications/demo/disabled
mv applications/demo/audit.yaml applications/demo/disabled/audit.yaml
```
Expected: `applications/demo/audit.yaml` no longer exists and `applications/demo/disabled/audit.yaml` contains the original manifest.
- [ ] **Step 3: Validate the moved YAML document**
Run:
```bash
ruby -e "require 'yaml'; doc = YAML.load_file('applications/demo/disabled/audit.yaml'); abort 'wrong kind' unless doc['kind'] == 'Application'; abort 'wrong name' unless doc.dig('metadata', 'name') == 'mixingx-audit'"
```
Expected: exit code 0 with no output.
- [ ] **Step 4: Verify Audit is excluded from active top-level manifests**
Run:
```bash
test ! -e applications/demo/audit.yaml
test -e applications/demo/disabled/audit.yaml
find applications/demo -maxdepth 1 -type f -name '*.yaml' -exec grep -l 'name: mixingx-audit' {} +
```
Expected: both `test` commands exit 0 and `find` prints no path.
- [ ] **Step 5: Verify retained configuration and inspect the complete diff**
Run:
```bash
shasum -a 256 environments/demo/audit-values.yaml environments/demo/image-version.yaml
git diff --check
git diff --summary
git status --short
```
Expected: checksums match Step 1, `git diff --check` exits 0, the summary reports only the Audit manifest rename, and status contains no unrelated changes.
- [ ] **Step 6: Commit the deployment change**
Run:
```bash
git add applications/demo/audit.yaml applications/demo/disabled/audit.yaml
git commit -m "chore(gitops): disable audit default deployment"
```
Expected: one commit recording the Audit manifest rename with no changes to values or image metadata.
@@ -1,322 +0,0 @@
# Disable Demo MongoDB Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Exclude MongoDB from future default demo infrastructure renders, publish the GitOps state through both repositories, and remove the current test MongoDB workload and storage from `192.168.1.173`.
**Architecture:** Remove the MongoDB item from the demo environment's data-driven `sharedDatastores` list without changing the reusable Infra chart. Publish the deploy commit, advance the Hub submodule pointer, then perform a narrowly scoped cleanup of the current MongoDB StatefulSet, Service, PVC, and automatically reclaimed storage.
**Tech Stack:** Helm 4, Argo CD Application manifests, Kubernetes/k3s, Longhorn, Git submodules, Gitee
## Global Constraints
- Target only the demo environment and namespace `mixingx` on `192.168.1.173`.
- Keep `sharedInfra.mongo` connection settings unchanged.
- Keep Redis and RabbitMQ datastore entries and runtime resources unchanged.
- Do not modify the reusable `mixingx-infra` Helm chart.
- Keep Audit disabled at `applications/demo/disabled/audit.yaml`.
- MongoDB PVC contents are test data and do not need to be retained.
- Do not delete the Infra Argo CD Application or any unrelated PV/Longhorn volume.
- Never force-push either repository.
---
### Task 1: Exclude MongoDB from demo Infra rendering
**Files:**
- Modify: `environments/demo/infra-values.yaml`
- Verify unchanged: `applications/demo/disabled/audit.yaml`
- Verify unchanged: `../mixingx-chart/release-charts/mixingx-infra/templates/shared-infra.yaml`
**Interfaces:**
- Consumes: `sharedDatastores`, rendered by the Infra chart into one StatefulSet and Service per item
- Produces: Demo Infra Helm output containing Redis and RabbitMQ but no MongoDB
- [ ] **Step 1: Render the baseline and prove MongoDB is currently included**
Run from `mixingx-deploy`:
```bash
helm lint ../mixingx-chart/release-charts/mixingx-infra \
-f environments/demo/image-version.yaml \
-f environments/demo/infra-values.yaml
helm template mixingx-infra ../mixingx-chart/release-charts/mixingx-infra \
-f environments/demo/image-version.yaml \
-f environments/demo/infra-values.yaml > /tmp/mixingx-infra-before.yaml
ruby -e "require 'yaml'; names = YAML.load_stream(File.read('/tmp/mixingx-infra-before.yaml')).compact.map { |d| [d['kind'], d.dig('metadata', 'name')] }; abort 'mongo missing from baseline' unless names.include?(['StatefulSet', 'mongo-statefulset']) && names.include?(['Service', 'mongo-service']); puts 'baseline contains mongo'"
```
Expected: Helm lint succeeds and the final command prints `baseline contains mongo`.
- [ ] **Step 2: Remove only the MongoDB datastore item**
Edit `environments/demo/infra-values.yaml` so `sharedDatastores` changes from:
```yaml
- name: redis
image: 192.168.1.119:8888/docker-proxy/library/redis:8.6
port: 6379
storage: 2Gi
mountPath: /data
- name: mongo
image: 192.168.1.119:8888/docker-proxy/library/mongo:7.0
port: 27017
storage: 5Gi
mountPath: /data/db
- name: messaging
```
to:
```yaml
- name: redis
image: 192.168.1.119:8888/docker-proxy/library/redis:8.6
port: 6379
storage: 2Gi
mountPath: /data
- name: messaging
```
Do not change the `sharedInfra.mongo` mapping above the list.
- [ ] **Step 3: Render the result and prove only MongoDB is excluded**
Run:
```bash
helm lint ../mixingx-chart/release-charts/mixingx-infra \
-f environments/demo/image-version.yaml \
-f environments/demo/infra-values.yaml
helm template mixingx-infra ../mixingx-chart/release-charts/mixingx-infra \
-f environments/demo/image-version.yaml \
-f environments/demo/infra-values.yaml > /tmp/mixingx-infra-after.yaml
ruby -e "require 'yaml'; names = YAML.load_stream(File.read('/tmp/mixingx-infra-after.yaml')).compact.map { |d| [d['kind'], d.dig('metadata', 'name')] }; abort 'mongo still rendered' if names.any? { |x| ['mongo-statefulset', 'mongo-service'].include?(x[1]) }; %w[redis messaging].each { |n| abort \"#{n} missing\" unless names.include?(['StatefulSet', \"#{n}-statefulset\"]) && names.include?(['Service', \"#{n}-service\"]) }; puts 'mongo excluded; redis and messaging retained'"
test -f applications/demo/disabled/audit.yaml
git diff --check
git diff -- environments/demo/infra-values.yaml
```
Expected: Helm lint succeeds, the Ruby command reports MongoDB excluded with Redis and messaging retained, and the Git diff removes only the five-line MongoDB datastore item.
- [ ] **Step 4: Commit the deploy values change**
Run:
```bash
git add environments/demo/infra-values.yaml
git commit -m "chore(gitops): disable demo mongodb"
```
Expected: one commit modifying only `environments/demo/infra-values.yaml`.
---
### Task 2: Publish the deploy repository
**Files:**
- Publish: `mixingx.deploy` branch `master`
**Interfaces:**
- Consumes: Task 1 commit plus the approved design and implementation plan commits
- Produces: `origin/master` with MongoDB excluded from demo Infra values
- [ ] **Step 1: Integrate any newer remote commits without force-pushing**
Run:
```bash
git fetch origin master
git status --short --branch
git log --oneline --left-right HEAD...origin/master --max-count=20
git rebase origin/master
```
Expected: rebase succeeds. If it conflicts, stop and inspect the remote changes before resolving anything.
- [ ] **Step 2: Re-run the post-rebase Helm verification**
Run:
```bash
helm lint ../mixingx-chart/release-charts/mixingx-infra \
-f environments/demo/image-version.yaml \
-f environments/demo/infra-values.yaml
helm template mixingx-infra ../mixingx-chart/release-charts/mixingx-infra \
-f environments/demo/image-version.yaml \
-f environments/demo/infra-values.yaml > /tmp/mixingx-infra-after-rebase.yaml
ruby -e "require 'yaml'; names = YAML.load_stream(File.read('/tmp/mixingx-infra-after-rebase.yaml')).compact.map { |d| [d['kind'], d.dig('metadata', 'name')] }; abort 'mongo still rendered' if names.any? { |x| ['mongo-statefulset', 'mongo-service'].include?(x[1]) }; %w[redis messaging].each { |n| abort \"#{n} missing\" unless names.include?(['StatefulSet', \"#{n}-statefulset\"]) && names.include?(['Service', \"#{n}-service\"]) }"
git diff --check origin/master..HEAD
git status --short --branch
```
Expected: validation exits 0 and the branch is only ahead of `origin/master`.
- [ ] **Step 3: Push and verify the remote deploy branch**
Run:
```bash
git push origin master
git fetch origin master
git status --short --branch
git ls-tree -r --name-only origin/master | grep -q '^applications/demo/disabled/audit.yaml$'
```
Expected: push succeeds, local `master` matches `origin/master`, and Audit remains disabled.
---
### Task 3: Advance and publish the Hub submodule pointer
**Files:**
- Modify in parent repository: `mixingx-deploy` gitlink
- Preserve: existing untracked `.zcode/plans/` files
**Interfaces:**
- Consumes: The pushed `mixingx.deploy` commit from Task 2
- Produces: Hub `develop/v.1.0.1` pointing at that exact deploy commit
- [ ] **Step 1: Verify the submodule and fetch the Hub remote**
Run from the parent `mixingx.hub` directory:
```bash
git -C mixingx-deploy fetch origin master
git -C mixingx-deploy merge --ff-only origin/master
DEPLOY_COMMIT=$(git -C mixingx-deploy rev-parse HEAD)
git fetch origin develop/v.1.0.1
git status --short --branch
printf 'DEPLOY_COMMIT=%s\n' "$DEPLOY_COMMIT"
```
Expected: the deploy submodule equals its `origin/master`. Existing `.zcode/plans/` entries may remain untracked and must not be staged.
- [ ] **Step 2: Commit only the submodule pointer**
Run:
```bash
git add mixingx-deploy
git diff --cached --check
git diff --cached --submodule=log -- mixingx-deploy
git commit -m "chore(gitops): update deploy submodule"
```
Expected: one commit changing only the `mixingx-deploy` gitlink.
- [ ] **Step 3: Rebase safely if Hub advanced remotely**
Run:
```bash
git rebase origin/develop/v.1.0.1
```
Expected: rebase succeeds. If the deploy gitlink conflicts, verify the remote deploy pointer is an ancestor of `$DEPLOY_COMMIT` before staging `mixingx-deploy`; otherwise stop and report the conflict.
- [ ] **Step 4: Push and verify Hub**
Run:
```bash
git push origin develop/v.1.0.1
git fetch origin develop/v.1.0.1
git status --short --branch
git ls-tree origin/develop/v.1.0.1 mixingx-deploy
```
Expected: local and remote branches match, and the remote gitlink equals `$DEPLOY_COMMIT`.
---
### Task 4: Remove MongoDB and its test-data storage from the current cluster
**Files:**
- Delete Kubernetes resources only in namespace `mixingx` on `192.168.1.173`
**Interfaces:**
- Consumes: Published GitOps state from Tasks 2 and 3
- Produces: No MongoDB workload, Service, PVC, PV, or Longhorn volume; Redis and RabbitMQ remain ready
- [ ] **Step 1: Connect and inventory the exact resources before deletion**
Connect:
```bash
ssh mx@192.168.1.173
sudo -v
```
Then run:
```bash
sudo k3s kubectl get application -n argocd mixingx-infra -o yaml
sudo k3s kubectl get statefulset,service,pod,pvc -n mixingx | grep -E '(^NAME|mongo|redis|messaging)'
PVC=data-mongo-statefulset-0
PV=$(sudo k3s kubectl get pvc -n mixingx "$PVC" -o jsonpath='{.spec.volumeName}')
SC=$(sudo k3s kubectl get pvc -n mixingx "$PVC" -o jsonpath='{.spec.storageClassName}')
RECLAIM=$(sudo k3s kubectl get pv "$PV" -o jsonpath='{.spec.persistentVolumeReclaimPolicy}')
printf 'PVC=%s\nPV=%s\nSC=%s\nRECLAIM=%s\n' "$PVC" "$PV" "$SC" "$RECLAIM"
```
Expected: exact resources are `mongo-statefulset`, `mongo-service`, `mongo-statefulset-0`, and `data-mongo-statefulset-0`. Record a non-empty PV name. If names differ or the PV is shared, stop before deletion.
- [ ] **Step 2: Delete only the MongoDB workload and Service**
Run:
```bash
sudo k3s kubectl delete statefulset -n mixingx mongo-statefulset --wait=true --timeout=120s
sudo k3s kubectl delete service -n mixingx mongo-service --wait=true --timeout=120s
```
Expected: both resources report `deleted`. Do not delete the Infra Application.
- [ ] **Step 3: Delete the MongoDB test-data PVC**
Run:
```bash
sudo k3s kubectl delete pvc -n mixingx data-mongo-statefulset-0 --wait=true --timeout=180s
```
Expected: the PVC reports `deleted`. If deletion is stuck, inspect finalizers and stop without removing them.
- [ ] **Step 4: Verify automatic PV and Longhorn reclamation**
Run:
```bash
if sudo k3s kubectl get pv "$PV" >/dev/null 2>&1; then
sudo k3s kubectl wait --for=delete "pv/$PV" --timeout=180s
fi
if sudo k3s kubectl get volumes.longhorn.io -n longhorn-system "$PV" >/dev/null 2>&1; then
sudo k3s kubectl wait --for=delete -n longhorn-system "volumes.longhorn.io/$PV" --timeout=180s
fi
```
Expected: both the PV and Longhorn volume are absent. If either remains after the timeout, stop and report it; do not manually delete unrelated storage objects.
- [ ] **Step 5: Verify MongoDB stays absent and other Infra services remain healthy**
Run:
```bash
test -z "$(sudo k3s kubectl get statefulset,service,pod,pvc -n mixingx -o name | grep mongo || true)"
sudo k3s kubectl wait --for=condition=Ready pod/redis-statefulset-0 -n mixingx --timeout=120s
sudo k3s kubectl wait --for=condition=Ready pod/messaging-statefulset-0 -n mixingx --timeout=120s
sleep 30
test -z "$(sudo k3s kubectl get statefulset,service,pod,pvc -n mixingx -o name | grep mongo || true)"
sudo k3s kubectl get pod -n mixingx redis-statefulset-0 messaging-statefulset-0
```
Expected: both absence checks pass; Redis and RabbitMQ are Ready before and after the observation window.
@@ -1,78 +0,0 @@
# Argo CD Offline Bootstrap
## Goal
Make Argo CD on the demo k3s server `192.168.1.173` able to start and reconcile from locally cached images while Harbor `192.168.1.119:8888` is offline, and provide a version-controlled installation path that preserves this behavior across server restarts, Argo CD reinstalls, and upgrades.
## Current State and Root Cause
Argo CD was installed with `kubectl apply`, then its images were redirected to Harbor. Most Argo CD containers still use `imagePullPolicy: Always`. When their pod sandboxes are recreated, kubelet contacts Harbor even though the exact images are cached locally. With Harbor offline, image resolution fails with `no route to host`, leaving the Argo CD control plane in `ErrImagePull` or `ImagePullBackOff`.
The following exact images are already cached on `192.168.1.173`:
- `192.168.1.119:8888/argoproj/argocd:v3.4.4`
- `192.168.1.119:8888/dexidp/dex:v2.45.0`
- `192.168.1.119:8888/library/redis:8.2.3-alpine`
## Repository Design
Create `bootstrap/argocd-offline/` in `mixingx.deploy` with:
- A vendored copy of the official Argo CD `v3.4.4` install manifest, pinned to that release rather than `stable`.
- A `kustomization.yaml` that rewrites the Argo CD, Dex, and Redis images to the Harbor references above.
- Kustomize patches that set every Argo CD workload container and init container to `imagePullPolicy: IfNotPresent`.
- An idempotent `apply.sh` entry point for the demo k3s server.
- A README describing installation, verification, offline recovery, and upgrade rules.
Vendoring the upstream manifest makes the bootstrap independent of GitHub availability. The supported install and upgrade path becomes:
```bash
sudo ./apply.sh
```
Operators must not apply an unmodified upstream Argo CD manifest directly, because doing so can restore `Always` policies.
## Apply Script Behavior
The script will:
1. Require root privileges and verify `k3s` and its embedded `kubectl` are available.
2. Render the local Kustomize overlay before making changes.
3. Reject the render if any workload container or init container still uses `imagePullPolicy: Always`.
4. Verify all three required image references exist in the local k3s containerd image store.
5. Apply the rendered resources to namespace `argocd`.
6. Wait for the Argo CD Deployments and application-controller StatefulSet to complete rollout.
7. Print pod state and fail if any Argo CD pod remains in an image-pull error.
The script must not pull, retag, delete, or garbage-collect images. Missing cached images are a hard stop so the operator can restore Harbor or import the required image deliberately.
## Live Recovery
After repository validation, run the versioned bootstrap against `192.168.1.173`. Applying the overlay changes the pod templates from `Always` to `IfNotPresent`, causing Argo CD pods to restart using the exact locally cached images. No Harbor access is required for this recovery.
Verify all Argo CD components become Ready and the existing MixingX Applications remain present. The bootstrap must not delete Applications or application workloads.
## GitOps Publication
1. Commit and push the `mixingx.deploy` `master` branch.
2. Update the `mixingx.hub` `mixingx-deploy` submodule pointer on `develop/v.1.0.1`.
3. Commit and push the Hub branch without staging existing `.zcode/plans/` files.
## Upgrade Procedure
For an Argo CD upgrade:
1. Replace the vendored manifest with the official manifest for an exact release tag.
2. Update the three expected image versions and Harbor rewrites.
3. Render locally and verify there are no `Always` policies or unexpected external image references.
4. Ensure the new images are present in Harbor and cached or explicitly imported on `192.168.1.173` before application.
5. Apply only through the versioned bootstrap directory and verify rollouts.
## Verification
- The Kustomize render contains the expected Argo CD `v3.4.4`, Dex `v2.45.0`, and Redis `8.2.3-alpine` Harbor references.
- Every Deployment and StatefulSet container/initContainer has `imagePullPolicy: IfNotPresent`.
- No application container image is rewritten or modified.
- All Argo CD pods on `192.168.1.173` become Ready while Harbor remains unavailable.
- Existing Argo CD Applications remain intact.
- Repository branches and the Hub submodule pointer are synchronized with their remotes.
@@ -1,25 +0,0 @@
# Disable Audit Default Deployment
## Goal
Exclude the Audit service from the default MixingX demo deployment while keeping its Argo CD Application manifest and environment values available for a future manual re-enable.
## Design
- Move `applications/demo/audit.yaml` to `applications/demo/disabled/audit.yaml`.
- Keep `environments/demo/audit-values.yaml` unchanged.
- Keep the Audit image entry in `environments/demo/image-version.yaml` unchanged.
- Do not modify the Audit Helm chart or any other demo application.
The demo root Application scans the active manifests directly under `applications/demo`. The repository already uses `applications/demo/disabled` for manifests that must not participate in the default deployment, so Audit will follow that convention.
## Existing Cluster Behavior
The root Application has `prune: false`. Moving the manifest prevents Audit from being created by a new/default deployment, but it does not delete an existing `mixingx-audit` Argo CD Application or its Kubernetes resources. Removing an already deployed instance is a separate operational action and is outside this change.
## Verification
- Confirm there is no Audit Application manifest directly under `applications/demo`.
- Confirm the manifest exists under `applications/demo/disabled` and remains valid YAML.
- Confirm the environment values and image-version entries remain present.
- Review the Git diff to ensure no unrelated deployment files changed.
@@ -1,50 +0,0 @@
# Disable Demo MongoDB
## Goal
Temporarily exclude MongoDB from the default demo infrastructure deployment and remove the existing MongoDB workload and test data from the current demo cluster.
## Repository Design
- Remove only the `mongo` item from `sharedDatastores` in `environments/demo/infra-values.yaml`.
- Keep `sharedInfra.mongo` connection settings unchanged so MongoDB can be restored by adding the datastore item back.
- Do not modify the reusable `mixingx-infra` Helm chart.
- Do not modify Redis or RabbitMQ datastore entries.
- Keep the Audit Application disabled under `applications/demo/disabled/audit.yaml`.
The Infra chart renders one StatefulSet and Service for every `sharedDatastores` item. Removing the demo MongoDB item therefore excludes `mongo-statefulset` and `mongo-service` from newly rendered demo manifests without introducing a new chart-level feature.
## GitOps Flow
1. Validate the updated demo values with Helm lint and template rendering.
2. Commit and push the `mixingx.deploy` `master` branch.
3. Update the `mixingx.hub` `mixingx-deploy` submodule pointer on `develop/v.1.0.1` and push it.
The `mixingx-infra` Argo CD Application does not enable automated synchronization or pruning. Repository changes prevent MongoDB from being included in future default renders, but current cluster resources require an explicit cleanup operation.
## Current Cluster Cleanup
Target the demo cluster on `192.168.1.173`, namespace `mixingx`.
Before deletion, inspect and record the exact MongoDB StatefulSet, Service, PVC, PV, StorageClass, and reclaim policy. Then delete only:
- StatefulSet `mongo-statefulset`
- Service `mongo-service`
- PVC `data-mongo-statefulset-0`
The PVC contains test data and does not need to be retained. If its PV reclaim policy is `Delete`, verify that the associated PV and Longhorn volume are removed. If automatic reclamation does not complete, stop and report the remaining storage object before any additional deletion.
Do not delete the Infra Argo CD Application, Redis, RabbitMQ, their PVCs, or any unrelated Longhorn volume.
## Verification
- Helm output contains no `mongo-statefulset` or `mongo-service`.
- Helm output still contains the Redis and RabbitMQ StatefulSets and Services.
- The pushed deploy repository contains the values change and the Hub repository points to that deploy commit.
- The current cluster contains no MongoDB StatefulSet, Service, Pod, or PVC in namespace `mixingx`.
- Redis and RabbitMQ remain ready after cleanup.
- Audit remains excluded from the default demo Application manifests.
## Restore Procedure
To restore MongoDB later, re-add the original `mongo` item to `sharedDatastores`, commit and push the deploy repository, update the Hub submodule pointer, and synchronize the Infra Argo CD Application. A new empty PVC will be created because the previous test-data PVC is intentionally deleted.
-18
View File
@@ -1,18 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: longhorn-ui
namespace: longhorn-system
spec:
ingressClassName: traefik
rules:
- host: longhorn.mixingx.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: longhorn-frontend
port:
number: 80
-41
View File
@@ -1,41 +0,0 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-platform
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
numberOfReplicas: "2"
staleReplicaTimeout: "30"
fromBackup: ""
fsType: ext4
dataLocality: best-effort
unmapMarkSnapChainRemoved: ignored
disableRevisionCounter: "true"
dataEngine: v1
backupTargetName: default
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-edge-local
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
numberOfReplicas: "2"
staleReplicaTimeout: "30"
fromBackup: ""
fsType: ext4
dataLocality: best-effort
unmapMarkSnapChainRemoved: ignored
disableRevisionCounter: "true"
dataEngine: v1
backupTargetName: default