pod

package
v0.9.63 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package pod implements the Pod controller of the operator: for every Pod labeled kubeca.effectivesecurity/inject=true it derives the names the Pod may carry (internal/k8snames), the SPIFFE ID of its ServiceAccount when the ClusterIssuer has a trust domain, and the names of the san annotation, and creates or updates a Certificate owned by the Pod. The Certificate controller issues it into the Secret the Pod mounts; the kubelet starts the containers once the Secret exists, and the Certificate and the Secret are garbage-collected with the Pod.

The informer cache of the manager only holds labeled Pods (operator.CacheOptions), so the controller never reads other Pods.

Index

Constants

View Source
const (
	// ControllerName is the name of the controller in metrics and logs.
	ControllerName = "pod"
)

Variables

This section is empty.

Functions

func Injected

func Injected(obj client.Object) bool

Injected reports whether an object carries the inject label.

Types

type Reconciler

type Reconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
	// ClusterDomain is the suffix of the derived DNS names.
	ClusterDomain string
}

Reconciler reconciles labeled Pods into Certificates.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile creates or updates the Certificate of a labeled Pod. A Pod whose annotations are unusable gets an InvalidPod event and no retry.

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager registers the controller: it watches labeled Pods, the Certificates they own, Services (mapped to the Pods they select) and ClusterIssuers (mapped to the Pods that name them).

Jump to

Keyboard shortcuts

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