Documentation ¶
Overview ¶
Package v1 file doc.go required for the doc generator to register this as an API
+groupName=kubecfg.io
Package v1 contains API Schema definitions for the apps v1 API group +kubebuilder:object:generate=true +groupName=kubecfg.io
Index ¶
- Constants
- Variables
- type CrossNamespaceSourceReference
- func (in *CrossNamespaceSourceReference) DeepCopy() *CrossNamespaceSourceReference
- func (in *CrossNamespaceSourceReference) DeepCopyInto(out *CrossNamespaceSourceReference)
- func (sref *CrossNamespaceSourceReference) GetSource(ctx context.Context, c client.Client) (sourcev1.Source, error)
- func (sref *CrossNamespaceSourceReference) String() string
- type Konfiguration
- func (in *Konfiguration) DeepCopy() *Konfiguration
- func (in *Konfiguration) DeepCopyInto(out *Konfiguration)
- func (in *Konfiguration) DeepCopyObject() runtime.Object
- func (k *Konfiguration) GCEnabled() bool
- func (k Konfiguration) GetDependsOn() (types.NamespacedName, []dependency.CrossNamespaceDependencyReference)
- func (k *Konfiguration) GetDiffStrategy() string
- func (k *Konfiguration) GetHealthChecks() []meta.NamespacedObjectKindReference
- func (k *Konfiguration) GetInterval() time.Duration
- func (k *Konfiguration) GetJsonnetPaths() []string
- func (k *Konfiguration) GetJsonnetURLs() []string
- func (k *Konfiguration) GetKubeConfig() *KubeConfig
- func (k *Konfiguration) GetNamespacedName() types.NamespacedName
- func (k *Konfiguration) GetPath() string
- func (k *Konfiguration) GetRetryInterval() time.Duration
- func (k *Konfiguration) GetSourceRef() *CrossNamespaceSourceReference
- func (k *Konfiguration) GetStatusConditions() *[]metav1.Condition
- func (k *Konfiguration) GetTimeout() time.Duration
- func (k *Konfiguration) GetVariables() *Variables
- func (k *Konfiguration) IsSuspended() bool
- func (k *Konfiguration) SetHealthiness(ctx context.Context, cl client.Client, status metav1.ConditionStatus, ...) error
- func (k *Konfiguration) SetNotReady(ctx context.Context, cl client.Client, meta *StatusMeta) error
- func (k *Konfiguration) SetNotReadySnapshot(ctx context.Context, cl client.Client, snapshot *Snapshot, meta *StatusMeta) error
- func (k *Konfiguration) SetProgressing(ctx context.Context, cl client.Client) error
- func (k *Konfiguration) SetReadiness(ctx context.Context, cl client.Client, status metav1.ConditionStatus, ...) error
- func (k *Konfiguration) SetReady(ctx context.Context, cl client.Client, snapshot *Snapshot, meta *StatusMeta) error
- func (k *Konfiguration) ShouldValidate() bool
- type KonfigurationList
- type KonfigurationSpec
- type KonfigurationStatus
- type KubeConfig
- type Snapshot
- type SnapshotEntry
- type StatusMeta
- type Variables
Constants ¶
const ( // HealthyCondition is the condition type used // to record the last health assessment result. HealthyCondition string = "Healthy" // PruneFailedReason represents the fact that the // pruning of the Konfiguration failed. PruneFailedReason string = "PruneFailed" // ArtifactFailedReason represents the fact that the // artifact download of the Konfiguration failed. ArtifactFailedReason string = "ArtifactFailed" // BuildFailedReason represents the fact that the // kustomize build of the Konfiguration failed. BuildFailedReason string = "BuildFailed" // HealthCheckFailedReason represents the fact that // one of the health checks of the Konfiguration failed. HealthCheckFailedReason string = "HealthCheckFailed" // ValidationFailedReason represents the fact that the // validation of the Konfiguration manifests has failed. ValidationFailedReason string = "ValidationFailed" )
const ( // GitRepositoryIndexKey is the key used for indexing kustomizations // based on their Git sources. GitRepositoryIndexKey string = ".metadata.gitRepository" // BucketIndexKey is the key used for indexing kustomizations // based on their S3 sources. BucketIndexKey string = ".metadata.bucket" )
const ( // The annotation added to objects containing the checksum of their last // applied configuration. Used to check if a patch is required. LastAppliedConfigAnnotation string = "kubecfg.io/last-applied-configuration" // KonfigurationNameLabel is the label added to objects to denote the Konfiguration // they belong to. Used for garbage collection. KonfigurationNameLabel string = "kubecfg.io/konfiguration-name" // KonfigurationNamespaceLabel is the label added to objects to denote the Konfiguration's // namespace they belong to. Used for garbage collection. KonfigurationNamespaceLabel string = "kubecfg.io/konfiguration-namespace" // KonfigurationChecksumLabel is the label added to objects containing the full checksum of // the built konfiguration being applied. Used for garbage collection. KonfigurationChecksumLabel string = "kubecfg.io/konfiguration-checksum" // ResourceSkipPruning is the label or annotation that a user can apply to resources to have // them skipped during pruning. ResourceSkipPruning string = "kubecfg.io/prune" // PruningDisabledValue is the value set to ResourceSkipPruningLabel to exclude an object from // pruning. PruningDisabledValue string = "disabled" )
const KonfigurationFinalizer string = "finalizers.apps.kubecfg.io"
KongifurationFinalizer is the finalizer placed on Konfiguration resources
const MaxConditionMessageLength int = 20000
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "kubecfg.io", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
This section is empty.
Types ¶
type CrossNamespaceSourceReference ¶
type CrossNamespaceSourceReference struct { // API version of the referent // +optional APIVersion string `json:"apiVersion,omitempty"` // Kind of the referent // +kubebuilder:validation:Enum=GitRepository;Bucket // +required Kind string `json:"kind"` // Name of the referent // +required Name string `json:"name"` // Namespace of the referent, defaults to the Konfiguration namespace // +optional Namespace string `json:"namespace,omitempty"` }
CrossNamespaceSourceReference contains enough information to let you locate the typed referenced object at cluster level
func (*CrossNamespaceSourceReference) DeepCopy ¶
func (in *CrossNamespaceSourceReference) DeepCopy() *CrossNamespaceSourceReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceSourceReference.
func (*CrossNamespaceSourceReference) DeepCopyInto ¶
func (in *CrossNamespaceSourceReference) DeepCopyInto(out *CrossNamespaceSourceReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CrossNamespaceSourceReference) String ¶
func (sref *CrossNamespaceSourceReference) String() string
type Konfiguration ¶
type Konfiguration struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec KonfigurationSpec `json:"spec,omitempty"` Status KonfigurationStatus `json:"status,omitempty"` }
Konfiguration is the Schema for the konfigurations API
func (*Konfiguration) DeepCopy ¶
func (in *Konfiguration) DeepCopy() *Konfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Konfiguration.
func (*Konfiguration) DeepCopyInto ¶
func (in *Konfiguration) DeepCopyInto(out *Konfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Konfiguration) DeepCopyObject ¶
func (in *Konfiguration) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Konfiguration) GCEnabled ¶
func (k *Konfiguration) GCEnabled() bool
GCEnabled returns whether garbage collection should be conducted on kubecfg manifests.
func (Konfiguration) GetDependsOn ¶
func (k Konfiguration) GetDependsOn() (types.NamespacedName, []dependency.CrossNamespaceDependencyReference)
GetDependsOn returns the konfigurations this one depends on.
func (*Konfiguration) GetDiffStrategy ¶
func (k *Konfiguration) GetDiffStrategy() string
GetDiffStrategy retrieves the diff strategy to use.
func (*Konfiguration) GetHealthChecks ¶
func (k *Konfiguration) GetHealthChecks() []meta.NamespacedObjectKindReference
GetHealthChecks returns the health checks for this Konfiguration.
func (*Konfiguration) GetInterval ¶
func (k *Konfiguration) GetInterval() time.Duration
GetInterval returns the interval at which to reconcile the Konfiguration.
func (*Konfiguration) GetJsonnetPaths ¶
func (k *Konfiguration) GetJsonnetPaths() []string
GetJsonnetPaths returns the search paths to configure in the jsonnet VM.
func (*Konfiguration) GetJsonnetURLs ¶
func (k *Konfiguration) GetJsonnetURLs() []string
GetJsonnetURLs returns the URL paths to configure in the jsonnet VM.
func (*Konfiguration) GetKubeConfig ¶
func (k *Konfiguration) GetKubeConfig() *KubeConfig
GetKubeConfig retrieves the kubeconfig to use for the operation if defined. When nil, it is assumed to use any client the caller already has configured (usually that of the controller-runtime at launch).
func (*Konfiguration) GetNamespacedName ¶
func (k *Konfiguration) GetNamespacedName() types.NamespacedName
NamespacedName returns the namespaced name fr this Konfiguration.
func (*Konfiguration) GetPath ¶
func (k *Konfiguration) GetPath() string
GetPath returns the Path to the jsonnet, json, or yaml to evaluate.
func (*Konfiguration) GetRetryInterval ¶
func (k *Konfiguration) GetRetryInterval() time.Duration
GetRetryInterval returns the interval at which to retry a previously failed reconciliation.
func (*Konfiguration) GetSourceRef ¶
func (k *Konfiguration) GetSourceRef() *CrossNamespaceSourceReference
GetSourceRef returns the source ref for this konfiguration.
func (*Konfiguration) GetStatusConditions ¶
func (k *Konfiguration) GetStatusConditions() *[]metav1.Condition
GetStatusConditions returns the status conditions for this resource.
func (*Konfiguration) GetTimeout ¶
func (k *Konfiguration) GetTimeout() time.Duration
GetTimeout returns the timeout for validation, apply and health checking operations.
func (*Konfiguration) GetVariables ¶
func (k *Konfiguration) GetVariables() *Variables
GetVariables returns the external and top level arguments to pass to kubecfg.
func (*Konfiguration) IsSuspended ¶
func (k *Konfiguration) IsSuspended() bool
IsSuspended returns whether the controller should not apply any manifests at the moment.
func (*Konfiguration) SetHealthiness ¶
func (k *Konfiguration) SetHealthiness(ctx context.Context, cl client.Client, status metav1.ConditionStatus, statusMeta *StatusMeta) error
func (*Konfiguration) SetNotReady ¶
func (k *Konfiguration) SetNotReady(ctx context.Context, cl client.Client, meta *StatusMeta) error
SetNotReady registers a failed apply attempt of this Konfiguration.
func (*Konfiguration) SetNotReadySnapshot ¶
func (k *Konfiguration) SetNotReadySnapshot(ctx context.Context, cl client.Client, snapshot *Snapshot, meta *StatusMeta) error
SetNotReadySnapshot registers a failed apply attempt of this Konfiguration, including a Snapshot.
func (*Konfiguration) SetProgressing ¶
SetProgressing resets the conditions of this Kustomization to a single ReadyCondition with status ConditionUnknown.
func (*Konfiguration) SetReadiness ¶
func (k *Konfiguration) SetReadiness(ctx context.Context, cl client.Client, status metav1.ConditionStatus, statusMeta *StatusMeta) error
SetReadiness sets the ReadyCondition, ObservedGeneration, and LastAttemptedRevision, on the Konfiguration.
func (*Konfiguration) SetReady ¶
func (k *Konfiguration) SetReady(ctx context.Context, cl client.Client, snapshot *Snapshot, meta *StatusMeta) error
SetReady registers a successful apply attempt of this Konfiguration.
func (*Konfiguration) ShouldValidate ¶
func (k *Konfiguration) ShouldValidate() bool
ShouldValidate returns true if server-side validation is enabled.
type KonfigurationList ¶
type KonfigurationList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Konfiguration `json:"items"` }
KonfigurationList contains a list of Konfiguration
func (*KonfigurationList) DeepCopy ¶
func (in *KonfigurationList) DeepCopy() *KonfigurationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KonfigurationList.
func (*KonfigurationList) DeepCopyInto ¶
func (in *KonfigurationList) DeepCopyInto(out *KonfigurationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*KonfigurationList) DeepCopyObject ¶
func (in *KonfigurationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type KonfigurationSpec ¶
type KonfigurationSpec struct { // DependsOn may contain a dependency.CrossNamespaceDependencyReference slice // with references to Konfiguration resources that must be ready before this // Konfiguration can be reconciled. // +optional DependsOn []dependency.CrossNamespaceDependencyReference `json:"dependsOn,omitempty"` // The interval at which to reconcile the Konfiguration. // +required Interval metav1.Duration `json:"interval"` // The interval at which to retry a previously failed reconciliation. // When not specified, the controller uses the KonfigurationSpec.Interval // value to retry failures. // +optional RetryInterval *metav1.Duration `json:"retryInterval,omitempty"` // The KubeConfig for reconciling the Konfiguration on a remote cluster. // Defaults to the in-cluster configuration. // +optional KubeConfig *KubeConfig `json:"kubeConfig,omitempty"` // Path to the jsonnet, json, or yaml that should be applied to the cluster. // Defaults to 'None', which translates to the root path of the SourceRef. // When declared as a file path it is assumed to be from the root path of the SourceRef. // You may also define a HTTP(S) link to fetch files from a remote location. // +required Path string `json:"path"` // Additional search paths to add to the jsonnet importer. These are relative to // the root of the sourceRef. // +optional JsonnetPaths []string `json:"jsonnerPaths,omitempty"` // Additional HTTP(S) URLs to add to the jsonnet importer. // +optional JsonnetURLs []string `json:"jsonnetURLs,omitempty"` // Variables to use when invoking kubecfg to render manifests. // +optional Variables *Variables `json:"variables,omitempty"` // The name of the Kubernetes service account to impersonate // when reconciling this Konfiguration. // +optional ServiceAccountName string `json:"serviceAccountName,omitempty"` // Reference of the source where the jsonnet, json, or yaml file(s) are. // +optional SourceRef *CrossNamespaceSourceReference `json:"sourceRef"` // Prune enables garbage collection. Note that this makes commands take // considerably longer, so you may want to adjust your timeouts accordingly. // +required Prune bool `json:"prune"` // A list of resources to be included in the health assessment. // +optional HealthChecks []meta.NamespacedObjectKindReference `json:"healthChecks,omitempty"` // This flag tells the controller to suspend subsequent kubecfg executions, // it does not apply to already started executions. Defaults to false. // +optional Suspend bool `json:"suspend,omitempty"` // Timeout for diff, validation, apply, and health checking operations. // Defaults to 'Interval' duration. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` // Validate input against the server schema, defaults to true. // This will be updated to support different methods of validation. // +kubebuilder:default:=true // +optional Validate bool `json:"validate,omitempty"` // Strategy to use when performing diffs against the current state of the // cluster. Options are `all`, `subset`, or `last-applied`. Defaults to // `subset`. // +kubebuilder:default:=subset // +kubebuilder:validation:Enum=all;subset;last-applied // +optional DiffStrategy string `json:"diffStrategy,omitempty"` }
KonfigurationSpec defines the desired state of a Konfiguration
func (*KonfigurationSpec) DeepCopy ¶
func (in *KonfigurationSpec) DeepCopy() *KonfigurationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KonfigurationSpec.
func (*KonfigurationSpec) DeepCopyInto ¶
func (in *KonfigurationSpec) DeepCopyInto(out *KonfigurationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KonfigurationStatus ¶
type KonfigurationStatus struct { // ObservedGeneration is the last reconciled generation. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` // The last successfully applied revision. // The revision format for Git sources is <branch|tag>/<commit-sha>. // For HTTP(S) paths it will just be the URL. // +optional LastAppliedRevision string `json:"lastAppliedRevision,omitempty"` // LastAttemptedRevision is the revision of the last reconciliation attempt. // For HTTP(S) paths it will just be the URL. // +optional LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"` // The last successfully applied revision metadata. // +optional Snapshot *Snapshot `json:"snapshot,omitempty"` }
KonfigurationStatus defines the observed state of Konfiguration
func (*KonfigurationStatus) DeepCopy ¶
func (in *KonfigurationStatus) DeepCopy() *KonfigurationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KonfigurationStatus.
func (*KonfigurationStatus) DeepCopyInto ¶
func (in *KonfigurationStatus) DeepCopyInto(out *KonfigurationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KubeConfig ¶
type KubeConfig struct { // SecretRef holds the name to a secret that contains a 'value' key with // the kubeconfig file as the value. It must be in the same namespace as // the Konfiguration. // It is recommended that the kubeconfig is self-contained, and the secret // is regularly updated if credentials such as a cloud-access-token expire. // Cloud specific `cmd-path` auth helpers will not function without adding // binaries and credentials to the Pod that is responsible for reconciling // the Konfiguration. // +required SecretRef corev1.LocalObjectReference `json:"secretRef,omitempty"` }
KubeConfig holds the configuration for where to fetch the contents of a kubeconfig file.
func (*KubeConfig) DeepCopy ¶
func (in *KubeConfig) DeepCopy() *KubeConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeConfig.
func (*KubeConfig) DeepCopyInto ¶
func (in *KubeConfig) DeepCopyInto(out *KubeConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Snapshot ¶
type Snapshot struct { // The manifests sha1 checksum. // +required Checksum string `json:"checksum"` // A list of Kubernetes kinds grouped by namespace. // +required Entries []SnapshotEntry `json:"entries"` }
Snapshot holds the metadata of the Kubernetes objects generated for a source revision
func (*Snapshot) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Snapshot.
func (*Snapshot) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Snapshot) NamespacedKinds ¶
func (s *Snapshot) NamespacedKinds() map[string][]schema.GroupVersionKind
func (*Snapshot) NonNamespacedKinds ¶
func (s *Snapshot) NonNamespacedKinds() []schema.GroupVersionKind
type SnapshotEntry ¶
type SnapshotEntry struct { // The namespace of this entry. // +optional Namespace string `json:"namespace"` // The list of Kubernetes kinds. // +required Kinds map[string]string `json:"kinds"` }
Snapshot holds the metadata of namespaced Kubernetes objects
func (*SnapshotEntry) DeepCopy ¶
func (in *SnapshotEntry) DeepCopy() *SnapshotEntry
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotEntry.
func (*SnapshotEntry) DeepCopyInto ¶
func (in *SnapshotEntry) DeepCopyInto(out *SnapshotEntry)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StatusMeta ¶
type StatusMeta struct {
Revision, Reason, Message string
}
func NewStatusMeta ¶
func NewStatusMeta(revision, reason, message string) *StatusMeta
func (*StatusMeta) DeepCopy ¶
func (in *StatusMeta) DeepCopy() *StatusMeta
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusMeta.
func (*StatusMeta) DeepCopyInto ¶
func (in *StatusMeta) DeepCopyInto(out *StatusMeta)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Variables ¶
type Variables struct { // Values of external variables with string values. // +optional ExtStr map[string]string `json:"extStr,omitempty"` // Values of external variables with values supplied as Jsonnet code. // +optional ExtCode map[string]string `json:"extCode,omitempty"` // Values of top level arguments with string values. // +optional TLAStr map[string]string `json:"tlaStr,omitempty"` // Values of top level arguments with values supplied as Jsonnet code. // +optional TLACode map[string]string `json:"tlaCode,omitempty"` }
Variables describe code/strings for external variables and top-level arguments.
func (*Variables) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Variables.
func (*Variables) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Variables) InjectInto ¶
func (v *Variables) InjectInto(vm *jsonnet.VM)
Inject will inject the configured variables into the vm.