Integrate d2k into kubesolo#156
Open
stevensbkang wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an optional integration to deploy Portainer d2k (Docker-to-Kubernetes API translator) as part of KubeSolo, exposing a Docker-compatible mTLS endpoint on port 2376, along with certificate generation, image handling, and operator-facing connection instructions/files.
Changes:
- Introduces
--d2k/--d2k-namespaceflags and wires them into startup/bootstrap configuration. - Adds PKI support to mint d2k server/client certs signed by the existing KubeSolo CA, and persists connection details to disk.
- Adds d2k component reconciliation (Namespace/RBAC/Secret/Deployment/Service) and ensures the d2k image is imported/pulled when enabled.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
types/types.go |
Adds d2k-related config fields and certificate path struct. |
types/const.go |
Adds defaults for d2k image/port/dir. |
README.md |
Documents new CLI flags for d2k. |
pkg/runtime/containerd/service.go |
Plumbs d2k image file + enablement state into containerd service. |
pkg/runtime/containerd/image.go |
Imports/pulls d2k image when d2k is enabled. |
pkg/runtime/containerd/executor.go |
Passes d2k enablement to image import step. |
pkg/kubernetes/webhook/loadbalancer.go |
Import order adjustment. |
pkg/components/d2k/d2k.go |
Implements top-level d2k deployment orchestration and shared labels/constants. |
pkg/components/d2k/namespace.go |
Creates target namespace if missing. |
pkg/components/d2k/rbac.go |
Adds ServiceAccount/Role/RoleBinding + node-reader ClusterRole/Binding. |
pkg/components/d2k/secret.go |
Syncs server TLS material into a kubernetes.io/tls Secret. |
pkg/components/d2k/deployment.go |
Reconciles the d2k Deployment (env, TLS mount, resources). |
pkg/components/d2k/service.go |
Reconciles a LoadBalancer Service exposing port 2376. |
pkg/components/d2k/endpoint.go |
Waits for LB ingress IP and writes connection.env/connection.txt + symlinks. |
internal/core/pki/types.go |
Adds new certificate types for d2k server/client. |
internal/core/pki/pki.go |
Conditionally generates d2k certificates when enabled. |
internal/core/pki/options.go |
Adds SANs/options for d2k server/client certs. |
internal/core/embedded/load.go |
Includes d2k image in embedded image loading pipeline. |
internal/core/embedded/embedded_images_online.go |
Declares d2k image placeholder for online builds. |
internal/core/embedded/embedded_images_offline.go |
Notes arch-specific embedding for offline d2k image. |
internal/core/embedded/embedded_images_offline_riscv64.go |
Notes unsupported-arch handling for offline d2k image embed. |
internal/core/embedded/embedded_d2k_offline_supported.go |
Embeds d2k.tar.gz for offline amd64/arm64 builds. |
internal/core/embedded/embedded_d2k_offline_unsupported.go |
Declares empty d2k image for offline unsupported arches. |
internal/config/flags/flags.go |
Adds --d2k and --d2k-namespace flags. |
cmd/kubesolo/main.go |
Deploys d2k when enabled; starts endpoint persistence goroutine; bootstraps d2k paths. |
install.sh |
Adds installer args/env passthrough for d2k flags. |
docs/installation/flags.md |
Documents --d2k and --d2k-namespace. |
docs/configuration/d2k.md |
Adds full d2k configuration/usage guide. |
build/download-deps.sh |
Downloads/embeds d2k image for offline builds on supported arches. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.