Documentation
¶
Index ¶
- Constants
- type ChartInstallOptions
- type CiliumConfig
- type Installer
- func (i *Installer) InstallCertManager(ctx context.Context, kubeconfig []byte, version string) error
- func (i *Installer) InstallChart(ctx context.Context, kubeconfig []byte, opts ChartInstallOptions) error
- func (i *Installer) InstallCilium(ctx context.Context, kubeconfig []byte, cfg CiliumConfig) error
- func (i *Installer) InstallLonghorn(ctx context.Context, kubeconfig []byte, version string) error
- func (i *Installer) InstallMetalLB(ctx context.Context, kubeconfig []byte, version string, poolStart string, ...) error
- func (i *Installer) InstallTraefik(ctx context.Context, kubeconfig []byte, version string) error
- func (i *Installer) UninstallChart(ctx context.Context, kubeconfig []byte, releaseName, namespace string) error
- func (i *Installer) UpdateMetalLBPool(ctx context.Context, kubeconfig []byte, ranges []string) error
Constants ¶
const ( DefaultCiliumVersion = "1.17.0" DefaultCertManagerVersion = "v1.16.2" DefaultLonghornVersion = "1.7.2" DefaultMetalLBVersion = "0.14.9" DefaultTraefikVersion = "34.3.0" )
Default addon versions
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChartInstallOptions ¶
type ChartInstallOptions struct {
RepoName string // e.g., "butler-velero"
RepoURL string // e.g., "https://vmware-tanzu.github.io/helm-charts"
ChartName string // e.g., "velero"
ReleaseName string // e.g., "velero"
Namespace string // e.g., "velero"
Version string // e.g., "7.2.1"
Values map[string]string // Optional helm --set values
ValuesJSON []byte // Optional JSON values written to temp file and passed via --values
Timeout string // Optional, defaults to "10m"
}
ChartInstallOptions contains options for installing a Helm chart.
type CiliumConfig ¶
type CiliumConfig struct {
// Version is the Cilium version to install.
Version string
// APIServerHost is the hostname or IP of the API server.
APIServerHost string
// APIServerPort is the port of the API server.
APIServerPort string
// IngressIP is the IP address of the Ingress controller (for hostAlias).
// Only used when using Ingress mode with a hostname.
IngressIP string
}
CiliumConfig contains the configuration for installing Cilium.
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer handles addon installations on tenant clusters. Tenant clusters use Steward hosted control planes, so Cilium must be configured to reach the API server via kubernetes.default.svc.cluster.local rather than localhost:7445 used on management clusters.
func NewInstaller ¶
func NewInstaller() *Installer
NewInstaller creates a new tenant addon installer.
func (*Installer) InstallCertManager ¶
func (i *Installer) InstallCertManager(ctx context.Context, kubeconfig []byte, version string) error
InstallCertManager installs cert-manager for TLS certificate management.
func (*Installer) InstallChart ¶
func (i *Installer) InstallChart(ctx context.Context, kubeconfig []byte, opts ChartInstallOptions) error
InstallChart installs or upgrades a Helm chart. This is the generic method used by TenantAddon controller.
func (*Installer) InstallCilium ¶
InstallCilium installs Cilium CNI configured for hosted control planes.
For Ingress/Gateway mode (hostname-based API access): Uses "Template-Patch-Apply" pattern to solve the DNS bootstrap problem. CoreDNS needs CNI (Cilium) to run, but Cilium pods need DNS to resolve the API server hostname. We solve this by: 1. Using `helm template` to render manifests (no cluster contact) 2. Patching hostAliases directly into the rendered manifests 3. Applying with `kubectl apply` - pods start with hostAliases from the beginning 4. Waiting for rollout completion
This ensures pods NEVER attempt to resolve the hostname without hostAliases, avoiding progressDeadlineSeconds failures.
For LoadBalancer mode: Cilium connects directly to the LoadBalancer IP, no hostname resolution needed, so we use standard `helm upgrade --install --wait`.
func (*Installer) InstallLonghorn ¶
InstallLonghorn installs Longhorn distributed storage.
func (*Installer) InstallMetalLB ¶
func (i *Installer) InstallMetalLB(ctx context.Context, kubeconfig []byte, version string, poolStart string, poolEnd string) error
InstallMetalLB installs MetalLB load balancer and configures the IP pool.
func (*Installer) InstallTraefik ¶
InstallTraefik installs Traefik ingress controller.
func (*Installer) UninstallChart ¶
func (i *Installer) UninstallChart(ctx context.Context, kubeconfig []byte, releaseName, namespace string) error
UninstallChart uninstalls a Helm release.
func (*Installer) UpdateMetalLBPool ¶ added in v0.6.0
func (i *Installer) UpdateMetalLBPool(ctx context.Context, kubeconfig []byte, ranges []string) error
UpdateMetalLBPool updates the MetalLB IPAddressPool and L2Advertisement on a tenant cluster using server-side apply. Retries transient failures with exponential backoff and verifies the applied state via read-back.