Skip to content

feat: add AppK8sClient for KService lifecycle management#7166

Merged
AdilFayyaz merged 9 commits intov2from
adil/apps-kservice-lifecycle
Apr 17, 2026
Merged

feat: add AppK8sClient for KService lifecycle management#7166
AdilFayyaz merged 9 commits intov2from
adil/apps-kservice-lifecycle

Conversation

@AdilFayyaz
Copy link
Copy Markdown

@AdilFayyaz AdilFayyaz commented Apr 7, 2026

Depends on: #7161

Why are the changes needed?

The App Service needs a K8s client to manage the full lifecycle of Knative KService CRDs — the single source of truth for app spec and status. This PR lays the infrastructure foundation and implements the core client.

What changes were proposed in this pull request?

  • Implement AppK8sClient in app/internal/k8s/app_client.go with full AppK8sClientInterface: Deploy (create/update KService with spec-SHA change detection), Stop (max-scale=0), Delete (remove KService), GetStatus (map KService conditions → proto), List, GetReplicas, DeleteReplica, and Watch (fan K8s watch events → WatchResponse channel)
  • Moved the config from actions to app/

How was this patch tested?

  • go test ./app/internal/k8s/... -count=1 — 14 unit tests using controller-runtime fake client covering all interface methods
  • go build ./... — full repo build passes
  • Key cases covered: idempotent deploy (spec-SHA skip), stop vs delete semantics, not-found handling, pod status mapping, watch event type routing (Added/Modified/Deleted/Error/Bookmark)

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

@AdilFayyaz AdilFayyaz self-assigned this Apr 7, 2026
@AdilFayyaz AdilFayyaz added added Merged changes that add new functionality flyte2 labels Apr 7, 2026
@AdilFayyaz AdilFayyaz requested a review from pingsutw April 7, 2026 21:54
Base automatically changed from adil/apps-knative-infra to v2 April 7, 2026 22:03
@AdilFayyaz AdilFayyaz force-pushed the adil/apps-kservice-lifecycle branch from ef9cf97 to 2e383a4 Compare April 7, 2026 22:21
@pingsutw pingsutw added this to the V2 GA milestone Apr 8, 2026
Comment thread app/internal/k8s/app_client.go Outdated
Comment thread app/internal/k8s/app_client.go Outdated
Comment thread app/internal/k8s/app_client.go Outdated
Comment thread app/internal/k8s/app_client.go Outdated
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
@AdilFayyaz AdilFayyaz force-pushed the adil/apps-kservice-lifecycle branch from 13e45a2 to dc89b35 Compare April 8, 2026 17:57
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Comment thread app/internal/k8s/app_client.go
Comment thread app/internal/k8s/app_client.go Outdated
Comment thread app/internal/k8s/app_client.go Outdated
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
@AdilFayyaz AdilFayyaz requested a review from pingsutw April 15, 2026 18:26
@AdilFayyaz AdilFayyaz merged commit f1acdb2 into v2 Apr 17, 2026
23 of 26 checks passed
@AdilFayyaz AdilFayyaz deleted the adil/apps-kservice-lifecycle branch April 17, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added Merged changes that add new functionality flyte2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants