README
¶
Timoni CUE Schemas
The Timoni's CUE schemas are included in the modules generated with timoni mod init.
Schemas
Kubernetes Metadata
#Annotations- Schema for validating Kubernetes annotations.Action- Values ofaction.timoni.shannotations for controlling Timoni's apply behaviour.#Labels- Schema for validating Kubernetes labels.#StdLabel- Values of Kubernetesapp.kubernetes.iolabels.#Metadata- Schema for generating Kubernetes metadata (name, namespace, annotations and labels), with automatic generation ofapp.kubernetes.io/managed-by,app.kubernetes.io/nameandapp.kubernetes.io/versionlabels.#MetaComponent- Superset of#Metadataschema for Kubernetes namespaced objects, that appends the component name tometadata.name, and with automatic generation ofapp.kubernetes.io/componentlabel.#MetaClusterComponent- Superset of#Metadataschema for Kubernetes global objects, that appends the component name tometadata.name, and with automatic generation ofapp.kubernetes.io/componentlabel.#Selector- Schema for generating Kubernetes label selectors with automatic generation ofapp.kubernetes.io/namelabel.#ObjectReference- Schema for generating Kubernetes object references based onapiVersion,kind,nameandnamespace.
Immutable ConfigMaps and Secrets
#ImmutableConfig- Schema for generating immutable Kubernetes ConfigMaps and Secrets. Themetadata.nameof the generated object is suffixed with the hash of the input data. The#Metainput accepts both#Metadataand#MetaComponentvalues.
Container Image
#Image- Schema for generating a container image and pull policy fromrepository,taganddigestinputs.#ImagePullSecret- Schema for generating a Kubernetes Secret of typekubernetes.io/dockerconfigjsonfromrepository,usernameandpasswordinputs.
Container Resource Requirements
#CPUQuantity- Schema for validating Kubernetes CPU resource requirements.#MemoryQuantity- Schema for validating Kubernetes memory resource requirements.#ResourceRequirements- Schema for generating container requests and limits fromcpuandmemoryinputs.
Security Contexts
#SecurityContextPreset- Values of thesecurityContextPresetmodule knob:hardened(default) pins the numeric UID/GID defaults,platformomits them so that an admission controller (e.g. OpenShift) can assign them.#ContainerSecurityContext- Schema for the restricted container security context: denies privilege escalation, makes the root filesystem read-only and drops all capabilities.#PodSecurityContext- Schema for generating the pod-level security context from#Presetand#User(optionally#Groupand#FSGroup) inputs. Defaults torunAsNonRootwith theRuntimeDefaultseccomp profile, and pins the numeric identity fields only under thehardenedpreset.
Pod Scheduling
#AffinityPreset- Values of theaffinity.podAntiAffinitymodule knob:soft(default) prefers spreading the workload replicas across topology domains,hardrequires it,nonedisables it.#AffinityValues- Schema for the module values of a workload'saffinitysetting: an#AffinityPresetor raw rules forpodAntiAffinity, raw rules fornodeAffinityandpodAffinity.#Affinity- Schema for generating the pod affinity rules from the#Values,#MatchLabels,#TopologyKeyand#Weightinputs; the#Enabledfield tells whether any rules are set, letting modules omit the affinity field from the pod spec.
Prometheus Monitoring
#PromDuration- Schema for validating durations in Prometheus format, e.g.30sor1m30s.#Monitor- Schema for the module values shared by the Prometheus Operator ServiceMonitor and PodMonitor resources: the enable knob, monitor metadata, per-scrape limits and target labels.#MonitorEndpoint- Schema for the module values of one monitor scrape endpoint; duration fields left empty defer to the Prometheus defaults.#MonitorValues- The canonical values block for a module'sserviceMonitororpodMonitorsetting scraping a single endpoint, unifying#Monitorand#MonitorEndpoint.#MonitorSpec- Schema for generating the ServiceMonitor/PodMonitor spec fields common to both kinds from the#Valuesinput, omitting the unset limits and target labels.#MonitorEndpointSpec- Schema for generating a ServiceMonitor endpoint or a PodMonitor podMetricsEndpoint from the#Valuesinput, omitting the unset scrape settings.
Semantic Versioning
#SemVer- Schema for validating semantic versions and enforcing a minimum major and/or minor version.
Custom Health Checks
#HealthCheck- Schema for defining a custom readiness evaluation in CUE for Kubernetes custom resources that are not kstatus-compliant.#HealthCheckForCondition- Schema for generating a health check for custom resources that signal readiness through status conditions.#HealthCheckLibrary- Ready-made health checks for popular custom resources, grouped by API family underfamilies, withallunifying every family. Currently, covers the Kubernetes Gateway API kinds from both the standard and the experimental channels underfamilies.gatewayAPI, and the Cluster API core kinds underfamilies.clusterAPI.
Timoni API
These schemas describe Timoni's own APIs and are the single source of truth
used by the timoni CLI to validate bundles, runtimes and instances.
They are exposed here so that they can be imported and reused in CUE projects.
#Bundle- Schema for validating a Timoni Bundle, i.e. the set of instances applied to a cluster.#Runtime- Schema for validating a Timoni Runtime, i.e. the target clusters and the values fetched from their resources.#RuntimeValue- Schema for a single Runtime value query.#Timoni- Schema for a module's instance, holding the instance configuration and the Kubernetes resources to apply.
Vendoring
To update a module's schemas to the latest version, run the following command from within the module root:
timoni artifact pull oci://ghcr.io/stefanprodan/timoni/schemas:latest \
--output cue.mod/pkg
To update the schemas and verify the signature with Cosign v2:
timoni artifact pull oci://ghcr.io/stefanprodan/timoni/schemas:latest \
--verify=cosign \
--certificate-identity-regexp="^https://github.com/stefanprodan/timoni.*$" \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
--output cue.mod/pkg
Documentation
¶
Overview ¶
Package schemas embeds the Timoni CUE schemas so that they can be consumed by the Go API as the single source of truth, while also being published as the importable 'timoni.sh/core/v1alpha1' package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FS embed.FS
FS embeds the published Timoni CUE schema tree (all API groups and versions under timoni.sh/). Consumers read their own subpath, e.g. "timoni.sh/core/v1alpha1/bundle.cue".
Functions ¶
This section is empty.
Types ¶
This section is empty.