kube

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDiscoveryTimeout = 10 * time.Second

DefaultDiscoveryTimeout is the total wall-clock budget for DiscoverCluster: both `Discovery().ServerVersion()` and `CoreV1().Nodes().List()` must complete within this window.

Variables

This section is empty.

Functions

func DiscoverCluster

func DiscoverCluster(ctx context.Context, kubeconfigBytes []byte) (*domain.ClusterDiscoveryInfo, error)

DiscoverCluster connects to the cluster described by kubeconfigBytes and returns its server version and the sorted, de-duplicated set of node architectures (from `node.status.nodeInfo.architecture`). The Cluster aggregate stores this so the Pre-Deploy Gate can cross-check `ToolVersion.ArchSupport` against the actual workload fleet.

func InClusterKubeconfig

func InClusterKubeconfig() ([]byte, error)

InClusterKubeconfig 는 Nullus 가 떠 있는 클러스터를 가리키는 kubeconfig 를 만든다.

자기 클러스터 등록(self-registration)에 쓰인다. 에어갭 무인 설치와 단일 클러스터 배포에서는 운영자가 kubeconfig 를 업로드할 대상이 자기 자신이라 업로드 단계 자체가 불필요하다.

파드에 마운트된 ServiceAccount 토큰과 CA 로 구성하므로 새로운 자격증명이 생기지 않는다. 토큰은 kubelet 이 자동 로테이션하는 값이다.

Types

type Discoverer

type Discoverer struct{}

Discoverer adapts the package-level DiscoverCluster function to the port.ClusterDiscoverer interface. It lets the use case depend on an interface instead of importing this adapter package directly, keeping the Clean Architecture dependency direction (domain -> port <- adapter).

func NewDiscoverer

func NewDiscoverer() *Discoverer

NewDiscoverer constructs a Discoverer.

func (*Discoverer) Discover

func (d *Discoverer) Discover(ctx context.Context, kubeconfig []byte) (*domain.ClusterDiscoveryInfo, error)

Discover delegates to DiscoverCluster.

type VerifyResult

type VerifyResult struct {
	Status  string `json:"status"`
	Version string `json:"version"`
}

VerifyResult is the legacy response shape kept for handler backwards compatibility. New call sites should prefer DiscoverCluster which returns the full ClusterDiscoveryInfo value object.

func VerifyCluster

func VerifyCluster(kubeconfigBytes []byte) (*VerifyResult, error)

VerifyCluster is the original entry point that only returns server version. It now delegates to DiscoverCluster under the hood so a single round trip pulls both server version and node architectures.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL