helm

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package helm provides Helm SDK integration for managing cloudflared deployment.

Overview

When the controller is started with --manage-cloudflared flag, this package handles the lifecycle of cloudflared deployment using the Helm SDK:

  • Automatic chart discovery from OCI registry
  • Chart version management and upgrades
  • Release installation, upgrade, and uninstallation
  • Values configuration for cloudflared and optional AWG sidecar

Chart Source

The cloudflared chart is pulled from the OCI registry:

oci://ghcr.io/lexfrei/charts/cloudflare-tunnel

The Manager automatically discovers the latest stable version (non-prerelease) and caches the chart to avoid repeated downloads.

AWG Sidecar

Optional AmneziaWG (AWG) sidecar can be configured for routing cloudflared traffic through a VPN tunnel. This requires:

  • AWG configuration secret in the cluster
  • Unique interface name to avoid conflicts between instances

Thread Safety

The Manager uses internal locking for chart cache access and is safe for concurrent use from multiple goroutines.

Index

Constants

View Source
const (
	DefaultChartRef = "oci://ghcr.io/lexfrei/charts/cloudflare-tunnel"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudflaredValues

type CloudflaredValues struct {
	TunnelToken  string
	Protocol     string
	ReplicaCount int
	Sidecar      *SidecarConfig
}

CloudflaredValues holds configuration for cloudflare-tunnel Helm chart.

func (*CloudflaredValues) BuildValues

func (v *CloudflaredValues) BuildValues() map[string]any

BuildValues converts CloudflaredValues to Helm values map.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() (*Manager, error)

func (*Manager) GetActionConfig

func (m *Manager) GetActionConfig(namespace string) (*action.Configuration, error)

func (*Manager) GetLatestVersion

func (m *Manager) GetLatestVersion(_ context.Context, chartRef string) (string, error)

func (*Manager) GetRelease

func (m *Manager) GetRelease(cfg *action.Configuration, releaseName string) (*release.Release, error)

func (*Manager) Install

func (m *Manager) Install(
	ctx context.Context,
	cfg *action.Configuration,
	releaseName, namespace string,
	loadedChart *chart.Chart,
	values map[string]any,
) (*release.Release, error)

func (*Manager) LoadChart

func (m *Manager) LoadChart(_ context.Context, chartRef, version string) (*chart.Chart, error)

func (*Manager) ReleaseExists

func (m *Manager) ReleaseExists(cfg *action.Configuration, releaseName string) bool

func (*Manager) Uninstall

func (m *Manager) Uninstall(cfg *action.Configuration, releaseName string) error

func (*Manager) Upgrade

func (m *Manager) Upgrade(
	ctx context.Context,
	cfg *action.Configuration,
	releaseName string,
	loadedChart *chart.Chart,
	values map[string]any,
) (*release.Release, error)

type SidecarConfig

type SidecarConfig struct {
	ConfigSecretName string
	InterfacePrefix  string // AWG interface name prefix (kernel auto-numbers: prefix0, prefix1, etc.)
}

SidecarConfig holds AWG sidecar configuration.

Jump to

Keyboard shortcuts

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