apply-trust.sh는 observe → trust 전환 전용이라, 이미 trust인 상태에서 다른 값(PR #3 resources)만 바뀌면 「observation phase must not trust forwarded headers」로 적용 전에 멈춘다. 그래서 그 값은 guarded 경로 밖의 kubectl apply로 들어갔다. → reapply-trust.sh 추가.
live-drift-check.sh가 운영 checkout(/home/donghyeon/workspace/platform)에서 지난 렌더가 남긴 무시된 .helm/charts/… 캐시 때문에 관측 렌더가 「exact chart cache already exists」로 거부돼 exit 2로 끝난다. runbook이 쓰는 경로다. → git 작업 트리 안에서는 추적·미추적(무시 제외, 삭제 제외) 파일만 임시 사본으로 옮겨 렌더한다.
platform-live-drift-check 타이머는 live-drift-check-main.sh가 git archive origin/main을 임시 폴더에 풀어 돌리므로 처음부터 캐시 영향을 받지 않는다(아래 「export 경로」 시험).
고른 방법과 버린 대안
apply-trust.sh에 「이미 trust면 건너뛰기」를 넣지 않고 별도 스크립트로 했다. observe → trust 전환의 방어 조건(관측한 ClientHost가 프록시 주소와 같아야 함)을 그대로 두기 위해서다. trust 단계에서는 Traefik이 전달된 원래 주소(127.0.0.1)를 로그에 남기므로, 재적용 스크립트는 이 검사를 뒤집어 「프록시 주소가 아니어야 함(= 신뢰 작동 중)」으로 적용 전후에 본다.
drift 검사에서 캐시를 지우는 안은 버렸다. 운영 checkout의 파일을 지우는 것이고, 렌더러가 왜 캐시를 남겼는지와 상관없이 다시 생길 수 있다. 사본 렌더는 로컬 수정은 그대로 보고 무시된 파일만 뺀다.
위험과 영향
reapply-trust.sh의 적용 경로는 운영에 돌리지 않았다(라이브 값이 이미 같아 「Nothing to do」로 끝났다). 실패하면 저장해 둔 직전 HelmChartConfig를 다시 적용해 trusted CIDR이 빠지지 않는다.
drift 검사는 여전히 읽기만 한다. 이번 수정으로 차이 하나가 드러나 받아들인 차이에 넣었다: PR #6이 values에서 끈 Kubelet 인증서 경보 둘이 라이브 PrometheusRule에 남아 있다(관측 core를 다시 적용하면 사라짐, 재시작 창 2단계, 기한 2026-11-30).
검증
desktop. 로그: 공유 노트 k3s-w6-followups-verify.log.
# reapply-trust.sh, 라이브(이미 trust, 값 같음)
Forwarded-header trust in effect (ClientHost 127.0.0.1, proxy 10.42.0.1)
Live HelmChartConfig already matches the trust overlay. Nothing to do. (exit 0)
# 임시 사본에서 trust patch memory 64Mi→65Mi, 확인 문구에 no
- memory: 64Mi / + memory: 65Mi / ERROR: cancelled (exit 1, 라이브는 64Mi 그대로)
# drift, main 8b019d2의 새 clone + 무시된 services/observability/tempo/.helm/charts/tempo-2.2.3
고치기 전: REJECT: exact chart cache already exists (exit 2)
고친 뒤(같은 clone, 커밋 안 한 수정 상태): SUMMARY drift=1 accepted=12 (exit 1, 위 PrometheusRule)
export 경로(타이머와 같음): 같은 결과
최종 head export: SUMMARY drift=0 accepted=13 / LIVE DRIFT CHECK PASS (exit 0)
## 무엇을, 왜
PR #3·#4를 적용할 때 드러난 두 실패를 고친다(총괄 보고, 2026-11-12).
1. `apply-trust.sh`는 observe → trust 전환 전용이라, 이미 trust인 상태에서 다른 값(PR #3 resources)만 바뀌면 「observation phase must not trust forwarded headers」로 적용 전에 멈춘다. 그래서 그 값은 guarded 경로 밖의 `kubectl apply`로 들어갔다. → `reapply-trust.sh` 추가.
2. `live-drift-check.sh`가 운영 checkout(`/home/donghyeon/workspace/platform`)에서 지난 렌더가 남긴 무시된 `.helm/charts/…` 캐시 때문에 관측 렌더가 「exact chart cache already exists」로 거부돼 exit 2로 끝난다. runbook이 쓰는 경로다. → git 작업 트리 안에서는 추적·미추적(무시 제외, 삭제 제외) 파일만 임시 사본으로 옮겨 렌더한다.
`platform-live-drift-check` 타이머는 `live-drift-check-main.sh`가 `git archive origin/main`을 임시 폴더에 풀어 돌리므로 처음부터 캐시 영향을 받지 않는다(아래 「export 경로」 시험).
## 고른 방법과 버린 대안
- `apply-trust.sh`에 「이미 trust면 건너뛰기」를 넣지 않고 별도 스크립트로 했다. observe → trust 전환의 방어 조건(관측한 ClientHost가 프록시 주소와 같아야 함)을 그대로 두기 위해서다. trust 단계에서는 Traefik이 전달된 원래 주소(127.0.0.1)를 로그에 남기므로, 재적용 스크립트는 이 검사를 뒤집어 「프록시 주소가 아니어야 함(= 신뢰 작동 중)」으로 적용 전후에 본다.
- drift 검사에서 캐시를 지우는 안은 버렸다. 운영 checkout의 파일을 지우는 것이고, 렌더러가 왜 캐시를 남겼는지와 상관없이 다시 생길 수 있다. 사본 렌더는 로컬 수정은 그대로 보고 무시된 파일만 뺀다.
## 위험과 영향
- `reapply-trust.sh`의 적용 경로는 운영에 돌리지 않았다(라이브 값이 이미 같아 「Nothing to do」로 끝났다). 실패하면 저장해 둔 직전 HelmChartConfig를 다시 적용해 trusted CIDR이 빠지지 않는다.
- drift 검사는 여전히 읽기만 한다. 이번 수정으로 차이 하나가 드러나 받아들인 차이에 넣었다: PR #6이 values에서 끈 Kubelet 인증서 경보 둘이 라이브 PrometheusRule에 남아 있다(관측 core를 다시 적용하면 사라짐, 재시작 창 2단계, 기한 2026-11-30).
## 검증
desktop. 로그: 공유 노트 `k3s-w6-followups-verify.log`.
```text
# reapply-trust.sh, 라이브(이미 trust, 값 같음)
Forwarded-header trust in effect (ClientHost 127.0.0.1, proxy 10.42.0.1)
Live HelmChartConfig already matches the trust overlay. Nothing to do. (exit 0)
# 임시 사본에서 trust patch memory 64Mi→65Mi, 확인 문구에 no
- memory: 64Mi / + memory: 65Mi / ERROR: cancelled (exit 1, 라이브는 64Mi 그대로)
# drift, main 8b019d2의 새 clone + 무시된 services/observability/tempo/.helm/charts/tempo-2.2.3
고치기 전: REJECT: exact chart cache already exists (exit 2)
고친 뒤(같은 clone, 커밋 안 한 수정 상태): SUMMARY drift=1 accepted=12 (exit 1, 위 PrometheusRule)
export 경로(타이머와 같음): 같은 결과
최종 head export: SUMMARY drift=0 accepted=13 / LIVE DRIFT CHECK PASS (exit 0)
```
## 리뷰어가 볼 곳
- `infrastructure/networking/traefik/scripts/reapply-trust.sh`: `assert_trust_effective`와 restore 경로.
- `scripts/validate/live-drift-check.sh`: 사본에 넣을 파일 목록(`--cached --others --exclude-standard` − `--deleted`), `tar -C`가 `-T`보다 앞.
## 관련
- PR #3(Traefik resources), #4(drift 검사), #6(Kubelet 인증서 경보 끄기)
apply-trust.sh is the observe -> trust transition. When the live
Traefik is already in the trust phase and only another value changed
(PR #3 resources), it stops at "observation phase must not trust
forwarded headers" before applying, so the change had to be applied
with a bare kubectl apply outside the guarded path.
reapply-trust.sh checks that the runtime is in the trust phase with
the reviewed CIDR and that forwarded-header trust works (a request
through Host Nginx is logged with the forwarded client, not the proxy
address), saves the live HelmChartConfig, shows the change with
kubectl diff and does nothing when there is none, asks for
"APPLY <context> RETRUST <cidr>", applies, and repeats the checks plus
the NodePort, Gitea health and site-manifest checks. Any failure after
the apply re-applies the saved HelmChartConfig, so the trusted CIDR is
never dropped.
Risk: the apply path was not run against the cluster (the live values
already match). The restore path reuses the same wait and health
helpers as apply-trust.sh.
Verification (desktop):
- Live (already trust, values match): "Forwarded-header trust in
effect (ClientHost 127.0.0.1, proxy 10.42.0.1)", then "already
matches the trust overlay. Nothing to do.", exit 0.
- Copy with memory 64Mi changed to 65Mi, answering "no": the diff
shows only that line, "ERROR: cancelled", exit 1; live still 64Mi.
- The ClientHost check of apply-trust.sh would have failed here
(127.0.0.1 is expected in the trust phase), which is why the check
is inverted.
In a long-lived checkout the observability renderer finds an ignored
.helm/charts/<chart>-<version> cache left by an earlier render and
refuses ("exact chart cache already exists"), so live-drift-check.sh
fails with exit 2 in /home/donghyeon/workspace/platform, the path the
runbooks use.
When run inside a git working tree, copy the tracked and untracked
(not ignored, not deleted) files to the drift work directory and
render from there. Local edits are still checked; ignored caches are
not carried over. Outside a git tree (the daily timer renders a
git archive of origin/main) nothing changes.
Also accept the one drift this exposed: the kube-prometheus-stack
PrometheusRule still has the two Kubelet certificate alerts that PR #6
disabled in values; it goes away when the observability core is
re-applied in the restart window (until 2026-11-30).
Risk: read-only, as before. The copy is removed with the work
directory.
Verification (desktop, fresh clone of main 8b019d2 with an ignored
services/observability/tempo/.helm/charts/tempo-2.2.3 created):
- old script: "REJECT: exact chart cache already exists", exit 2.
- new script as an uncommitted edit in that clone: SUMMARY drift=1
accepted=12 (the PrometheusRule above), exit 1.
- new script from a git archive export, as the timer runs it: same
summary.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
무엇을, 왜
PR #3·#4를 적용할 때 드러난 두 실패를 고친다(총괄 보고, 2026-11-12).
apply-trust.sh는 observe → trust 전환 전용이라, 이미 trust인 상태에서 다른 값(PR #3 resources)만 바뀌면 「observation phase must not trust forwarded headers」로 적용 전에 멈춘다. 그래서 그 값은 guarded 경로 밖의kubectl apply로 들어갔다. →reapply-trust.sh추가.live-drift-check.sh가 운영 checkout(/home/donghyeon/workspace/platform)에서 지난 렌더가 남긴 무시된.helm/charts/…캐시 때문에 관측 렌더가 「exact chart cache already exists」로 거부돼 exit 2로 끝난다. runbook이 쓰는 경로다. → git 작업 트리 안에서는 추적·미추적(무시 제외, 삭제 제외) 파일만 임시 사본으로 옮겨 렌더한다.platform-live-drift-check타이머는live-drift-check-main.sh가git archive origin/main을 임시 폴더에 풀어 돌리므로 처음부터 캐시 영향을 받지 않는다(아래 「export 경로」 시험).고른 방법과 버린 대안
apply-trust.sh에 「이미 trust면 건너뛰기」를 넣지 않고 별도 스크립트로 했다. observe → trust 전환의 방어 조건(관측한 ClientHost가 프록시 주소와 같아야 함)을 그대로 두기 위해서다. trust 단계에서는 Traefik이 전달된 원래 주소(127.0.0.1)를 로그에 남기므로, 재적용 스크립트는 이 검사를 뒤집어 「프록시 주소가 아니어야 함(= 신뢰 작동 중)」으로 적용 전후에 본다.위험과 영향
reapply-trust.sh의 적용 경로는 운영에 돌리지 않았다(라이브 값이 이미 같아 「Nothing to do」로 끝났다). 실패하면 저장해 둔 직전 HelmChartConfig를 다시 적용해 trusted CIDR이 빠지지 않는다.검증
desktop. 로그: 공유 노트
k3s-w6-followups-verify.log.리뷰어가 볼 곳
infrastructure/networking/traefik/scripts/reapply-trust.sh:assert_trust_effective와 restore 경로.scripts/validate/live-drift-check.sh: 사본에 넣을 파일 목록(--cached --others --exclude-standard−--deleted),tar -C가-T보다 앞.관련
In a long-lived checkout the observability renderer finds an ignored .helm/charts/<chart>-<version> cache left by an earlier render and refuses ("exact chart cache already exists"), so live-drift-check.sh fails with exit 2 in /home/donghyeon/workspace/platform, the path the runbooks use. When run inside a git working tree, copy the tracked and untracked (not ignored, not deleted) files to the drift work directory and render from there. Local edits are still checked; ignored caches are not carried over. Outside a git tree (the daily timer renders a git archive of origin/main) nothing changes. Also accept the one drift this exposed: the kube-prometheus-stack PrometheusRule still has the two Kubelet certificate alerts that PR #6 disabled in values; it goes away when the observability core is re-applied in the restart window (until 2026-11-30). Risk: read-only, as before. The copy is removed with the work directory. Verification (desktop, fresh clone of main8b019d2with an ignored services/observability/tempo/.helm/charts/tempo-2.2.3 created): - old script: "REJECT: exact chart cache already exists", exit 2. - new script as an uncommitted edit in that clone: SUMMARY drift=1 accepted=12 (the PrometheusRule above), exit 1. - new script from a git archive export, as the timer runs it: same summary.