Documentation
¶
Overview ¶
Package v1alpha1 holds the kubeca.effectivesecurity/v1alpha1 API: the Certificate and ClusterIssuer kinds the KubeCA operator reconciles, the constants (group, labels, annotations, condition types and reasons) that the operator and its clients share, and the generated deepcopy methods.
The package imports nothing from internal/; the controllers in internal/operator import it. CRDs are generated from the kubebuilder markers with `make manifests` into config/crd/bases and copied into the chart (examples/kubeca/crds); deepcopy with `make generate`.
+kubebuilder:object:generate=true +groupName=kubeca.effectivesecurity
Index ¶
- Constants
- Variables
- func PodCertificateName(podName, secretAnnotation string) string
- func PodSecretName(podName, secretAnnotation string) string
- type CABundleSpec
- type Certificate
- func (in *Certificate) DeepCopy() *Certificate
- func (in *Certificate) DeepCopyInto(out *Certificate)
- func (in *Certificate) DeepCopyObject() runtime.Object
- func (c *Certificate) KeyAlgorithmOrDefault() (KeyAlgorithm, int)
- func (c *Certificate) RotationPolicyOrDefault() RotationPolicy
- func (c *Certificate) SecretNameOrDefault() string
- type CertificateList
- type CertificateSpec
- type CertificateStatus
- type ClusterIssuer
- type ClusterIssuerList
- type ClusterIssuerSpec
- type ClusterIssuerStatus
- type IssuerPolicy
- type IssuerReference
- type KeyAlgorithm
- type KubernetesNames
- type PrivateKeySpec
- type ProfileStatus
- type RotationPolicy
- type SPIFFESpec
- type SecretTemplate
Constants ¶
const ( GroupName = "kubeca.effectivesecurity" Version = "v1alpha1" // KindCertificate and KindClusterIssuer are the kind names. KindCertificate = "Certificate" KindClusterIssuer = "ClusterIssuer" )
Group and version of the API; also the prefix of every label and annotation the operator reads or writes.
const ( LabelInject = GroupName + "/inject" LabelManaged = GroupName + "/managed" LabelAdopt = GroupName + "/adopt" LabelEnabled = GroupName + "/enabled" // TrueValue is the value of the boolean labels above. TrueValue = "true" )
Labels. LabelInject selects the Pods the Pod controller and the webhook handle; LabelManaged marks the Secrets the Certificate controller writes and restricts its informer cache; LabelAdopt lets an operator hand a pre-existing Secret to the controller; LabelEnabled is the conventional namespace opt-in label used by the examples' namespaceSelector.
const ( // AnnotationIssuer names the ClusterIssuer of a Pod's certificate; it is // also written on the Secret. AnnotationIssuer = GroupName + "/issuer" // AnnotationProfile selects the profile; defaults to the issuer's // defaultProfile. Also written on the Secret. AnnotationProfile = GroupName + "/profile" // AnnotationSAN adds comma-separated names to a Pod's certificate. AnnotationSAN = GroupName + "/san" // AnnotationSecretName is the Secret a Pod's certificate is written to; // default <pod-name>-tls. The webhook sets a generated name for // generateName Pods. AnnotationSecretName = GroupName + "/secret-name" // AnnotationMountPath is the webhook's mount path; default /etc/tls. AnnotationMountPath = GroupName + "/mount-path" // AnnotationContainers lists, comma-separated, the containers the // webhook mounts the Secret into; default all. AnnotationContainers = GroupName + "/containers" // AnnotationDuration and AnnotationRenewBefore override the Certificate // fields of a Pod's certificate. AnnotationDuration = GroupName + "/duration" AnnotationRenewBefore = GroupName + "/renew-before" // AnnotationRenewRequested on a Certificate triggers a renewal when its // value differs from status.lastRenewRequest. On a Secret it is the // request the stored certificate honoured, restored into the status // with AnnotationRevision when the status write after the issuance // failed. AnnotationRenewRequested = GroupName + "/renew-requested" // AnnotationCertificate on a Secret is "<namespace>/<name>" of the // owning Certificate. AnnotationCertificate = GroupName + "/certificate" // AnnotationSerial, AnnotationNotBefore, AnnotationNotAfter, // AnnotationIssuedAt and AnnotationRevision on a Secret describe the // stored certificate; issued-at is when the controller signed it (the // renewal is never scheduled sooner than a minute after it), and // AnnotationDuration (the Pod annotation key reused) the lifetime that // was requested, so a changed duration re-issues. AnnotationSerial = GroupName + "/serial" AnnotationNotBefore = GroupName + "/not-before" AnnotationNotAfter = GroupName + "/not-after" AnnotationIssuedAt = GroupName + "/issued-at" AnnotationRevision = GroupName + "/revision" )
Annotations on Pods (parameters of the Pod flow), on Certificates (manual renewal) and on Secrets (provenance of the stored certificate).
const ( // ConditionReady is True when the Secret holds a valid certificate that // matches the spec (Certificate), or when the issuer is loaded and its // CA is valid (ClusterIssuer). ConditionReady = "Ready" // ConditionIssuing is True while an issuance is in progress or being // retried; its reason is the trigger. ConditionIssuing = "Issuing" )
Condition types of Certificate and ClusterIssuer status.
const ( ReasonIssued = "Issued" ReasonPending = "Pending" ReasonIssuerNotReady = "IssuerNotReady" ReasonPolicyViolation = "PolicyViolation" ReasonIssuanceFailed = "IssuanceFailed" ReasonSecretConflict = "SecretConflict" ReasonExpired = "Expired" )
Reasons of the Ready condition of a Certificate.
const ( ReasonInitial = "Initial" ReasonRenewal = "Renewal" ReasonSpecChanged = "SpecChanged" ReasonSecretMissing = "SecretMissing" ReasonCAChanged = "CAChanged" ReasonRequested = "Requested" ReasonFailed = "Failed" )
Reasons of the Issuing condition of a Certificate: the issuance trigger while True, the outcome while False. The triggers are also the value of the `trigger` label of the kubeca_issuance_total metric.
const ( ReasonLoaded = "Loaded" ReasonIssuerNotFound = "IssuerNotFound" ReasonProfileNotFound = "ProfileNotFound" ReasonInvalidPolicy = "InvalidPolicy" ReasonCAExpiring = "CAExpiring" ReasonCAExpired = "CAExpired" )
Reasons of the Ready condition of a ClusterIssuer.
const ( EventIssued = "Issued" EventRenewed = "Renewed" EventReady = "Ready" EventCertificateCreated = "CertificateCreated" EventCertificateUpdated = "CertificateUpdated" EventInvalidPod = "InvalidPod" // EventConfigMapConflict on a ClusterIssuer: a ConfigMap named by // spec.caBundle exists in a namespace and is not managed by kubeca. EventConfigMapConflict = "ConfigMapConflict" )
Event reasons. A failure recorded in a condition is also an event with the condition reason (PolicyViolation, IssuanceFailed, SecretConflict, IssuerNotReady on Certificates; IssuerNotFound, ProfileNotFound, InvalidPolicy, CAExpiring, CAExpired on ClusterIssuers).
const ( SecretKeyCertificate = "tls.crt" SecretKeyPrivateKey = "tls.key" SecretKeyCA = "ca.crt" )
Keys of the kubernetes.io/tls Secret the Certificate controller writes: the values of corev1.TLSCertKey, corev1.TLSPrivateKeyKey and corev1.ServiceAccountRootCAKey, spelled out so that this package keeps importing k8s.io/apimachinery only (a test of the Certificate controller pins them to the corev1 constants).
const ( // DefaultMountPath is where the webhook mounts the Secret. DefaultMountPath = "/etc/tls" // DefaultSecretSuffix is appended to a Pod name for the default Secret // name of the Pod flow. DefaultSecretSuffix = "-tls" // GeneratedSecretPrefix starts the Secret names the webhook generates // for generateName Pods. GeneratedSecretPrefix = "kubeca-" // InjectedVolumeName is the name of the Secret volume the webhook adds. InjectedVolumeName = "kubeca-tls" )
Defaults of the Pod flow and the webhook.
const ( KeyAlgorithmECDSA KeyAlgorithm = "ECDSA" KeyAlgorithmRSA KeyAlgorithm = "RSA" DefaultECDSAKeySize = 256 DefaultRSAKeySize = 2048 RotationPolicyAlways RotationPolicy = "Always" RotationPolicyNever RotationPolicy = "Never" )
Key algorithms and sizes of Certificate.spec.privateKey.
Variables ¶
var ( // GroupVersion is the group and version of the kinds in this package. GroupVersion = schema.GroupVersion{Group: GroupName, Version: Version} // SchemeBuilder registers the kinds of this package with a scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the kinds of this package to a scheme; the operator // calls it on the manager's scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func PodCertificateName ¶
PodCertificateName returns the Certificate the Pod controller creates for a labeled Pod: the Pod name when the secret-name annotation is absent or the default <pod-name>-tls (the webhook sets it for named Pods), else <pod-name>-<suffix> where suffix is the last dash-separated part of the annotation (the webhook sets kubeca-<8 chars> for generateName Pods), shortened by boundedName when it would be too long. The Certificate controller recomputes it to tell the Pod's own Certificate from one that merely claims the Pod as its owner.
func PodSecretName ¶
PodSecretName returns the Secret of a labeled Pod's certificate: the secret-name annotation when set, else <pod-name>-tls (DefaultSecretSuffix), shortened by boundedName when the Pod name is close to the limit.
Types ¶
type CABundleSpec ¶
type CABundleSpec struct {
// ConfigMapName of the ConfigMap (key ca.crt) the ClusterIssuer
// controller maintains in every namespace that has a Certificate of
// this issuer.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
ConfigMapName string `json:"configMapName"`
}
CABundleSpec publishes the issuer's root bundle.
func (*CABundleSpec) DeepCopy ¶
func (in *CABundleSpec) DeepCopy() *CABundleSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CABundleSpec.
func (*CABundleSpec) DeepCopyInto ¶
func (in *CABundleSpec) DeepCopyInto(out *CABundleSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Certificate ¶
type Certificate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec CertificateSpec `json:"spec"`
Status CertificateStatus `json:"status,omitempty"`
}
Certificate describes one certificate and the Secret that holds it; the Certificate controller issues, renews and re-issues it.
+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=cert;certs +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` +kubebuilder:printcolumn:name="Secret",type=string,JSONPath=`.spec.secretName` +kubebuilder:printcolumn:name="Issuer",type=string,JSONPath=`.spec.issuerRef.name` +kubebuilder:printcolumn:name="Profile",type=string,JSONPath=`.spec.profile` +kubebuilder:printcolumn:name="Not After",type=string,JSONPath=`.status.notAfter` +kubebuilder:printcolumn:name="Renewal",type=string,JSONPath=`.status.renewalTime` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
func (*Certificate) DeepCopy ¶
func (in *Certificate) DeepCopy() *Certificate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Certificate.
func (*Certificate) DeepCopyInto ¶
func (in *Certificate) DeepCopyInto(out *Certificate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Certificate) DeepCopyObject ¶
func (in *Certificate) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Certificate) KeyAlgorithmOrDefault ¶
func (c *Certificate) KeyAlgorithmOrDefault() (KeyAlgorithm, int)
KeyAlgorithmOrDefault returns the key algorithm and size, with the defaults (ECDSA 256, RSA 2048) applied.
func (*Certificate) RotationPolicyOrDefault ¶
func (c *Certificate) RotationPolicyOrDefault() RotationPolicy
RotationPolicyOrDefault returns spec.privateKey.rotationPolicy or Always.
func (*Certificate) SecretNameOrDefault ¶
func (c *Certificate) SecretNameOrDefault() string
SecretNameOrDefault returns spec.secretName, or the Certificate name.
type CertificateList ¶
type CertificateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Certificate `json:"items"`
}
CertificateList is a list of Certificates. +kubebuilder:object:root=true
func (*CertificateList) DeepCopy ¶
func (in *CertificateList) DeepCopy() *CertificateList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateList.
func (*CertificateList) DeepCopyInto ¶
func (in *CertificateList) DeepCopyInto(out *CertificateList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CertificateList) DeepCopyObject ¶
func (in *CertificateList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CertificateSpec ¶
type CertificateSpec struct {
// IssuerRef names the ClusterIssuer that signs the certificate.
IssuerRef IssuerReference `json:"issuerRef"`
// Profile of the issuer; default the issuer's defaultProfile. It must
// be one the ClusterIssuer exposes.
Profile string `json:"profile,omitempty"`
// SecretName of the kubernetes.io/tls Secret; default metadata.name.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="secretName is immutable"
SecretName string `json:"secretName,omitempty"`
// CommonName of the subject; not added to the SAN automatically. The
// issuer policy checks it against allowedDNSNames.
// +kubebuilder:validation:MaxLength=64
CommonName string `json:"commonName,omitempty"`
// DNSNames, IPAddresses, URIs and EmailAddresses are the subject
// alternative names; validated with xpki csr.ParseSAN, duplicates
// dropped.
DNSNames []string `json:"dnsNames,omitempty"`
IPAddresses []string `json:"ipAddresses,omitempty"`
URIs []string `json:"uris,omitempty"`
EmailAddresses []string `json:"emailAddresses,omitempty"`
// KubernetesNames adds the names of Services in the namespace.
KubernetesNames *KubernetesNames `json:"kubernetesNames,omitempty"`
// Duration of the certificate; default the profile expiry. Bounded at
// issuance by the profile expiry and the issuer policy's maxDuration.
// +kubebuilder:validation:XValidation:rule="duration(self) >= duration('1m')",message="duration must be at least 1m"
Duration *metav1.Duration `json:"duration,omitempty"`
// RenewBefore is how long before notAfter the certificate is renewed;
// default a third of the duration.
// +kubebuilder:validation:XValidation:rule="duration(self) >= duration('30s')",message="renewBefore must be at least 30s"
RenewBefore *metav1.Duration `json:"renewBefore,omitempty"`
// PrivateKey parameters; default ECDSA P-256, rotated on every issuance.
PrivateKey *PrivateKeySpec `json:"privateKey,omitempty"`
// SecretTemplate adds labels and annotations to the Secret.
SecretTemplate *SecretTemplate `json:"secretTemplate,omitempty"`
}
CertificateSpec describes one certificate and the Secret that holds it. +kubebuilder:validation:XValidation:rule="(has(self.dnsNames) && size(self.dnsNames) > 0) || (has(self.ipAddresses) && size(self.ipAddresses) > 0) || (has(self.uris) && size(self.uris) > 0) || (has(self.emailAddresses) && size(self.emailAddresses) > 0) || (has(self.kubernetesNames) && has(self.kubernetesNames.services) && size(self.kubernetesNames.services) > 0)",message="at least one name is required" +kubebuilder:validation:XValidation:rule="!has(self.renewBefore) || !has(self.duration) || duration(self.renewBefore) < duration(self.duration)",message="renewBefore must be shorter than duration" +kubebuilder:validation:XValidation:rule="!has(oldSelf.secretName) || has(self.secretName)",message="secretName cannot be removed once set"
func (*CertificateSpec) DeepCopy ¶
func (in *CertificateSpec) DeepCopy() *CertificateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSpec.
func (*CertificateSpec) DeepCopyInto ¶
func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CertificateStatus ¶
type CertificateStatus struct {
// Conditions: Ready and Issuing. observedGeneration tracks
// metadata.generation.
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty"`
// NotBefore and NotAfter of the stored certificate.
NotBefore *metav1.Time `json:"notBefore,omitempty"`
NotAfter *metav1.Time `json:"notAfter,omitempty"`
// RenewalTime is notAfter − renewBefore − jitter.
RenewalTime *metav1.Time `json:"renewalTime,omitempty"`
// SerialNumber of the stored certificate, hex with colons.
SerialNumber string `json:"serialNumber,omitempty"`
// IssuerLabel and IssuerKeyID identify the xpki issuer that signed it.
IssuerLabel string `json:"issuerLabel,omitempty"`
IssuerKeyID string `json:"issuerKeyID,omitempty"`
// Revision counts the issuances; the Secret carries the same value.
Revision int64 `json:"revision,omitempty"`
// FailedAttempts since the last successful issuance, with the time of
// the last failure.
FailedAttempts int32 `json:"failedAttempts,omitempty"`
LastFailureTime *metav1.Time `json:"lastFailureTime,omitempty"`
// LastRenewRequest is the renew-requested annotation value the last
// issuance honoured.
LastRenewRequest string `json:"lastRenewRequest,omitempty"`
}
CertificateStatus is the observed state of a Certificate.
func (*CertificateStatus) DeepCopy ¶
func (in *CertificateStatus) DeepCopy() *CertificateStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateStatus.
func (*CertificateStatus) DeepCopyInto ¶
func (in *CertificateStatus) DeepCopyInto(out *CertificateStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterIssuer ¶
type ClusterIssuer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterIssuerSpec `json:"spec"`
Status ClusterIssuerStatus `json:"status,omitempty"`
}
ClusterIssuer binds an xpki issuer, loaded from the CA configuration at start-up, to a policy and publishes its CA certificate.
+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,shortName=cissuer +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` +kubebuilder:printcolumn:name="Label",type=string,JSONPath=`.spec.issuerLabel` +kubebuilder:printcolumn:name="CA Not After",type=string,JSONPath=`.status.caNotAfter` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
func (*ClusterIssuer) DeepCopy ¶
func (in *ClusterIssuer) DeepCopy() *ClusterIssuer
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIssuer.
func (*ClusterIssuer) DeepCopyInto ¶
func (in *ClusterIssuer) DeepCopyInto(out *ClusterIssuer)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterIssuer) DeepCopyObject ¶
func (in *ClusterIssuer) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterIssuer) ExposesProfile ¶
func (c *ClusterIssuer) ExposesProfile(name string) bool
ExposesProfile reports whether the ClusterIssuer exposes the profile: every profile when spec.profiles is empty, else a listed one. The profile must still be served by the xpki issuer.
func (*ClusterIssuer) TrustDomain ¶
func (c *ClusterIssuer) TrustDomain() string
TrustDomain returns spec.spiffe.trustDomain or "".
type ClusterIssuerList ¶
type ClusterIssuerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterIssuer `json:"items"`
}
ClusterIssuerList is a list of ClusterIssuers. +kubebuilder:object:root=true
func (*ClusterIssuerList) DeepCopy ¶
func (in *ClusterIssuerList) DeepCopy() *ClusterIssuerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIssuerList.
func (*ClusterIssuerList) DeepCopyInto ¶
func (in *ClusterIssuerList) DeepCopyInto(out *ClusterIssuerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterIssuerList) DeepCopyObject ¶
func (in *ClusterIssuerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterIssuerSpec ¶
type ClusterIssuerSpec struct {
// IssuerLabel is the label of the issuer in the CA configuration
// (authority.issuers[].label). Immutable.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="issuerLabel is immutable"
IssuerLabel string `json:"issuerLabel"`
// Profiles this ClusterIssuer exposes; empty exposes every profile the
// issuer serves. Unknown entries make the issuer not Ready.
Profiles []string `json:"profiles,omitempty"`
// DefaultProfile is used by Certificates and Pods that omit the profile.
DefaultProfile string `json:"defaultProfile,omitempty"`
// SPIFFE enables the SPIFFE URI of the Pod flow.
SPIFFE *SPIFFESpec `json:"spiffe,omitempty"`
// Policy for the Certificates of this issuer; nil allows everything the
// profile allows.
Policy *IssuerPolicy `json:"policy,omitempty"`
// CABundle publishes the root bundle into a ConfigMap per namespace.
CABundle *CABundleSpec `json:"caBundle,omitempty"`
}
ClusterIssuerSpec binds an xpki issuer to a policy. +kubebuilder:validation:XValidation:rule="!has(self.defaultProfile) || !has(self.profiles) || size(self.profiles) == 0 || self.defaultProfile in self.profiles",message="defaultProfile must be listed in profiles"
func (*ClusterIssuerSpec) DeepCopy ¶
func (in *ClusterIssuerSpec) DeepCopy() *ClusterIssuerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIssuerSpec.
func (*ClusterIssuerSpec) DeepCopyInto ¶
func (in *ClusterIssuerSpec) DeepCopyInto(out *ClusterIssuerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterIssuerStatus ¶
type ClusterIssuerStatus struct {
// Conditions: Ready.
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty"`
// IssuerKeyID is the subject key identifier of the issuing certificate.
IssuerKeyID string `json:"issuerKeyID,omitempty"`
// CACertificate is the issuing certificate and its chain, PEM.
CACertificate string `json:"caCertificate,omitempty"`
// RootCertificate is the root bundle, PEM (what ca.crt carries).
RootCertificate string `json:"rootCertificate,omitempty"`
// CANotAfter is the expiry of the issuing certificate.
CANotAfter *metav1.Time `json:"caNotAfter,omitempty"`
// Profiles the ClusterIssuer exposes, sorted by name.
Profiles []ProfileStatus `json:"profiles,omitempty"`
}
ClusterIssuerStatus is the observed state of a ClusterIssuer.
func (*ClusterIssuerStatus) DeepCopy ¶
func (in *ClusterIssuerStatus) DeepCopy() *ClusterIssuerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIssuerStatus.
func (*ClusterIssuerStatus) DeepCopyInto ¶
func (in *ClusterIssuerStatus) DeepCopyInto(out *ClusterIssuerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IssuerPolicy ¶
type IssuerPolicy struct {
// NamespaceSelector limits the namespaces whose Certificates may use
// this issuer; nil allows all.
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`
// MaxDuration is the upper bound of Certificate.spec.duration; the
// profile expiry bounds it as well.
// +kubebuilder:validation:XValidation:rule="duration(self) >= duration('1m')",message="maxDuration must be at least 1m"
MaxDuration *metav1.Duration `json:"maxDuration,omitempty"`
// AllowedDNSNames, AllowedURIs and AllowedEmailAddresses are RE2
// regexes a name must match; the subject common name must match
// AllowedDNSNames. ${NAMESPACE}, ${NAME}, ${SERVICE_ACCOUNT} and
// ${CLUSTER_DOMAIN} are substituted, regex-quoted, with the
// Certificate's namespace, name, the ServiceAccount of the Pod it
// belongs to (empty for a Certificate that no Pod owns) and the
// cluster domain of the operator (-cluster-domain). An absent list
// allows every name of that type; an empty list denies the type
// (pointers keep the two apart).
AllowedDNSNames *[]string `json:"allowedDNSNames,omitempty"`
AllowedURIs *[]string `json:"allowedURIs,omitempty"`
AllowedEmailAddresses *[]string `json:"allowedEmailAddresses,omitempty"`
// AllowIPAddresses permits IP SANs; default false.
AllowIPAddresses bool `json:"allowIPAddresses,omitempty"`
}
IssuerPolicy is the cluster administrator's policy for the Certificates of a ClusterIssuer; the xpki profile regexes remain the CA-side gate.
func (*IssuerPolicy) DeepCopy ¶
func (in *IssuerPolicy) DeepCopy() *IssuerPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssuerPolicy.
func (*IssuerPolicy) DeepCopyInto ¶
func (in *IssuerPolicy) DeepCopyInto(out *IssuerPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IssuerReference ¶
type IssuerReference struct {
// Name of the ClusterIssuer.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
}
IssuerReference names the ClusterIssuer of a Certificate. Kind and group are fixed in v1alpha1 (D-8).
func (*IssuerReference) DeepCopy ¶
func (in *IssuerReference) DeepCopy() *IssuerReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssuerReference.
func (*IssuerReference) DeepCopyInto ¶
func (in *IssuerReference) DeepCopyInto(out *IssuerReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KeyAlgorithm ¶
type KeyAlgorithm string
KeyAlgorithm is the private key algorithm of a Certificate. +kubebuilder:validation:Enum=ECDSA;RSA
type KubernetesNames ¶
type KubernetesNames struct {
// Services in the same namespace whose DNS names (`<svc>.<ns>.svc.<domain>`)
// are added; a missing Service is a PolicyViolation (ServiceNotFound).
// +kubebuilder:validation:items:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
Services []string `json:"services,omitempty"`
// IncludeUnqualified also adds the `<svc>.<ns>.svc` form.
IncludeUnqualified bool `json:"includeUnqualified,omitempty"`
// IncludeClusterIP also adds the Services' cluster addresses (both
// families of a dual-stack Service) as IP SANs.
IncludeClusterIP bool `json:"includeClusterIP,omitempty"`
}
KubernetesNames asks the controller to add the names of Services in the Certificate's namespace, like `kubecertinit -service-names`.
func (*KubernetesNames) DeepCopy ¶
func (in *KubernetesNames) DeepCopy() *KubernetesNames
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesNames.
func (*KubernetesNames) DeepCopyInto ¶
func (in *KubernetesNames) DeepCopyInto(out *KubernetesNames)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrivateKeySpec ¶
type PrivateKeySpec struct {
// Algorithm of the key; default ECDSA.
// +kubebuilder:default=ECDSA
Algorithm KeyAlgorithm `json:"algorithm,omitempty"`
// Size: the ECDSA curve (256, 384, 521) or the RSA modulus bits (2048,
// 3072, 4096); default 256 for ECDSA and 2048 for RSA.
// +kubebuilder:validation:Enum=256;384;521;2048;3072;4096
Size int `json:"size,omitempty"`
// RotationPolicy: Always (default) generates a new key for every
// issuance; Never reuses the key stored in the Secret.
// +kubebuilder:default=Always
RotationPolicy RotationPolicy `json:"rotationPolicy,omitempty"`
}
PrivateKeySpec describes the private key the controller generates. +kubebuilder:validation:XValidation:rule="!has(self.size) || ((!has(self.algorithm) || self.algorithm == 'ECDSA') ? self.size in [256, 384, 521] : self.size in [2048, 3072, 4096])",message="size must be 256, 384 or 521 for ECDSA and 2048, 3072 or 4096 for RSA"
func (*PrivateKeySpec) DeepCopy ¶
func (in *PrivateKeySpec) DeepCopy() *PrivateKeySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateKeySpec.
func (*PrivateKeySpec) DeepCopyInto ¶
func (in *PrivateKeySpec) DeepCopyInto(out *PrivateKeySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProfileStatus ¶
type ProfileStatus struct {
Name string `json:"name"`
Expiry metav1.Duration `json:"expiry,omitempty"`
Backdate metav1.Duration `json:"backdate,omitempty"`
Usages []string `json:"usages,omitempty"`
}
ProfileStatus describes a profile the issuer serves.
func (*ProfileStatus) DeepCopy ¶
func (in *ProfileStatus) DeepCopy() *ProfileStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProfileStatus.
func (*ProfileStatus) DeepCopyInto ¶
func (in *ProfileStatus) DeepCopyInto(out *ProfileStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RotationPolicy ¶
type RotationPolicy string
RotationPolicy says whether a renewal generates a new private key. +kubebuilder:validation:Enum=Always;Never
type SPIFFESpec ¶
type SPIFFESpec struct {
// TrustDomain of the URIs `spiffe://<trustDomain>/ns/<ns>/sa/<sa>` the
// Pod controller adds.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
TrustDomain string `json:"trustDomain"`
}
SPIFFESpec enables the SPIFFE identity of the Pod flow.
func (*SPIFFESpec) DeepCopy ¶
func (in *SPIFFESpec) DeepCopy() *SPIFFESpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SPIFFESpec.
func (*SPIFFESpec) DeepCopyInto ¶
func (in *SPIFFESpec) DeepCopyInto(out *SPIFFESpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretTemplate ¶
type SecretTemplate struct {
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
}
SecretTemplate adds labels and annotations to the Secret. Keys with the kubeca.effectivesecurity/ prefix are reserved and ignored; the others must be valid Kubernetes label and annotation keys and values, or the Certificate fails with PolicyViolation before anything is signed.
func (*SecretTemplate) DeepCopy ¶
func (in *SecretTemplate) DeepCopy() *SecretTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretTemplate.
func (*SecretTemplate) DeepCopyInto ¶
func (in *SecretTemplate) DeepCopyInto(out *SecretTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.