refactor: keiailab-commons v0.11.0 채택 — Latency 누수 fix + exporter pin (-706 LOC)#285
Merged
Merged
Conversation
… (-706 LOC)
3-operator 라이브러리 스타일 일관 리팩토링 (keiailab-commons#77 Phase B).
probes/status/reconcile/storageclass/apply/certmanager/reconcilemetrics
자체구현을 commons v0.11.0 호출로 교체.
의도된 거동 변화 (gate 검증 완료):
- reconcile Latency 시계열 누수 fix 2중:
① 구 DeleteMetricsFor 가 duration_seconds 를 삭제하지 않아 삭제 CR 의
latency 시계열 영구 잔존 → commons DeleteFor 가 trio 전체 삭제
② CR 삭제 (NotFound) 경로에서 defer 가 latency 1건 재생성 →
crDeleted flag 로 삭제 경로 관측 skip
- applyErrorCondition false-transition fix: ReconcileError condition 의
LastTransitionTime 이 매 reconcile 갱신되던 결함 → meta.SetStatusCondition
(status 변경 시만 갱신). phase/이벤트/RequeueAfter 30s/메시지 동일
- updateStatusWithRetry 폐기 → commons UpdateWithRetry (refetch+mutate.
구판은 conflict 시 stale ResourceVersion 무효 재시도). 19 콜사이트
- exporter default: oliver006/redis_exporter:latest → v1.86.0 pin
(DefaultExporterImage const SSOT, v1alpha1+v1alpha2 + CRD 4 file 동기.
기존 CR persist 값 소급 없음)
- Certificate CR spec.issuerRef.group: cert-manager.io 명시 emit
(빈 group 동일 해석 — 재발급 트리거 없음, commons doc 검증)
- webhook storageClassName 거절 문구 commons 표준 문구로 (규칙 동일)
- SchemeGroupVersion → GroupVersion rename (kubebuilder 컨벤션 정합)
핵심 보존 검증:
- 메트릭 fqName byte-동일: valkey_cluster_reconcile_{total,
duration_seconds,errors_total} — subsystem "valkey_cluster" 주입.
Valkey controller 의 Total 미집계 비대칭은 행동 보존 위해 유지
- Latency=defer 관측 / Total=진입 Inc 시점 동일
- 기존 테스트 삭제 0 (TestExporterImage 만 const 참조로 기대값 전환)
검증:
- go build+vet 0 에러 / go test -race ./... FAIL 0 (envtest 실 구동)
- golangci-lint 0 issues (사전 존재 이슈 포함 0) / generated drift 0
- CI golang go.mod 정합 + git grep -i bitnami 0건
후속: release 시 make bundle 재생성 (OLM manifests exporter default 반영)
Refs: KeiaiLab/keiailab-commons#77
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
사용자 시나리오
operator 유지보수자가 probe/status/apply/cert/메트릭 보일러플레이트를 본 repo 에서 직접 유지하지 않고
keiailab-commonsv0.11.0 한 곳에서 import 한다. 27 files, +484/−706.의도된 거동 변화 (게이트 agent 실측)
oliver006/redis_exporter:latest→ v1.86.0 pin (const SSOT + CRD 4 file)issuerRef.group: cert-manager.io명시 emit핵심 보존 검증
valkey_cluster_reconcile_{total,duration_seconds,errors_total}— Help/bucket 12종/라벨 동일. Valkey controller 의 Total 미집계 비대칭은 행동 보존 위해 유지검증
후속 (release 시):
make bundle재생성으로 OLM manifests 의 exporter default 반영.Refs: KeiaiLab/keiailab-commons#77