Skip to content

feat(deployments): K8s DeploymentBackend scaffold (AIRCORE-757 phase 1) - #533

Merged
tylersbray merged 3 commits into
mainfrom
757-k8s-phase1-scaffold/tbray
Jul 1, 2026
Merged

feat(deployments): K8s DeploymentBackend scaffold (AIRCORE-757 phase 1)#533
tylersbray merged 3 commits into
mainfrom
757-k8s-phase1-scaffold/tbray

Conversation

@tylersbray

@tylersbray tylersbray commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Register K8sDeploymentBackend in BACKEND_CLASSES with K8sExecutorConfig (kubeconfig path, default namespace, request timeout).
  • Add per-instance KubernetesClients (CoreV1Api, AppsV1Api, BatchV1Api) with optional kubernetes extra.
  • Extract shared identity labels and naming to backends/labels.py; docker re-exports for compatibility.
  • ABC methods intentionally raise NotImplementedError — PVC/Job/Deployment paths land in phases 2–4.

Design notes (phase 1)

  • Finite workloads: batch/v1.Job (not bare Pod) — documented on Linear ticket.
  • RBAC: namespace-scoped Role — phase 6.
  • request_timeout: stored on KubernetesClients; API calls will pass _request_timeout in phase 2+.

Test plan

  • uv run pytest plugins/nemo-deployments/tests/unit -v (175 passed)
  • pre-mr-review + Bugbot review (fixed per-instance kubeconfig loading)

Linear

AIRCORE-757 — Phase 1 of 7

Summary by CodeRabbit

  • New Features

    • Added Kubernetes deployment backend support, including Kubernetes client setup and executor configuration.
    • Introduced Kubernetes-safe resource naming for deployments and volumes.
  • Bug Fixes

    • Improved namespace validation to catch invalid Kubernetes namespace names earlier.
    • Ensured Kubernetes clients are closed cleanly when the backend shuts down.
  • Chores

    • Added Kubernetes dependency support for both runtime and development use.
    • Updated backend registration so Kubernetes deployments can be resolved automatically.

Register K8sDeploymentBackend with executor config, per-instance Kubernetes
clients, and shared identity labels. ABC methods stub NotImplementedError until
later phases implement PVC, Job, and Deployment+Service paths.

Signed-off-by: Tyler Bray <tbray@nvidia.com>
@tylersbray
tylersbray requested review from a team as code owners July 1, 2026 15:35
@github-actions github-actions Bot added the feat label Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Kubernetes deployment backend (K8sDeploymentBackend) with stubbed lifecycle operations, Kubernetes client bootstrap and executor config validation, registry wiring for the "k8s" backend type, and shared label/naming helpers refactored out of Docker-specific modules, plus corresponding unit tests and dependency updates.

Changes

Kubernetes backend addition

Layer / File(s) Summary
Dependency declarations
plugins/nemo-deployments/pyproject.toml
Adds kubernetes>=30.1.0 to a new k8s optional dependency group and to the dev dependency group.
Shared label and naming helpers
plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py, backends/docker/*.py, tests/*/docker/*, tests/unit/backends/k8s/test_k8s_registry.py
Adds k8s_deployment_resource_name/k8s_volume_resource_name helpers using k8s_safe_name and hashed workspace-derived names, updates docstrings, narrows managed_by_filter return type, redirects Docker modules and tests to import labels from the shared module, and adds tests for name prefixes, length limits, uniqueness, and label selectors.
Kubernetes config and client bootstrap
backends/k8s/config.py, backends/k8s/client.py, tests/unit/backends/k8s/test_client.py
Adds K8sExecutorConfig with DNS-1123 namespace validation, build_api_client (in-cluster with kubeconfig fallback), and KubernetesClients with lazy-cached API wrappers and close(), with tests covering config validation, client construction paths, and close behavior.
K8s backend scaffold and registry
backends/k8s/backend.py, backends/registry.py, tests/unit/backends/k8s/conftest.py, tests/unit/backends/k8s/test_backend.py
Adds K8sDeploymentBackend with init/shutdown, executor_config/clients properties, stubbed async deployment/volume methods raising NotImplementedError, registers "k8s" in BACKEND_CLASSES, and adds fixtures and tests for construction, defaults, and shutdown.

Sequence Diagram(s)

sequenceDiagram
    participant Registry as ExecutorRegistry
    participant Backend as K8sDeploymentBackend
    participant Client as KubernetesClients
    participant K8sAPI as kubernetes.client

    Registry->>Backend: resolve("k8s") -> init()
    Backend->>Backend: K8sExecutorConfig.model_validate(config)
    Backend->>Client: KubernetesClients(kubeconfig_path, request_timeout)
    Client->>K8sAPI: build_api_client()
    K8sAPI-->>Client: ApiClient
    Backend-->>Registry: backend instance ready

    Registry->>Backend: shutdown()
    Backend->>Client: close()
    Client->>K8sAPI: ApiClient.close()
Loading

Possibly related PRs

  • NVIDIA-NeMo/nemo-platform#280: Extends the deployments backend registry framework by adding K8sDeploymentBackend into BACKEND_CLASSES alongside K8s config/client wiring.
  • NVIDIA-NeMo/nemo-platform#399: Introduces the shared backends/labels.py identity/name-label helpers replacing Docker-specific label logic, also touching backend registry wiring.
  • NVIDIA-NeMo/nemo-platform#523: Implements the collision-proof k8s_safe_name hashed naming scheme for deployment/volume resource names.

Suggested reviewers: benmccown, mckornfield

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a K8s DeploymentBackend scaffold for phase 1.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 757-k8s-phase1-scaffold/tbray

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (6)
plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py (1)

80-81: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Inaccurate return type hint on managed_by_filter.

Declared as dict[str, str | bool] but the implementation only ever returns a str value. Narrow the hint to dict[str, str] unless a bool value is genuinely expected elsewhere.

♻️ Proposed fix
-def managed_by_filter() -> dict[str, str | bool]:
+def managed_by_filter() -> dict[str, str]:
     return {"label": f"{MANAGED_BY_KEY}={MANAGED_BY_LABEL}"}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py`
around lines 80 - 81, The return type on managed_by_filter is too broad because
it only returns a string-valued dict entry today. Update the type hint in
managed_by_filter to use dict[str, str] and keep the implementation unchanged
unless there is a real caller that needs a bool value.
plugins/nemo-deployments/tests/unit/backends/k8s/test_k8s_registry.py (1)

4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

from __future__ import annotations makes hints string-based.

Conflicts with the repo guideline to prefer concrete type hints over string-based ones.

As per coding guidelines, "Always prefer concrete type hints over string-based ones in Python code; do not import types under TYPE_CHECKING, instead import types as regular imports when possible."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/nemo-deployments/tests/unit/backends/k8s/test_k8s_registry.py` at
line 4, The test module is importing future annotations, which forces
string-based type hints and conflicts with the repo guideline to use concrete
types. Remove the from __future__ import annotations import from the k8s
registry test module, and update any affected annotations in the nearby test
code to use direct, concrete imports or runtime-resolvable types instead of
postponed/stringified hints.

Source: Coding guidelines

plugins/nemo-deployments/tests/unit/backends/k8s/conftest.py (1)

6-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

from __future__ import annotations makes hints string-based.

Same concern as other new test files in this cohort.

As per coding guidelines, "Always prefer concrete type hints over string-based ones in Python code."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/nemo-deployments/tests/unit/backends/k8s/conftest.py` at line 6, The
test module is enabling string-based annotations via from __future__ import
annotations, which conflicts with the coding guideline to prefer concrete type
hints. Remove that future import from this conftest module and update any
affected annotations in the related test setup code to use real type references
so symbols like conftest.py remain consistent with the rest of the cohort.

Source: Coding guidelines

plugins/nemo-deployments/tests/unit/backends/k8s/test_backend.py (1)

4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

from __future__ import annotations makes hints string-based.

Same concern as other new test files in this cohort.

As per coding guidelines, "Always prefer concrete type hints over string-based ones in Python code."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/nemo-deployments/tests/unit/backends/k8s/test_backend.py` at line 4,
The new test module is importing future annotations, which causes type hints to
be stored as strings instead of concrete types. Remove the from __future__
import annotations line from this test file and keep the existing annotations
expressed with concrete Python types, following the same pattern used in the
other new test modules and any nearby test helpers.

Source: Coding guidelines

plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/client.py (1)

35-83: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

No cleanup path for the lazily-created ApiClient.

KubernetesClients never exposes a way to release the underlying ApiClient's connection pool. Once later phases start invoking core_v1/apps_v1/batch_v1, backend shutdown should close these to avoid leaking connections.

♻️ Suggested addition
     `@property`
     def batch_v1(self) -> client.BatchV1Api:
         if self._batch_v1 is None:
             from kubernetes import client

             self._batch_v1 = client.BatchV1Api(self._api())
         return self._batch_v1
+
+    def close(self) -> None:
+        """Release the underlying ApiClient's connection pool, if created."""
+        if self._api_client is not None:
+            self._api_client.close()
+            self._api_client = None
+            self._core_v1 = self._apps_v1 = self._batch_v1 = None
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/client.py`
around lines 35 - 83, KubernetesClients lazily creates a shared ApiClient in
_api() but never provides a cleanup path, so its connection pool can remain open
after use. Add a close/shutdown method on KubernetesClients that releases the
underlying _api_client and resets the cached client fields, and make sure
backend shutdown calls it after core_v1, apps_v1, or batch_v1 usage. Keep the
cleanup centered around the existing _api(), _api_client, and API property
caches so the lifecycle is explicit and safe.
plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/backend.py (1)

49-50: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

shutdown() doesn't release the Kubernetes API client's connection pool.

Once _clients is used to create real API objects, this no-op leaks connections. Wire it to the close() method suggested in client.py.

♻️ Suggested fix (depends on adding `KubernetesClients.close()`)
     def shutdown(self) -> None:
-        pass
+        self._clients.close()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/backend.py`
around lines 49 - 50, The backend shutdown path is a no-op, so the Kubernetes
API client connection pool is never released once _clients has been used. Update
the Backend.shutdown() method to delegate to the client cleanup logic by calling
the new KubernetesClients.close() method from client.py, and ensure the Backend
class uses that closeable client instance during teardown.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/nemo-deployments/tests/unit/backends/k8s/test_client.py`:
- Around line 66-76: The fallback test in
test_build_api_client_falls_back_to_kubeconfig is tautological because it
derives the expected client_configuration from mock_kube.call_args itself.
Update the test to assert that load_kube_config in build_api_client receives the
mocked kubernetes.client.Configuration() return value (from the Configuration
patch) rather than reading back the call args, so the test actually verifies the
passed instance.

---

Nitpick comments:
In
`@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/backend.py`:
- Around line 49-50: The backend shutdown path is a no-op, so the Kubernetes API
client connection pool is never released once _clients has been used. Update the
Backend.shutdown() method to delegate to the client cleanup logic by calling the
new KubernetesClients.close() method from client.py, and ensure the Backend
class uses that closeable client instance during teardown.

In `@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/client.py`:
- Around line 35-83: KubernetesClients lazily creates a shared ApiClient in
_api() but never provides a cleanup path, so its connection pool can remain open
after use. Add a close/shutdown method on KubernetesClients that releases the
underlying _api_client and resets the cached client fields, and make sure
backend shutdown calls it after core_v1, apps_v1, or batch_v1 usage. Keep the
cleanup centered around the existing _api(), _api_client, and API property
caches so the lifecycle is explicit and safe.

In `@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py`:
- Around line 80-81: The return type on managed_by_filter is too broad because
it only returns a string-valued dict entry today. Update the type hint in
managed_by_filter to use dict[str, str] and keep the implementation unchanged
unless there is a real caller that needs a bool value.

In `@plugins/nemo-deployments/tests/unit/backends/k8s/conftest.py`:
- Line 6: The test module is enabling string-based annotations via from
__future__ import annotations, which conflicts with the coding guideline to
prefer concrete type hints. Remove that future import from this conftest module
and update any affected annotations in the related test setup code to use real
type references so symbols like conftest.py remain consistent with the rest of
the cohort.

In `@plugins/nemo-deployments/tests/unit/backends/k8s/test_backend.py`:
- Line 4: The new test module is importing future annotations, which causes type
hints to be stored as strings instead of concrete types. Remove the from
__future__ import annotations line from this test file and keep the existing
annotations expressed with concrete Python types, following the same pattern
used in the other new test modules and any nearby test helpers.

In `@plugins/nemo-deployments/tests/unit/backends/k8s/test_k8s_registry.py`:
- Line 4: The test module is importing future annotations, which forces
string-based type hints and conflicts with the repo guideline to use concrete
types. Remove the from __future__ import annotations import from the k8s
registry test module, and update any affected annotations in the nearby test
code to use direct, concrete imports or runtime-resolvable types instead of
postponed/stringified hints.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bf79059c-5615-4e0e-ab83-0ed967e86bcf

📥 Commits

Reviewing files that changed from the base of the PR and between d18be8e and 45ad6ae.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • plugins/nemo-deployments/pyproject.toml
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/labels.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/backend.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/client.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/config.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/registry.py
  • plugins/nemo-deployments/tests/unit/backends/k8s/conftest.py
  • plugins/nemo-deployments/tests/unit/backends/k8s/test_backend.py
  • plugins/nemo-deployments/tests/unit/backends/k8s/test_client.py
  • plugins/nemo-deployments/tests/unit/backends/k8s/test_k8s_registry.py

Comment thread plugins/nemo-deployments/tests/unit/backends/k8s/test_client.py Outdated
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 22208/29406 75.5% 60.3%
Integration Tests 12804/28086 45.6% 19.1%

Centralize kubernetes imports in _kubernetes_modules() so optional-dep
loading stays lazy without repeated inline imports. Add KubernetesClients.close()
and wire K8sDeploymentBackend.shutdown(). Fix tautological kubeconfig fallback
test and narrow managed_by_filter return type.

Signed-off-by: Tyler Bray <tbray@nvidia.com>
@tylersbray
tylersbray requested a review from mckornfield July 1, 2026 16:19

@mckornfield mckornfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay smaller prs

Comment thread plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/labels.py Outdated
Comment thread plugins/nemo-deployments/tests/unit/backends/k8s/test_client.py Outdated
Comment thread plugins/nemo-deployments/pyproject.toml
Drop docker/labels.py re-export shim; import shared backends.labels directly.
Remove per-instance kubeconfig busywork test. Validate default_namespace as a
DNS-1123 label. Document label prefix/workspace-key and ApiClient close behavior.

Signed-off-by: Tyler Bray <tbray@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py (1)

37-58: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Naming: k8s_* helpers used for Docker resource naming.

docker_volume_name/container_name now delegate to k8s_deployment_resource_name/k8s_volume_resource_name. Prefix (dep-/dep-vol-) and hash input (deployment_key) are unchanged, so generated Docker names stay stable — no breaking rename. Naming these helpers k8s_* while they're also the canonical Docker naming path is a bit confusing since this is a shared module now.

Consider a backend-neutral name (e.g. dns1123_resource_name) since it's used by both backends.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py`
around lines 37 - 58, The naming helpers in labels.py are backend-neutral, but
the current k8s_* function names make them look Kubernetes-only even though
docker_volume_name and the container naming path also rely on them. Rename the
shared helpers to a backend-agnostic symbol such as dns1123_resource_name (and
update docker_volume_name, k8s_deployment_resource_name, and
k8s_volume_resource_name call sites accordingly) so the shared naming logic is
clearer without changing the generated names.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py`:
- Around line 37-58: The naming helpers in labels.py are backend-neutral, but
the current k8s_* function names make them look Kubernetes-only even though
docker_volume_name and the container naming path also rely on them. Rename the
shared helpers to a backend-agnostic symbol such as dns1123_resource_name (and
update docker_volume_name, k8s_deployment_resource_name, and
k8s_volume_resource_name call sites accordingly) so the shared naming logic is
clearer without changing the generated names.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 925fc156-0f32-47d8-8c80-17dbea4723b6

📥 Commits

Reviewing files that changed from the base of the PR and between 76e3c05 and 10dd091.

📒 Files selected for processing (17)
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/backend.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/containers.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/gpu.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/ports.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/volumes.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/backend.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/client.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/config.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/labels.py
  • plugins/nemo-deployments/tests/integration/backends/docker/test_docker_backend.py
  • plugins/nemo-deployments/tests/integration/test_reconcile_docker.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_backend_mocked.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_gpu.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_idempotency.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_labels.py
  • plugins/nemo-deployments/tests/unit/backends/k8s/test_backend.py
  • plugins/nemo-deployments/tests/unit/backends/k8s/test_client.py
💤 Files with no reviewable changes (1)
  • plugins/nemo-deployments/tests/unit/backends/k8s/test_client.py
✅ Files skipped from review due to trivial changes (5)
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/containers.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/ports.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_backend_mocked.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/volumes.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/backend.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/config.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/client.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/k8s/backend.py

@tylersbray
tylersbray added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 8b6ff3f Jul 1, 2026
54 checks passed
@tylersbray
tylersbray deleted the 757-k8s-phase1-scaffold/tbray branch July 1, 2026 17:28
arpitsardhana pushed a commit that referenced this pull request Jul 9, 2026
…1) (#533)

* feat(deployments): scaffold K8s DeploymentBackend (AIRCORE-757 phase 1)

Register K8sDeploymentBackend with executor config, per-instance Kubernetes
clients, and shared identity labels. ABC methods stub NotImplementedError until
later phases implement PVC, Job, and Deployment+Service paths.

Signed-off-by: Tyler Bray <tbray@nvidia.com>

* fix(deployments): address PR 533 review feedback for k8s client

Centralize kubernetes imports in _kubernetes_modules() so optional-dep
loading stays lazy without repeated inline imports. Add KubernetesClients.close()
and wire K8sDeploymentBackend.shutdown(). Fix tautological kubeconfig fallback
test and narrow managed_by_filter return type.

Signed-off-by: Tyler Bray <tbray@nvidia.com>

* fix(deployments): address mckornfield PR 533 review comments

Drop docker/labels.py re-export shim; import shared backends.labels directly.
Remove per-instance kubeconfig busywork test. Validate default_namespace as a
DNS-1123 label. Document label prefix/workspace-key and ApiClient close behavior.

Signed-off-by: Tyler Bray <tbray@nvidia.com>

---------

Signed-off-by: Tyler Bray <tbray@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants