Kinds: secrets, certificates and backup
Each kind below has the same sections: Properties, Outputs, Validation and Example. Its implementation, history and tests are on the contributor page.
issuer, clusterissuer, certificate
issuer, clusterissuer, certificate are
the kind-named projections of three objects of cert-manager’s
cert-manager.io/v1 API: an Issuer, a ClusterIssuer and a Certificate.
The higher-level type tls-certificate builds the same Certificate and derives secretName
as the component name followed by -tls when it is left out; certificate keeps requiring
it. See
Higher-level types over a kind.
Properties
An Issuer and a ClusterIssuer share one spec type
(IssuerSpec), and what is said of an issuer below holds for both kinds.
Authored. The properties are the top-level json fields of the spec type, decoded strictly at every depth: an unknown key is refused wherever it sits (a solver, a DNS provider’s settings, a keystore).
issuerandclusterissuer(IssuerSpec): the five issuer types,acme,ca,vault,selfSignedandvenafi. An issuer type authored empty is in the object as written (selfSigned: {}is a complete self-signed issuer); one left out is not.certificate(CertificateSpec):secretName,issuerRef, the subject (commonName,subject,literalSubject), the subject alternative names (dnsNames,ipAddresses,uris,emailAddresses,otherNames), the lifetime (duration,renewBefore,renewBeforePercentage,renewal), the key and its use (privateKey,signatureAlgorithm,usages,encodeUsagesInRequest,isCA,nameConstraints), and what is written to the Secret (secretTemplate,keystores,additionalOutputFormats), withrevisionHistoryLimit.- A duration is carried in Go’s spelling.
duration,renewBeforeand the other durations of these types are authored as a Go duration string and nothing else, and the object carries the same duration as Go writes it:2160his emitted as2160h0m0s. - An authored
falseor0is kept where the API tells it from an unset field (encodeUsagesInRequest: false, a keystore’screate: false, a solver pod’srunAsUser: 0), and left out where the type omits a zero that means the same (isCA: false). A default cert-manager applies when it reads the object (a key size, a rotation policy) reads the same type, in which an authored0and none are one value.
Required is a field the API requires that the Go type writes whether or
not it was authored, so that the object would not show the omission: the
rule every kind follows (see the Prometheus operator’s kinds). Each
must be authored (secretName: required (…),
acme.solvers[1].dns01.webhook.groupName: required (…)); an authored empty
value is a value, and the API server’s to refuse.
- A
certificate:secretName, andissuerRefwith itsname. No default issuer is filled. Of what is authored below them: an additional output format’stype, and a keystore’screate. - An issuer has no required top-level field. Of an issuer type that is
authored:
acme.serverandacme.privateKeySecretRef;ca.secretName;vault.server,vault.pathandvault.auth, and the role or path of the authentication method that is authored;venafi.zone, and the URL, credentials or token of the platform that is authored; a DNS01 provider’s own required settings (an ACME-DNShost, an RFC 2136nameserver, a webhook solver’sgroupNameandsolverName). - Of a reference to a Secret or a ServiceAccount that is authored, on either
kind: its
name. Unauthored, the type would writename: "". - Of a renewal window of a
certificatethat is authored (renewal.windows[]): itscronand itswindowDuration(renewal.windows[0].cron: required (…)). The type leaves either out when it is empty, so the object would show the omission and the API server refuse it; an emptycronis refused as an unauthored one is. - Of an ACME HTTP01 solver, on an issuer and a clusterissuer, three fields
of the Kubernetes and Gateway API types it embeds: the
nodeSelectorTermsof a required node affinity of the solver pod, underhttp01.ingressand underhttp01.gatewayHTTPRoute(acme.solvers[0].http01.ingress.podTemplate.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms: required (…)), and thenameof a parent reference (acme.solvers[0].http01.gatewayHTTPRoute.parentRefs[0].name: required (…)). Unauthored, the type writes the terms asnull, which the API server drops before it validates, so the required field is then missing; and the name as"", which is below the CRD’s minimum length of 1. An authored empty name (name: "") is not refused here: it is a value, and the API server’s to refuse for that minimum length. An authored empty list of terms (nodeSelectorTerms: []) is not refused either: it is written as one, and the CRDs accept it. - Of a match expression that is authored in a label selector of an HTTP01
solver’s pod affinity (
acme.solvers[].http01.ingress.podTemplate.spec.affinity, and undergatewayHTTPRoute), on an issuer and a clusterissuer: itskeyandoperator. Presence only: the operator’s value and itsvaluesare left to the API server (see “A label selector’s match expressions”). - Of every other type these specs embed, Kubernetes or Gateway API, each
field the CRD requires and the type writes unauthored, as of
cert-manager’s own: under an HTTP01 solver’s pod template, the
keyandoperatorof a node selector requirement, thetopologyKeyof a pod affinity term, theweightand the term of a preferred or weighted one, a sysctl’snameandvalueand a seccomp profile’stype(…podAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey: required (the cert-manager API requires this field)). - A required field under a parent the author left out is not asked for: the
list follows what was authored. Where that parent is one the type writes
unauthored and the CRD does not require (a keystore’s
passwordSecretRef, a Route 53 solver’ssecretAccessKeySecretRef, an RFC 2136 solver’stsigSecretSecretRef, a Vault Kubernetes auth’ssecretRef), itsnameis asked for only where the parent is authored; the API server accepts the object with the parent left out.
The lists are generated from the CRDs the linked module ships, which are the ones cert-manager’s chart installs (see “Required fields a kind writes unauthored and does not refuse”): every field a CRD requires and the type writes unauthored is listed, whatever type declares it, and nothing else is; a field the kind gives no text of its own reads the generic one.
What the type writes unauthored. An empty reference, {name: ""},
where the type holds one by value and the API does not require it: a
keystore’s passwordSecretRef (so a keystore that authors password
carries both fields), vault.auth.kubernetes.secretRef, an RFC 2136
solver’s tsigSecretSecretRef and a Route 53 solver’s
secretAccessKeySecretRef. An HTTP01 solver’s podTemplate carries
metadata: {} and spec: {}, and its ingressTemplate metadata: {}.
The CRDs accept each, and a test holds every such field to its
schema: none is refused empty.
Outputs
Each is built on policyHeldKind (policyFreeKind with a policy check) and
emits that one object, named after the component unless
objectName names it; the handler adds no label, no annotation and no
default. An issuer and a certificate are emitted in the build namespace
and declare their object as namespaced. A clusterissuer is emitted with no
namespace and declares its object as cluster-scoped, so its name is claimed
in no namespace.
Labels and annotations are the labels and annotations properties. A
solver’s podTemplate.metadata is not these: it becomes the metadata of the
pod cert-manager starts to answer an HTTP01 challenge. It is held as a pod’s
is, with or without a policy: on both ways a solver answers and on every
solver, the component label’s key holds the component’s value there or the
build is refused (Issuer "web": spec.acme.solvers[0].http01.ingress.podTemplate.metadata.labels[…]: "db" is not the component label of component "web"), and a key the consumer
reserved is refused (solver pod template label "…" (spec.acme.solvers[0].http01.ingress.podTemplate.metadata.labels) may not be set); see “Component label and ownership” and “Reserved metadata keys” in
the OAM model. Launcher writes nothing there. A solver’s
ingressTemplate.metadata and the labels of its HTTPRoutes reach an
Ingress and HTTPRoutes, and are not read.
The issuer of a certificate is the author’s. issuerRef names an
issuer by name, kind and group; launcher points it at no component
and does not look for the issuer in the document. To have an issuer or
clusterissuer component sign a certificate component, name its object:
the component name, or its objectName. cert-manager reads an issuerRef
without a kind as an Issuer of the Certificate’s namespace. The Secret
secretName names is cert-manager’s to create, and the component emits
none; a Secret an issuer refers to is read in the Issuer’s namespace, and
for a ClusterIssuer in the namespace cert-manager is configured with.
Beside the certificate trait. The trait derives a Certificate for the
workload it is attached to, from a few properties and the issuer the
cluster’s certificate capability names, and names it after its
secretName. This kind is the authored object, for what the trait does not
express: the whole spec, an issuer the author chooses, a Certificate that
belongs to no workload. A component type and a trait type are two lists, so
the one name is not ambiguous in a document. The two objects are one kind:
a trait’s and a component’s given one name in one namespace are refused
(generated-object collision: Certificate.cert-manager.io "default/app-tls" is generated by both …).
Validation
No capability is required, and none gates these kinds. Launcher does
not ask whether the cluster serves cert-manager.io/v1: where cert-manager’s
CRDs are not installed the component builds, and the object is refused at
apply. Whoever may author a component may author these, a ClusterIssuer
included. A policy can keep the kinds out of a build through the object
kind policy (oam.ObjectKindPolicy). The
certificate trait still requires its
capability; the kind of the same name does not read it.
Not refused:
- every other value rule of the CRDs (enumerations, lengths, minima, and
the one rule the CRDs write as an expression: that a
venafiissuer names exactly one oftpp,cloudandngts); - the rules of cert-manager’s validating webhook, which refuses more
than the CRDs do: an issuer that configures no issuer type, or more than
one; a keystore with a
passwordbeside apasswordSecretRefthat names a Secret, or with neither (the empty reference the type writes beside an authoredpasswordis not one); a certificate that names no subject and no alternative name;subjectorcommonNamebesideliteralSubject. Launcher repeats none of them, so anissuerwith no property builds, and is refused at apply where the webhook runs.
Policy.
- An issuer’s ACME HTTP01 solver pod is held to the cpu and memory
maxima. cert-manager starts a pod to answer an HTTP01 challenge, and a
solver’s
podTemplate.spec.resourcessizes it. Its limits and requests are held to the environment policy’s cpu and memory maxima, as a container’s are, on both ways a solver answers (http01.ingress,http01.gatewayHTTPRoute) and on every solver:component "web": acme.solvers[0].http01.ingress.podTemplate.spec.resources: cpu limit "4" exceeds enforced maximum "2". Nothing else is held and no default is filled: the policy’s default requests and limits are a workload’s. A request above its limit is not refused, since cert-manager lays the authored block over its controller’s own defaults key by key, and the pair that reaches the pod is not the authored one. A solver pod template has no other field thepodkind’s refusals speak to: it names no image (the solver’s image is a flag of the cert-manager controller), no container security context, no volume and no host namespace. Its pod-levelsecurityContext,serviceAccountName,priorityClassNameandimagePullSecretsare the author’s and are held to nothing, as are itsnodeSelector,affinityandtolerations, as they are on a pod kind: the one field of a pod-level security context the policy holds there,windowsOptions.hostProcess, is not a field of this one. - A certificate’s keystore password in the object is refused under a
policy that forbids explicit secrets.
keystores.jks.passwordandkeystores.pkcs12.passwordhold the password itself, and the object is in the build’s output:component "web": keystores.jks.password: holds the keystore password in the object, and the environment policy forbids explicit secrets; name the key of a Secret created out of band in keystores.jks.passwordSecretRef instead. The message quotes nothing of the value, and an empty password is refused as any other is. A policy that allows explicit secrets, one that does not answer the question and no policy build it. No other field of a Certificate holds a secret. - No field of an issuer holds a literal secret by design, and none is
checked. A credential is a reference to a Secret: an ACME account key,
a DNS provider’s token, a Vault token or App Role secret, a platform’s
API credentials. Free JSON that could hold one is written to the object
as authored, under a policy that forbids explicit secrets too: a webhook
solver’s
config. - Hosts are not checked. A host these objects name is one cert-manager
reaches, not an artifact source, and none is held to the policy’s allowed
registries:
acme.server,vault.server, avenafiplatform’surland token endpoint, an RFC 2136nameserver, an ACME-DNShost, an AkamaiserviceConsumerDomain, and the CRL distribution points, OCSP servers and issuing certificate URLs an issuer writes into what it signs. - A nil policy checks nothing.
Not covered. Whether what is referred to exists (an issuer, a Secret and its key, a ServiceAccount, an ingress class, a Gateway), and whether cert-manager can reach what an issuer names. The object’s status is cert-manager’s and is not written.
Example
The component in pkg/cmd/kurel/testdata/issuer-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
The component in pkg/cmd/kurel/testdata/clusterissuer-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
The component in pkg/cmd/kurel/testdata/certificate-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
secretstore, clustersecretstore, externalsecret, clusterexternalsecret
secretstore, clustersecretstore, externalsecret,
clusterexternalsecret are the kind-named
projections of four objects of the External Secrets Operator, in its
external-secrets.io/v1 API: a SecretStore, a ClusterSecretStore, an
ExternalSecret and a ClusterExternalSecret.
Properties
Authored. The properties are the top-level json fields of the spec type,
decoded strictly at every depth: an unknown key is refused wherever it sits
(a provider, an authentication method, a data entry, a template).
secretstoreandclustersecretstore(SecretStoreSpec, which the two objects share):provider, with one provider under its key (aws,vault,kubernetes,webhookand the others the API lists),controller,retrySettings(maxRetries,retryInterval),refreshIntervalandconditions(namespaceSelector,namespaces,namespaceRegexes). The operator readsconditionson a ClusterSecretStore only; asecretstorethat authors them carries them.externalsecret(ExternalSecretSpec):secretStoreRef(name,kind),target(name,creationPolicy,deletionPolicy,immutable,template,manifest),refreshPolicy,refreshInterval,syncWindows(kind,windows),data(each asecretKey, aremoteRefand asourceRef) anddataFrom(each anextract, afind, arewriteand asourceRef).clusterexternalsecret(ClusterExternalSecretSpec):externalSecretSpec(the fields of anexternalsecret),externalSecretName,externalSecretMetadata(labels,annotations),namespaceSelector,namespaceSelectors,namespacesandrefreshTime.- A duration is written in the form the API type gives it:
refreshInterval: 1his emitted as1h0m0s, and so are a sync window’sdurationand aclusterexternalsecret’srefreshTime. - No default is filled. The API’s defaults (an external secret’s
refreshInterval, a target’screationPolicyanddeletionPolicy) are the API server’s to fill where the field was not authored. Thekindof asecretStoreRefhas no default in the API: unset, it stays unset in the object, and is read as a SecretStore. - No CRD default, read from its marker, replaces an authored
0orfalse, except on three store fields, where the value is refused. A default the operator applies itself is not covered. The type omits a zero inprovider.beyondtrust.server.decrypt,provider.infisical.secretsScope.expandSecretReferencesandprovider.onepasswordSDK.cache.maxSize, and the API defaults each to another value (true,true,100), so the authored value would be replaced:provider.infisical.secretsScope.expandSecretReferences: false cannot be carried by the external-secrets API types (the field is omitted when zero, so the API server would apply its default true).
Required follows the rule of the Prometheus operator’s kinds: a field the API requires that the Go type writes whether or not it was authored. Each must be authored; an authored empty value is a value, and the API server’s to refuse. A required field under a parent the author left out is not asked for: the list follows what was authored.
- A store’s
provider, and inside the provider that is authored everything the API requires of it. The list is not written by hand: it is generated from the types of the linked module (zz_generated_kind_required.go), 265 paths at this pin, over every provider the API has, with the two of a condition’snamespaceSelectorbelow.provider.vault.server,provider.aws.region,provider.aws.service,provider.webhook.urlandprovider.kubernetes.auth.serviceAccount.nameare five of them. The refusal names the path and says which of two things it is:provider.vault.server: required (the external-secrets API requires this field), and for thenameof a referenceprovider.vault.caProvider.name: required (the external-secrets API requires the name of what this refers to). - Four fields of a store the API would default, and the type always
writes. A default is applied to an absent field, and the object carries
an empty one: the API’s enumeration refuses an empty
version, and an empty mount path or a cache lifetime of zero is not what the default would have been. So each must be written where its provider is authored:provider.vault.versionandprovider.openBao.version(the API’s default isv2),provider.vault.auth.cert.path(cert) andprovider.onepasswordSDK.cache.ttl(5m). A Vault store therefore writes itsversion:provider.vault.version: required (the object always carries this field, so the external-secrets API's default v2 never applies: write the value). The four are generated into the same file, in a list of their own. - Of a match expression authored in a condition’s
namespaceSelector: itskeyandoperator. Presence only: the operator’s value and itsvaluesare left to the API server (see “A label selector’s match expressions”). - An
externalsecrethas no required top-level field. Of what is authored: adataentry’ssecretKey,remoteRefand itskey; thekeyof anextract; thesourceandtargetof arewrite’sregexpand thetemplateof itstransform; thekindandnameof ageneratorRef; ofsyncWindowsitskindandwindows, and a window’sscheduleandduration; of atarget.manifestitsapiVersionandkind; of a ConfigMap or Secret a template is read from (target.template.templateFrom[]) itsname, itsitemsand an item’skey. 23 paths: 21 generated, and thekindandnameof adataentry’sgeneratorRef, which the generator does not reach (the kind refuses thatgeneratorRefwherever it is authored) and the kind holds beside them. - A
clusterexternalsecret:externalSecretSpec, and under it everything anexternalsecretrequires; and thekeyandoperatorof a match expression authored innamespaceSelectoror in an entry ofnamespaceSelectors, presence only. 28 paths, 26 of them generated. - The published schema marks the two top-level ones as required:
providerof asecretstoreand of aclustersecretstore, andexternalSecretSpecof aclusterexternalsecret. That refuses no component that built before, since the kind refused each without it already.
The lists are derived from the source of the linked module, which ships no
CRD: the markers its CRDs are generated from are read from the Go files. A
field counts as required where its json tag has no omitempty and it
carries no optional marker, and as written unauthored where the Go type
encodes it when it is unset; a Kubernetes type the specs embed is read by
the same rule on the linked source, whatever type declares the field (see
“Required fields a kind writes unauthored and does not refuse”).
The texts are the ones the
kinds held by hand before the lists were generated, byte for byte.
What the type writes unauthored. An empty block, {}, where the type
holds one by value and the API does not require it: an external secret’s
secretStoreRef and target, a clusterexternalsecret’s
externalSecretMetadata, an AWS provider’s auth and a Vault provider’s
tls, among others. The API accepts each.
Outputs
Each emits that one object,
named after the component unless objectName names it; the handler adds no
label, no annotation and no default. A secretstore and an externalsecret
are built in the build namespace. A clustersecretstore and a
clusterexternalsecret are cluster-scoped: the object carries no
namespace, whatever namespace the application is built for, and its name is
claimed cluster-wide. Nothing else is emitted: no Secret, ServiceAccount or
generator a store or an external secret names, no store an external secret
reads from, and not the ExternalSecrets a ClusterExternalSecret has the
operator create.
The store of an external secret is the author’s. secretStoreRef names
a store by name and kind; launcher points it at no component, fills
none from the cluster’s capability and does not look for the store in the
document. To have a secretstore or clustersecretstore component serve
an externalsecret component, name its object: the component name, or its
objectName. The API reads a secretStoreRef without a kind as a
SecretStore of the ExternalSecret’s namespace. The Secret target names is
the operator’s to create, and the component emits none.
Labels and annotations are the labels and annotations properties.
The object also carries the component label, whose value is the component’s
(see “Component label and ownership” in the OAM model). The labels of the
ExternalSecrets a ClusterExternalSecret creates are its
externalSecretMetadata, and those of the Secret an external secret writes
its target.template.metadata: the operator applies both, and launcher adds
nothing to either.
Beside the external-secret trait. The trait derives an ExternalSecret
for the workload it is attached to, from a few properties and a store it
names itself or takes from the cluster’s external-secret capability, names
it after its secretName, and mounts or injects the Secret into the
workload. The externalsecret kind is the authored object, for what the
trait does not express: the whole spec, and an ExternalSecret that belongs
to no workload. The two type names differ (external-secret,
externalsecret). The two objects are one kind: a trait’s and a
component’s given one name in one namespace are refused (generated-object collision: ExternalSecret.external-secrets.io "default/app-credentials" is generated by both …).
Validation
No capability is required, and none gates these kinds. Launcher does
not ask whether the cluster runs the operator: where the CRDs are not
installed the component builds, and the object is refused at apply. The
cluster’s external-secret capability is the trait’s, and these kinds do
not read it. Whoever may author a component may author these, a store that
every namespace reads from and an external secret created in every selected
namespace included. A policy can keep the kinds out of a build through the
object kind policy (oam.ObjectKindPolicy).
The API’s count and expression rules. Checked:
- a store configures exactly one provider (
provider: configures no provider; the API takes exactly one;provider: configures 2 providers (aws, vault); the API takes exactly one). A provider key written asnullconfigures nothing, as on the API server; - a generator is not named as the source of one key of
data. The API takes exactly one ofstoreRefandgeneratorRefin thatsourceRef, and the type writesstoreRefwhether or not it was authored (data[0].sourceRef.generatorRef: cannot be carried: the API takes exactly one of storeRef and generatorRef here, and the object always carries a storeRef; read from a generator with dataFrom[].sourceRef.generatorRef). A source ofdataFromtakes a generator. On aclusterexternalsecretboth paths are underexternalSecretSpec.
Not checked, and the API server’s to refuse:
- the count rule on ten other types, each “exactly one of these fields”: a
rewrite, thesourceRefof adataFromentry, and eight blocks of single providers (an authentication method, a reference, how a Yandex provider fetches an entry). The minimum of one on adataentry’ssourceRefis met by thestoreRefthe object always carries; - the six counts over named fields, on three providers:
openBao(at most one ofcaBundleandcaProvider; exactly one authentication method underauth; exactly one ofroleIdandroleRefon an app role; exactly one ofserviceAccountRefandsecretRefon its Kubernetes authentication),onepasswordSDK(at most one ofvaultandenvironment) andcrd(at most one ofauthandauthRef). The type omits each of those fields when unauthored, so the object carries what was authored and no more; - the thirteen rules written as expressions, each on one provider: Barbican
(four), Pulumi (two), Secret Server (two), AWS,
crd, Doppler, GitHub and Nebius; - every other value rule of the API: enumerations, patterns, lengths and minima;
- the rules of the operator’s validating webhook, which refuses more
than the CRDs do: an external secret with neither
datanordataFrom, twodataentries with onesecretKey, adeletionPolicyitscreationPolicydoes not allow, a template of a bootstrap-token Secret or of a service-account-token Secret that names its service account, adataFromentry that sets none or several of its sources; a store whosenamespaceRegexesdo not compile, whoserefreshIntervalis no duration, or whose provider refuses its own configuration. Launcher repeats none of them, so anexternalsecretwith no property builds, and is refused at apply where the webhook runs.
Policy.
- A credential written into a store is refused under a policy that
forbids explicit secrets. A few providers take a credential as a
valuebeside thesecretRefthat names a Secret holding it, and the object is in the build’s output:provider.delinea.clientSecret.value: holds the credential in the object, and the environment policy forbids explicit secrets; name the key of a Secret created out of band in provider.delinea.clientSecret.secretRef instead. The message quotes nothing of the value. Refused:provider.beyondtrust.auth.apiKey,.auth.certificateKeyand.auth.clientSecret,provider.delinea.clientSecret,provider.scaleway.secretKey,provider.secretserver.passwordand.token. A policy that allows explicit secrets, one that does not answer the question and no policy build it. - The same union holds an identifier on seven other fields, which are not
refused:
provider.barbican.auth.applicationCredentialIDand.auth.username,provider.beyondtrust.auth.certificateand.auth.clientId,provider.delinea.clientId,provider.scaleway.accessKeyandprovider.secretserver.username. - The data of the
fakeprovider is refused under the same policy.provider.fake.datais nothing but the values the store serves, and the provider has no reference to a Secret. The API also requires the field, and the two refusals come in this order: afakeprovider with nodatais refused as a required field, under every policy and under none; one with entries is refused as an explicit secret under a policy that forbids them;data: []passes both. - Text in which a reference and a literal look alike is not checked, on
any of the four and under any policy: a header or the body of a
webhookprovider’s request, a header of avaultprovider, the user part of a provider’s URL, and the template of the Secret an external secret writes (target.template.data, atemplateFromliteral, the template’s metadata). A secret written there is in the build’s output. - No field of an external secret is a credential, and one field is
checked:
target.manifest. Anexternalsecretand aclusterexternalsecretname what is read and where it is written, andApplyPolicyfills nothing on either. Withtarget.manifest(anapiVersionand akind) the operator writes an object of that kind instead of a Secret, from template text it renders in the cluster. TheapiVersionhas to be an API version, a version (v1) or a group and a version (apps/v1), each part a name the API can have: the version a DNS-1035 label and the group a DNS-1123 subdomain, the bounds a CustomResourceDefinition’s group and version names have. The core group is written without a slash, so/v1,apps/andApps/v1are none. The API bounds the field by a minimum length only, nothing can write an object of a version that is none, and where the value does not split into the two its kind would read as no kind at all to the check below. One that is none is refused under every policy, and not as a policy refusal (target.manifest.apiVersion: "apps/v1/x" is no API version: want a version (v1) or a group and a version (apps/v1)). That object gets no more than the same policy gives the same kind onpassthrough. Whatpassthroughwould read cannot be read at build, so a kind the rendered-object check reads anything from is refused, in any version and whatever the policy’s own limits: a Pod, PodTemplate, ReplicationController, Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob, PersistentVolumeClaim or PersistentVolume of the built-in groups, and a HorizontalPodAutoscaler:target.manifest: the operator would write a Deployment, a kind the environment policy checks, and what the object would hold is not known at build, so it cannot be checked against environment policy(on aclusterexternalsecretthe path isexternalSecretSpec.target.manifest). The transform appliesNoopPolicywhen no policy is passed, so this holds then too. This is stricter thanpassthroughwherever the policy would pass the object it read: a claim under a policy with no storage maximum, an autoscaler under one with no replica maximum, a workload within every limit.passthroughreads the object and finds nothing to refuse; here the content is not known at build, so there is nothing to read. A coreSecretnamed there is refused under a policy that forbids explicit secrets and passes under any other, as onpassthrough. Any other kind (a ConfigMap, a custom resource) passes as it would onpassthrough, and whether the operator writes it at all is the cluster’s: the operator’s generic-target setting and its RBAC. Thetargetpath of atemplateFromentry needs no check of its own: it places text inside the objecttarget.manifestnames. - Hosts are not checked. A host these objects name is one the operator
reaches, not an artifact source, and none is held to the policy’s allowed
registries: the server, URL, host or endpoint of every provider
(
provider.vault.server,provider.webhook.url,provider.kubernetes.server.url,provider.azurekv.vaultUrl,provider.conjur.url,provider.onepassword.connectHostand the others). - A nil policy checks nothing.
Not covered. The operator’s other APIs: its generators and its PushSecret. Whether what is referred to exists (a store, a Secret and its key, a ServiceAccount, a ConfigMap, a generator, a namespace), and whether the operator can reach what a store names. The objects’ status is the operator’s and is not written.
Example
The component in pkg/cmd/kurel/testdata/secretstore-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
The component in pkg/cmd/kurel/testdata/clustersecretstore-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
The component in pkg/cmd/kurel/testdata/externalsecret-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
The component in pkg/cmd/kurel/testdata/clusterexternalsecret-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
replicationsource, replicationdestination
replicationsource, replicationdestination
are the kind-named projections of the two objects of VolSync’s
volsync.backube/v1alpha1 API: a ReplicationSource, which copies a volume
out, and a ReplicationDestination, which receives one.
Properties
The two share their movers but for Syncthing, and what is said of a mover below holds for both kinds.
Authored. The properties are the top-level json fields of the spec type, decoded strictly at every depth: an unknown key is refused wherever it sits (a mover, its security context, a volume mounted into it).
replicationsource(ReplicationSourceSpec):sourcePVC, the claim to copy;trigger(schedule, a cron expression, ormanual); the moversrsync,rsyncTLS,rclone,resticandsyncthing;external, a provider outside VolSync with itsparameters; andpaused.replicationdestination(ReplicationDestinationSpec):trigger, the moversrsync,rsyncTLS,rcloneandrestic,externalandpaused. A destination has no Syncthing mover and names no source claim:syncthingandsourcePVCare refused there as unknown keys.rsync(rsync over SSH) has its own, shorter type: it takesmoverResources,moverServiceAccountandmoverPodLabels, and has nomoverSecurityContext,moverAffinityormoverVolumes, which are refused under it as unknown keys.- A mover authored empty is in the object, empty but for what the type writes unauthored (below); one left out is not.
- An authored
falseor0is kept where the API tells it from an unset field (restic.retain.monthly: 0, a destination’srestic.previous: 0, a Syncthing peer’sintroducer: false,moverSecurityContext.runAsUser: 0), and left out where the type omits a zero (paused: false). VolSync’s CRDs default no field underspec, so no authored zero is replaced by a CRD default.
The kinds’ required lists are generated (see “Required fields a kind writes unauthored and does not refuse”): every field the API requires that the Go type writes whether or not it was authored is refused when unauthored, each where its parent is authored, the fields of the Kubernetes types the specs embed included. Neither kind has one at the top level. Among them are the fields the kinds refused before, each with its text:
- Of a volume mounted into a mover (
moverVolumes, onrsyncTLS,rclone,resticandsyncthing):mountPathandvolumeSource(restic.moverVolumes[0].volumeSource: required (…)). - Of a Syncthing peer:
address,IDandintroducer. No default is filled forintroducer: an authoredfalseis a value. - Of a mover’s affinity that authors a required node affinity
(
moverAffinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution): itsnodeSelectorTerms, which the Kubernetes type would write asnullwhere the CRD requires them. - Of a match expression that is authored in a label selector of a mover’s
pod affinity or anti-affinity (
moverAffinity, onrsyncTLS,rclone,resticandsyncthing):keyandoperator. Presence only: the operator’s value and itsvaluesare left to the API server (see “A label selector’s match expressions”). - A required field under a parent the author left out is not asked for: the list follows what was authored.
And, refused since go-kure/launcher#883 (breaking for a document that
leaves one out under an authored parent): the required fields of the
Kubernetes types the specs embed, on every mover that holds them (rsync
included, for its moverResources):
- in a mover’s affinity: the
keyandoperatorof a node selector requirement and of a node field selector, a preferred term’sweightand itspreferenceorpodAffinityTerm, and a pod affinity term’stopologyKey; - in
moverSecurityContext: a seccomp or AppArmor profile’stype, a sysctl’snameandvalue; - in
moverResources: a resource claim’sname; - in a mounted volume source: an NFS volume’s
serverandpath, a claim’sclaimName, and thekeyandpathof a mounted Secret’s item.
The lists (192 paths for a source, 142 for a destination) are derived from the CRDs the linked module ships. No parent is refused here that the API does not require.
What the type writes unauthored. customCA: {} on an authored rclone
or restic mover, which holds it by value. The CRDs accept it empty.
Outputs
Each is built on policyHeldKind (policyFreeKind with a policy check) and
emits that one object in the build namespace, named after the component
unless objectName names it, and declares it as namespaced; the handler
adds no label, no annotation and no default.
Beside the volsync trait. The trait derives a ReplicationSource for a
claim of the workload it is attached to, a Restic backup on a schedule,
and names it <sourcePVC>-backup. The replicationsource kind is the
authored object, for what the trait does not express: the whole spec, any
mover, a source that belongs to no workload. With its restore option the
trait also derives a ReplicationDestination, a Restic restore from the same
repository Secret that fills a new claim through its dataSourceRef, and
names it <sourcePVC>-restore; the replicationdestination kind is the
authored object for everything else (the whole spec, any mover, a
destination that belongs to no workload). Each trait object and the
matching kind component’s are one kind: given one name in one namespace they
are refused with both named (name collision: ReplicationSource.volsync.backube "default/data-backup" is named by …, and the same for a
ReplicationDestination named data-restore). The trait’s restore is
described under “The volsync trait’s restore” in the trait handlers
reference.
Labels and annotations are the labels and annotations properties. A
mover’s moverPodLabels are not these: they are labels the operator adds to
the mover pods. They are held as a pod’s labels are: the component label’s
key holds the component’s value there or the build is refused, and a key the
consumer reserved is refused (mover pod label "…" may not be set); see
“Component label and ownership” and “Reserved metadata keys” in the OAM
model. Launcher writes nothing there. A destination’s serviceAnnotations
reach a Service and are not read.
Validation
No capability is required, and none gates these kinds. Launcher does
not ask whether the cluster serves volsync.backube/v1alpha1: where
VolSync’s CRDs are not installed the component builds, and the object is
refused at apply. A policy can keep the kinds out of a build through the
object kind policy (oam.ObjectKindPolicy). The
kinds read nothing of the cluster
profile; the volsync trait still takes its class defaults from it.
Not refused:
- a required field the type omits when it is not authored: the object shows the omission, and the API server refuses it;
- every other value rule of the CRDs (enumerations, patterns, minima).
Two fields the linked Kubernetes type holds and the CRDs do not are
refused when authored: <mover>.moverVolumes[].volumeSource.secret.defaultUser
and <mover>.moverVolumes[].volumeSource.secret.items[].user, an authored
0 included (rclone.moverVolumes[0].volumeSource.secret.defaultUser: no field of the volsync.backube/v1alpha1 API: its CRD has no such property).
The linked Kubernetes API is newer than the one VolSync’s CRDs were
generated from: the Go type of a mounted Secret has the two fields, the
strict decode reads the Go type, and the CRDs have no property for either.
The CRDs declare no expression rule (x-kubernetes-validations), so
the kinds check none.
Policy.
- An authored capacity is held to the storage maximum. A mover’s
capacity(onrsync,rsyncTLS,rcloneandrestic) sizes a volume the operator provisions: on a source the point-in-time image of the volume, on a destination the volume the data is received into.restic.cacheCapacitysizes Restic’s metadata cache volume and, on a source,syncthing.configCapacitySyncthing’s configuration volume. Each is held to the environment policy’s storage maximum:component "web": restic.capacity "20Gi" exceeds enforced maximum "10Gi". A capacity the author left out is the operator’s to choose and is not held; the policy’s default storage size is not filled. - A mover’s cpu and memory are held to the maxima. The limits and
requests of
moverResourcesare held to the policy’s cpu and memory maxima, as a container’s are, on every mover:component "web": rsync.moverResources: cpu limit "4" exceeds enforced maximum "2". No default is filled: the policy’s default requests and limits are a workload’s. A request above its limit is not refused here. - A mover’s
hostProcessswitch is refused unless the policy allows privileged workloads.moverSecurityContext.windowsOptions.hostProcess: trueruns the mover’s containers as Windows HostProcess containers:component "web": restic.moverSecurityContext.windowsOptions.hostProcess is not allowed by environment policy. An authoredfalsebuilds. With no policy passed it is refused too, sinceNoopPolicyallows nothing privileged. - The
rsyncmover is held to the policy’s container capabilities. Authoring the rsync-over-SSH mover is itself a choice of privilege: the linked operator version (VolSync v0.16.0) runs its container as root (runAsUser: 0), not privileged, with every capability dropped and seven added (AUDIT_WRITE,CHOWN,DAC_OVERRIDE,FOWNER,SETGID,SETUID,SYS_CHROOT), on a source and on a destination alike, and its builder does not take the namespace’s answer on privileged movers. An authoredrsyncmover, whatever it holds, is therefore held to the policy’s allowed and forbidden container capabilities for those seven, as a container that adds them is on a pod kind:component "web": rsync: the mover's container as VolSync v0.16.0 writes it: securityContext.capabilities.add: "SYS_CHROOT" is forbidden by environment policy. A policy that sets neither list, and no policy, build it; allowing privileged workloads does not lift a forbidden capability, as it does not on a pod kind. Two limits. The seven are what the linked operator version writes (internal/controller/mover/rsync/mover.goin its module): a cluster that runs another version of the operator may add other capabilities, and the kind does not know.TestVolsyncKinds_RsyncCapabilitiesreads that literal and holds the non-test Go source of the two packages the container is built in (internal/controller/mover/rsyncandinternal/controller/utils) to a stated digest: a dependency bump that changes either package fails, whatever the change, until a person has re-read the mover and restated the digest. The test cannot check that the re-reading was done; a bump that touches either package needs it even when the container is untouched; and the module’s other packages and the functions of other modules that the mover calls are outside the digest. And that the container runs as root is stated here, not held: the policy has no dimension for it. - Not held: the rest of
moverSecurityContext. It is a pod security context, and of it onlywindowsOptions.hostProcessis held: the user and groups the mover runs as, its sysctls and its SELinux and seccomp settings are written as authored, since the environment policy has no dimension for them. The service account the mover runs under (moverServiceAccount, on every mover) is an identity carried as authored. Nor are held a mover’s affinity; the volumes mounted into it (moverVolumes: a Secret, a claim or an NFS export; the type holds no host path); the type of the Service a mover is reached through (serviceType); and whether anrsyncTLS,rclone,resticorsyncthingmover runs with elevated permissions, which is no field of the object: an administrator sets it with an annotation on the namespace (volsync.backube/privileged-movers), which the linked operator’s controllers read and hand to the builder of each of those four movers. Thersyncmover’s builder drops that answer (above). - Hosts are not checked. A host these objects name is one the mover
reaches, not an artifact source, and none is held to the policy’s allowed
registries:
rsync.address,rsyncTLS.address, a Syncthing peer’saddress, and theserverof an NFS export amongmoverVolumes. - No field holds a literal secret by design, and none is checked. A
credential is the name of a Secret (
restic.repository,rclone.rcloneConfig,rsync.sshKeys,rsyncTLS.keySecret). Theparametersof anexternalprovider are a map of strings the provider reads: they are written as authored and not checked, under a policy that forbids explicit secrets too.
The operator’s own rule is not repeated. When it reconciles, VolSync
refuses an object that configures no replication method or more than one
(a replication method must be specified, only one replication method can be supplied). Launcher does not: such a component builds, and the
rule stays the operator’s.
Not covered. Whether what is referred to exists (the claim to copy, a Secret, a storage or snapshot class, a ServiceAccount), and whether the mover can reach what the object names. The object’s status is the operator’s and is not written.
Example
The component in pkg/cmd/kurel/testdata/replicationsource-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.
The component in pkg/cmd/kurel/testdata/replicationdestination-component/app.yaml,
built against the cluster.yaml beside it, gives the expected.yaml beside it.
The fixture test compares the two.