kubecontrollers

package
v1.45.0-0.dev Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KubeController                  = "calico-kube-controllers"
	KubeControllerServiceAccount    = "calico-kube-controllers"
	KubeControllerRole              = "calico-kube-controllers"
	KubeControllerRoleBinding       = "calico-kube-controllers"
	KubeControllerMetrics           = "calico-kube-controllers-metrics"
	KubeControllerNetworkPolicyName = networkpolicy.CalicoComponentPolicyPrefix + "kube-controller-access"

	// ManagedClustersWatchRoleBindingName binds kube-controllers to the managed-cluster
	// watch ClusterRole. Used by both calico-kube-controllers (in a management cluster)
	// and the enterprise es-calico-kube-controllers, so the binding stays generic here.
	ManagedClustersWatchRoleBindingName = "es-calico-kube-controllers-managed-cluster-watch"

	KubeControllerPrometheusTLSSecret = "calico-kube-controllers-metrics-tls"

	// KubeControllersHealthPort is the port the kube-controllers HealthAggregator listens on when run from the
	// combined calico binary. The legacy per-component image uses file-based health checks instead.
	KubeControllersHealthPort = 9440
)
View Source
const (
	MigrationClusterRoleName = "calico-kube-controllers-migration"
)

Variables

This section is empty.

Functions

func KubeControllersRoleCommonRules

func KubeControllersRoleCommonRules(cfg *KubeControllersConfiguration) []rbacv1.PolicyRule

func MigrationRBACComponent added in v1.42.0

func MigrationRBACComponent(migrationActive bool) render.Component

MigrationRBACComponent returns a render component that creates or deletes the migration RBAC. When migrationActive is true, kube-controllers needs broad access to both API groups to read v1 resources and write v3 resources. When false, the extra permissions are cleaned up.

func NewCalicoKubeControllers

func NewCalicoKubeControllers(cfg *KubeControllersConfiguration) render.Component

NewCalicoKubeControllers builds the calico-kube-controllers component. The base is pure OSS; a variant layers its additions on through the installation extension.

func NewCalicoKubeControllersPolicy added in v1.28.0

func NewCalicoKubeControllersPolicy(cfg *KubeControllersConfiguration, defaultDeny *v3.NetworkPolicy) render.Component

func NewKubeControllers

func NewKubeControllers(cfg *KubeControllersConfiguration) render.Component

NewKubeControllers builds a kube-controllers component from a fully-populated configuration. Callers (NewCalicoKubeControllers, the enterprise es-kube-controllers builder) fill the generic Name/Rules/EnabledControllers/ExtraEnv/NetworkPolicy fields; the component renders them with no variant branching.

Types

type CalicoComponent

type CalicoComponent interface {
	render.Component
	KubeControllersConfig() *KubeControllersConfiguration
}

The calico-kube-controllers components expose an extension point. The es-calico-kube-controllers deployment shares the underlying type but not these wrappers, so a variant never sees it.

type CalicoPolicyComponent

type CalicoPolicyComponent interface {
	render.Component
	KubeControllersPolicyConfig() *KubeControllersConfiguration
}

The calico-kube-controllers components expose an extension point. The es-calico-kube-controllers deployment shares the underlying type but not these wrappers, so a variant never sees it.

type KubeControllersConfiguration

type KubeControllersConfiguration struct {
	K8sServiceEp           k8sapi.ServiceEndpoint
	K8sServiceEpPodNetwork k8sapi.ServiceEndpoint

	Installation   *operatorv1.InstallationSpec
	Authentication *operatorv1.Authentication

	// ManagementCluster and ManagementClusterConnection are inputs for the enterprise
	// es-kube-controllers assembler. No base rendering reads them.
	ManagementCluster           *operatorv1.ManagementCluster
	ManagementClusterConnection *operatorv1.ManagementClusterConnection

	// ManagedClusterWatchBinding binds kube-controllers to the managed-cluster watch
	// ClusterRole. The assemblers set it; multi-cluster management is not a core feature.
	ManagedClusterWatchBinding bool

	ClusterDomain string
	MetricsPort   int

	// For details on why this is needed see 'Node and Installation finalizer' in the core_controller.
	Terminating bool

	// Secrets - provided by the caller. Used to generate secrets in the destination
	// namespace to be returned by the rendered. Expected that the calling code
	// take care to pass the same secret on each reconcile where possible.
	KubeControllersGatewaySecret *corev1.Secret
	TrustedBundle                certificatemanagement.TrustedBundleRO

	// TenantID is the Calico Cloud tenant. Only the enterprise assembler consumes it.
	TenantID string

	// Cloud reports whether this is a Calico Cloud install. Only the enterprise
	// es-kube-controllers assembler consumes it.
	Cloud bool

	// ImageOverrides lets a variant swap the kube-controllers image. The controller
	// wires in the operator's image overrides; nil resolves to the core image.
	ImageOverrides *imageoverride.Overrides

	// Namespace to be installed into.
	Namespace string

	// List of namespaces that are running a kube-controllers instance that need a cluster role binding.
	BindingNamespaces []string

	// Tenant object provides tenant configuration for both single and multi-tenant modes.
	// If this is nil, then we should run in zero-tenant mode.
	Tenant *operatorv1.Tenant

	// Name is the deployment / pod / container name (and the value the metrics
	// Service selects on).
	Name string
	// ConfigName is the KUBE_CONTROLLERS_CONFIG_NAME the binary reconciles.
	ConfigName string
	// RoleName / RoleBindingName / MetricsName name the ClusterRole, its binding,
	// and the Prometheus metrics Service.
	RoleName        string
	RoleBindingName string
	MetricsName     string
	// EnabledControllers is the ENABLED_CONTROLLERS list. The deployment is only
	// rendered when it is non-empty.
	EnabledControllers []string
	// Rules are the ClusterRole policy rules.
	Rules []rbacv1.PolicyRule
	// NetworkPolicy, when set, is rendered into the install namespace (and the
	// deprecated allow-tigera policy named DeprecatedNetworkPolicyName is deleted).
	NetworkPolicy               *v3.NetworkPolicy
	DeprecatedNetworkPolicyName string
	// ExtraEnv is appended to the deployment's container env.
	ExtraEnv []corev1.EnvVar
	// DisableConfigAPI sets DISABLE_KUBE_CONTROLLERS_CONFIG_API.
	DisableConfigAPI bool
}

Jump to

Keyboard shortcuts

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