issuer

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: 31 Imported by: 0

Documentation

Overview

Package issuer implements the ClusterIssuer controller: it resolves spec.issuerLabel in the running xpki Authority, checks the exposed profiles and the policy, publishes the CA certificate, the root bundle, the subject key id and the profiles in the status, flags an expiring or expired CA, and writes the root bundle into the ConfigMap named by spec.caBundle in every namespace that holds a Certificate of the issuer.

The Authority is loaded once at start-up, so a ClusterIssuer that is not Ready because of IssuerNotFound stays so until kubeca restarts with a configuration that serves the label.

Index

Constants

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

Variables

View Source
var IssuerRefChanged = predicate.Funcs{
	UpdateFunc: func(e event.UpdateEvent) bool {
		before, ok := e.ObjectOld.(*v1alpha1.Certificate)
		after, ok2 := e.ObjectNew.(*v1alpha1.Certificate)
		return ok && ok2 && before.Spec.IssuerRef.Name != after.Spec.IssuerRef.Name
	},
}

IssuerRefChanged passes the creation and deletion of a Certificate and the updates that change spec.issuerRef.name, the only updates that change the namespaces an issuer publishes its CA bundle into.

Functions

func Backdate

func Backdate(profile *authority.CertProfile) time.Duration

Backdate returns the profile backdate, or xpki's 5 minute default.

func RootPEM

func RootPEM(ca *authority.Authority, issuer *authority.Issuer) string

RootPEM returns the root bundle of an issuer, PEM with a trailing newline: the root of the issuer's chain, or the Authority's configured root bundle when the chain has none.

Types

type Reconciler

type Reconciler struct {
	client.Client
	// APIReader reads ConfigMaps the cache does not hold (not labeled
	// managed=true) before creating one.
	APIReader client.Reader
	Scheme    *runtime.Scheme
	Authority *authority.Authority
	Recorder  record.EventRecorder
	// Clock is the time source; tests inject a fake.
	Clock clock.Clock
}

Reconciler reconciles ClusterIssuers.

func (*Reconciler) Reconcile

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

Reconcile evaluates the ClusterIssuer, patches its status when it changed and maintains the CA bundle ConfigMaps: written while the issuer is Ready, pruned whatever its state. Only API errors are returned.

func (*Reconciler) SetupWithManager

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

SetupWithManager registers the controller: it watches ClusterIssuers and, for the CA bundle ConfigMaps, the creation and deletion of Certificates and the updates that move one to another issuer (IssuerRefChanged; the map handler enqueues the issuers of the old and the new object).

Jump to

Keyboard shortcuts

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