Component

API reference for the Component custom resource

Overview

The Component custom resource is the primary API for managing Kubernetes components with component-operator. It defines a set of Kubernetes resources (deployments, services, RBAC, etc.) that are managed as a cohesive unit.

API Version

core.cs.sap.com/v1alpha1

Kind

Component

Spec

The ComponentSpec defines the desired state of a Component.

Source Reference

FieldTypeRequiredDescription
sourceRefSourceReferenceYesReference to the source containing the manifest templates
revisionstringNoPin component to a specific source revision
digeststringNoPin component to a specific source digest
pathstringNoSubfolder within the source (default: root)

Placement and Targeting

FieldTypeRequiredDescription
namespacestringNoTarget namespace for deployment (default: component’s namespace)
namestringNoTarget name for deployment (default: component’s name)
serviceAccountNamestringNoService account to impersonate during reconciliation
kubeConfigKubeConfigSpecNoKubeConfig for deploying to remote cluster

Templating and Values

FieldTypeRequiredDescription
valuesJSONNoInline values for templating
valuesFrom[]SecretKeyReferenceNoSecret references containing values
decryptionDecryptionNoDecryption settings for encrypted manifests
postBuildPostBuildNoPost-build variable substitution and patches

Reconciliation Control

FieldTypeRequiredDescription
suspendbooleanNoSuspend reconciliation (default: false)
requeueIntervaldurationNoPeriod for re-reconciliation after success (default: 10m)
retryIntervaldurationNoPeriod for re-reconciliation after retriable error
timeoutdurationNoHow long dependent objects have to become ready
stickybooleanNoStick to source revision until ready or timeout
reapplyIntervaldurationNoForce reapply interval (default: 60m)

Policies

FieldTypeRequiredDescription
adoptionPolicystringNoHow to handle existing objects (IfUnowned, Never, Always; default: IfUnowned)
updatePolicystringNoHow to update objects (Replace, Recreate, SsaMerge, SsaOverride; default: SsaOverride)
deletePolicystringNoWhat happens on deletion (Delete, Orphan; default: Delete)
missingNamespacesPolicystringNoAuto-create missing namespaces (Create, DoNotCreate; default: Create)

Advanced Configuration

FieldTypeRequiredDescription
dependencies[]DependencyNoDependencies to other components
additionalManagedTypes[]TypeInfoNoAdditional CRD types managed by this component

SourceReference

Defines the source of manifest templates. Exactly one source type must be provided.

FieldTypeDescription
blueprintBlueprintReferenceReference to in-cluster Blueprint
httpRepositoryHttpRepositoryHTTP-accessible repository
fluxGitRepositoryFluxGitRepositoryReferenceFlux GitRepository reference
fluxOciRepositoryFluxOciRepositoryReferenceFlux OCIRepository reference
fluxBucketFluxBucketReferenceFlux Bucket reference
fluxHelmChartFluxHelmChartReferenceFlux HelmChart reference

BlueprintReference

FieldTypeRequiredDescription
namespacestringNoNamespace of the Blueprint (default: component’s namespace)
namestringYesName of the Blueprint

HttpRepository

FieldTypeRequiredDescription
urlstringYesURL of the source artifact
digestHeaderstringNoHeader containing digest (default: ETag)
revisionHeaderstringNoHeader containing revision (default: digestHeader)

FluxGitRepositoryReference

FieldTypeRequiredDescription
namespacestringNoNamespace (default: component’s namespace)
namestringYesName

FluxOciRepositoryReference

FieldTypeRequiredDescription
namespacestringNoNamespace (default: component’s namespace)
namestringYesName

FluxBucketReference

FieldTypeRequiredDescription
namespacestringNoNamespace (default: component’s namespace)
namestringYesName

FluxHelmChartReference

FieldTypeRequiredDescription
namespacestringNoNamespace (default: component’s namespace)
namestringYesName

KubeConfigSpec

Reference to a kubeconfig stored in a Secret.

FieldTypeRequiredDescription
secretRefSecretKeyReferenceYesSecret containing kubeconfig

Decryption

Settings for decrypting encrypted manifests using SOPS.

FieldTypeRequiredDescription
providerstringNoDecryption provider (default: sops)
secretRefSecretKeyReferenceYesSecret containing provider configuration

PostBuild

Post-build variable substitution and transformations.

FieldTypeRequiredDescription
substitutemap[string]stringNoInline variable substitutions
substituteFrom[]SecretKeyReferenceNoSecrets containing substitution variables
patches[]KustomizePatchNoKustomize patches to apply
images[]KustomizeImageNoKustomize image replacements

Dependency

Reference to another Component that must be ready before this component.

FieldTypeRequiredDescription
namespacestringNoNamespace of dependency (default: component’s namespace)
namestringYesName of dependency component

TypeInfo

Represents a Kubernetes type for additional managed resources.

FieldTypeRequiredDescription
groupstringYesAPI group (use * for wildcard or *.<suffix> for pattern matching)
kindstringYesAPI kind (use * for wildcard)

SecretKeyReference

Reference to a Secret and optional key.

FieldTypeRequiredDescription
namestringYesSecret name
keystringNoSecret key (default: tries value, value.yaml, value.yml)

Status

The ComponentStatus defines the observed state of a Component.

FieldTypeDescription
observedGenerationint64Last observed generation
appliedGenerationint64Generation that was successfully applied
lastObservedAtmetav1.TimeTimestamp of last observation
lastAppliedAtmetav1.TimeTimestamp of last successful application
processingDigeststringDigest currently being processed
processingSincemetav1.TimeTimestamp when processing started
lastProcessingDigeststringDigest of last processing attempt
conditions[]ConditionStandard Kubernetes conditions
stateStateComponent state
inventory[]InventoryItemList of managed resources
sourceRefSourceReferenceStatusCurrent source reference state
lastAttemptedDigeststringDigest of last reconciliation attempt
lastAttemptedRevisionstringRevision of last reconciliation attempt
lastAppliedDigeststringDigest of last successful application
lastAppliedRevisionstringRevision of last successful application

Condition

FieldTypeDescription
typestringCondition type (e.g., Ready)
statusstringCondition status (True, False, Unknown)
lastTransitionTimemetav1.TimeLast time the condition transitioned
reasonstringMachine-readable reason for the condition
messagestringHuman-readable message

State

Component state can be one of:

  • Ready - Component is ready
  • Pending - Component is pending (e.g., suspended)
  • Processing - Component is being processed
  • DeletionPending - Component deletion is pending
  • Deleting - Component is being deleted
  • Error - Component encountered an error

SourceReferenceStatus

FieldTypeDescription
artifactArtifactSource artifact information
digeststringComputed digest of source reference

Artifact

FieldTypeDescription
urlstringURL of the artifact
digeststringDigest of the artifact
revisionstringRevision of the artifact