Skip to content

feat: 업데이트된 워크로드 CRD 를 모델·예시에 반영 (AIP-3585) - #129

Merged
juu-n-oo merged 5 commits into
developfrom
feat/AIP-3585
Oct 22, 2026
Merged

juu-n-oo merged 5 commits into
developfrom
feat/AIP-3585

Conversation

@juu-n-oo

@juu-n-oo juu-n-oo commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🔍 여기만은 꼭 봐주세요!!

diff 의 97% 는 kubernetes/examples/crd.yaml 기계 재생성분이라 읽을 필요가 없다. 판단이 필요한 건 셋이다.

  • workspaces 예시가 v1 → v1beta1 로 통째로 바뀐다. 클러스터에 v1 은 없다(현행은 v1beta1 단일, served+storage). 구 예시를 적용해 온 로컬 환경이 있다면 CRD 가 교체된다 — 이 전제가 맞는지만 봐주세요.
    kubernetes/examples/crd.yaml#L639
  • ServiceExposure DTO 를 만들지 않은 판단. 이 CRD 에도 rules[].inference 가 추가됐지만 인포머·RBAC·웹훅 참조가 0건이라 dead code 가 된다(AIP-3419 의 Cueue 와 같은 결론). 나중에 webhook 을 넣기로 하면 그때 만든다.
    docs/aip-3585-workload-crd-sync/01-plan.md
  • tools[].type 을 enum 이 아닌 String 으로 둔 판단. CRD 에 vscode 가 추가됐는데, enum 으로 바꾸면 다음 tool 이 들어올 때 역직렬화가 깨진다. 컨트롤러가 이 값으로 분기하지도 않는다.
    V1beta1WorkspaceTool.java

Summary

  • cluster10(c10-m1) 배포본과 develop 을 대조해 Workspace(v1beta1) 모델에 빠져 있던 3건을 채운다.
  • Operation 은 어제 623862f(AIP-2269)에서 expose.inference 가 들어가 이미 클러스터와 맞다. 같은 expose 구조를 공유하는 Workspace 만 빠져 있었다.
  • 어긋나 있던 kubernetes/examples/crd.yaml 의 operations·workspaces 참조 사본을 클러스터 기준으로 다시 맞춘다.
  • 리컨실 경로가 워크로드 CR 에서 이름·라벨만 쓰기 때문에 DTO 필드명을 틀려도 런타임 증상이 없다 — 인포머와 같은 Gson 으로 역직렬화를 고정하는 테스트를 함께 넣는다.
  • 관련 티켓: AIP-3585 (상위 에픽 AIP-2646)

Changes

  • DTO (Workspace v1beta1): V1beta1WorkspacePortExpose 에 nested Inference{host, path} 추가. tls 가 없는 것은 의도 — 추론 노출은 항상 HTTPS 라 CRD 에도 없다.
  • DTO (Workspace v1beta1): V1beta1WorkspaceSuspendOption(commit{enabled, repository, applyImage}) · V1beta1WorkspaceSuspendCommitStatus(image, prevImage, appliedImage) 신규 + Spec/Status 배선. 최상위 필드 1개당 DTO 1개 + nested 클래스는 V1beta1WorkspaceSsh.Password 와 같은 방식이다.
  • 예시 매니페스트: examples/crd.yaml 의 두 문서를 클러스터 덤프에서 기계 생성하고 spec.template(PodTemplateSpec 전문 8천 줄)만 기존 축약본으로 교체. operations 는 구 계약 ports[].external 을, workspaces 는 v1 스키마를 들고 있었다.
  • 테스트: WorkloadDtoDeserializationTest 4건 — expose.inference(WS/OP 양쪽) · suspendOption.commit + status.suspendCommit · tools[].type=vscode.
  • 문서: docs/aip-3585-workload-crd-sync/ 4종.

알려진 트레이드오프 / 하위 호환성

  • 동작 변경 없음. 추가한 필드를 읽는 코드가 0건이고 리컨실 분기도 그대로다. RBAC·웹훅 rules 도 리소스 plural 과 라벨 낙인 대상이 그대로라 변경 없다.
  • 이전 빌드도 INFERENCE Workspace 때문에 죽지는 않았다 — Gson 이 모르는 필드를 무시하기 때문이다. 다만 그 필드를 조용히 누락했고, 이번 변경으로 모델이 계약과 같아진다.
  • 예시 CRD 의 spec.template 은 여전히 축약본이다(containers/hostname/volumes). 이 파일을 실제 클러스터에 적용하면 pod spec 의 나머지 필드가 pruning 된다 — 예시 용도라는 기존 전제를 유지한다.

Test plan

  • ./gradlew clean compileJava compileTestJava test → 317 tests / 0 failures / 0 errors
  • Workspace expose.inference · suspendOption.commit · status.suspendCommit 역직렬화
  • Operation expose.inference · status.ports[].type 역직렬화
  • tools[].type = vscode 가 String 으로 그대로 실림
  • DTO 필드 집합 ↔ 클러스터 CRD 키 집합 프로그램 대조 (spec·status 양쪽 일치)
  • examples/crd.yaml 8-doc 파싱 · 손대지 않은 6개 문서 무변경
  • examples/crd.yaml 의 두 문서가 template 축약분 제외 클러스터와 완전 일치
  • kubectl apply --dry-run=client · --server-side --dry-run=server(kind-local) 8-doc 통과
  • kind 실기동 — 갱신 CRD 적용 후 Workspace(INFERENCE+suspendOption+vscode) · Operation · ServiceExposure 실제 생성, apiserver 저장분 JSON 을 이 브랜치 DTO 로 역직렬화해 PASS (인포머와 같은 Gson)
  • kind 음성 케이스 5종 — inference 누락 / inference+tcp 공존 / 포트 이름 vscode / 포트 번호 17682 / runAsNonRoot: true 가 전부 기대한 메시지로 거절
  • 프론트 생성 플로우 실측 — 갱신 CRD 위에서 프론트 핀 bab74e36 의 실제 생성 UI 를 브라우저 프로브로 1회(aipub-load-prober local-quick + BROWSER_CREATE=true): checks 779/779 · http_req_failed 0%, workload submit 2xx → workload create success 통과. 프로브 구간 project-controller 에러 0건
  • (배포 후) 추론 포트를 가진 Workspace 생성 → 인포머 동기화·RBAC resourceNames 편입 확인
  • (배포 후) 정지 커밋 사용 Workspace 가 있는 환경에서 컨트롤러 로그 이상 없음

함께 보는 PR

aipub-load-prober chore/AIP-3585-crd-sync — 같은 클러스터 덤프로 script/crds/ 의
operation·workspace·serviceexposure 사본을 갱신한다. 서로 독립적으로 머지 가능하다.

🚀 Release Version

v5.2.0

cluster10 배포본과 대조해 Workspace(v1beta1) 모델에 빠져 있던 3건을 채운다. Operation 은
AIP-2269 에서 이미 같은 모양으로 반영돼 있다.

- expose.inference{host, path} — 추론 노출은 항상 HTTPS 라 tls 가 없다
- spec.suspendOption.commit{enabled, repository, applyImage}
- status.suspendCommit{image, prevImage, appliedImage}

tools[].type 에 vscode 가 추가됐지만 DTO 는 String 으로 둔다. enum 으로 바꾸면 다음 tool 이
들어올 때 역직렬화가 깨지고, 컨트롤러가 이 값으로 분기하지도 않는다.

ServiceExposure 는 DTO 를 만들지 않는다. 인포머·RBAC·웹훅 어디에서도 참조하지 않아 dead code 가
된다.

리컨실 경로가 워크로드 CR 에서 이름·라벨만 쓰기 때문에 필드명을 틀려도 런타임에 증상이 없다.
인포머와 같은 Gson 으로 역직렬화를 고정하는 테스트 4건을 함께 넣는다.
kubernetes/examples/crd.yaml 의 operations·workspaces 문서를 c10-m1 덤프로 교체한다.
PodTemplateSpec 전문은 예시에 불필요해 기존 축약본을 그대로 끼웠다.

두 문서 다 현행과 어긋나 있었다.

- operations: ports[].external{enabled,host,path} — DTO 는 AIP-2269 에서 expose 로 옮겨갔는데
  예시가 따라가지 않았다
- workspaces: 아예 v1 스키마였다(ssh.publicKey, status.addresses/pods/readyCondition). 클러스터에
  v1 은 없어 그대로 적용하면 현행과 충돌한다 — v1beta1 로 교체

작업 문서 4종을 docs/aip-3585-workload-crd-sync/ 에 남긴다.
@juu-n-oo juu-n-oo added this to the v5.2.0 milestone Oct 22, 2026
갱신 CRD 를 kind 에 적용해 Workspace/Operation/ServiceExposure 를 실제로 만들고, apiserver 가
저장한 JSON 을 인포머와 같은 Gson 으로 이 브랜치 DTO 에 역직렬화해 매핑을 확인했다.
손으로 쓴 픽스처가 아니라 저장분이라 defaulting 까지 포함된다.

새 CEL 검증 5종(inference 누락·inference+tcp 공존·포트 이름 vscode·포트 번호 17682·
runAsNonRoot=true)이 전부 기대한 메시지로 거절하는 것도 함께 확인했다.
@juu-n-oo
juu-n-oo merged commit 40bb6d8 into develop Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant