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
- type CloudflaredValues
- type Manager
- func (m *Manager) GetActionConfig(namespace string) (*action.Configuration, error)
- func (m *Manager) GetLatestVersion(_ context.Context, chartRef string) (string, error)
- func (m *Manager) GetRelease(cfg *action.Configuration, releaseName string) (*release.Release, error)
- func (m *Manager) Install(ctx context.Context, cfg *action.Configuration, releaseName, namespace string, ...) (*release.Release, error)
- func (m *Manager) LoadChart(_ context.Context, chartRef, version string) (*chart.Chart, error)
- func (m *Manager) ReleaseExists(cfg *action.Configuration, releaseName string) bool
- func (m *Manager) Uninstall(cfg *action.Configuration, releaseName string) error
- func (m *Manager) Upgrade(ctx context.Context, cfg *action.Configuration, releaseName string, ...) (*release.Release, error)
- type SidecarConfig
Constants ¶
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 (*Manager) GetActionConfig ¶
func (m *Manager) GetActionConfig(namespace string) (*action.Configuration, error)
func (*Manager) GetLatestVersion ¶
func (*Manager) GetRelease ¶
func (*Manager) ReleaseExists ¶
func (m *Manager) ReleaseExists(cfg *action.Configuration, releaseName string) bool
type SidecarConfig ¶
type SidecarConfig struct {
ConfigSecretName string
InterfacePrefix string // AWG interface name prefix (kernel auto-numbers: prefix0, prefix1, etc.)
}
SidecarConfig holds AWG sidecar configuration.