v1alpha1

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group +kubebuilder:object:generate=true +groupName=addons.projectcapsule.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "addons.projectcapsule.dev", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type ArgoAction

type ArgoAction string

Create enums for ArgoCD Permissions Actions.

const (
	ActionGet      ArgoAction = "get"
	ActionList     ArgoAction = "list"
	ActionCreate   ArgoAction = "create"
	ActionUpdate   ArgoAction = "update"
	ActionDelete   ArgoAction = "delete"
	ActionSync     ArgoAction = "sync"
	ActionAction   ArgoAction = "action"
	ActionOverride ArgoAction = "override"
	ActionInvoke   ArgoAction = "invoke"
	ActionWildcard ArgoAction = "*"
)

type ArgoAddon

type ArgoAddon struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ArgoAddonSpec   `json:"spec,omitempty"`
	Status ArgoAddonStatus `json:"status,omitempty"`
}

ArgoAddon is the Schema for the ArgoAddons API.

func (*ArgoAddon) DeepCopy

func (in *ArgoAddon) DeepCopy() *ArgoAddon

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoAddon.

func (*ArgoAddon) DeepCopyInto

func (in *ArgoAddon) DeepCopyInto(out *ArgoAddon)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArgoAddon) DeepCopyObject

func (in *ArgoAddon) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ArgoAddonList

type ArgoAddonList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ArgoAddon `json:"items"`
}

ArgoAddonList contains a list of ArgoAddon.

func (*ArgoAddonList) DeepCopy

func (in *ArgoAddonList) DeepCopy() *ArgoAddonList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoAddonList.

func (*ArgoAddonList) DeepCopyInto

func (in *ArgoAddonList) DeepCopyInto(out *ArgoAddonList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArgoAddonList) DeepCopyObject

func (in *ArgoAddonList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ArgoAddonSpec

type ArgoAddonSpec struct {
	// When force is enabled, appprojects which already exist with the same name as a tenant will be adopted
	// and overwritten. When disabled the appprojects will not be changed or adopted.
	// This is true for any other resource as well. This can also be set on a per-tenant basis via annotations.
	//+kubebuilder:default=false
	Force bool `json:"force"`
	// When decouple is enabled, appprojects are preserved even in the case when the origin tenant is deleted.
	// This can also be set on a per-tenant basis via annotations.
	//+kubebuilder:default=true
	Decouple bool `json:"decouple"`
	// All appprojects, which are collected by this controller, are set into ready-only mode
	// That means only properties from matching translators are respected. Any changes from users are
	// overwritten. This can also be set on a per-tenant basis via annotations.
	//+kubebuilder:default=false
	ReadOnly bool `json:"readonly"`

	// Argo configuration
	Argo ControllerArgoCDConfig `json:"argo"`

	// Allows the creation of argo repository secrets which are then replicated to the argocd namespace.
	// This makes sense when users create repository via gitops and don't have access to the GUI (or where you prevent them from doing that on the GUI)
	//+kubebuilder:default=false
	AllowRepositoryCreation bool `json:"allowRepositoryCreation"`
}

ArgoAddonSpec defines the desired state of ArgoAddon.

func (*ArgoAddonSpec) DecoupleTenant

func (in *ArgoAddonSpec) DecoupleTenant(tenant *capsulev1beta2.Tenant) bool

Determines if resources should be decoupled.

func (*ArgoAddonSpec) DeepCopy

func (in *ArgoAddonSpec) DeepCopy() *ArgoAddonSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoAddonSpec.

func (*ArgoAddonSpec) DeepCopyInto

func (in *ArgoAddonSpec) DeepCopyInto(out *ArgoAddonSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArgoAddonSpec) DestinationServiceAccount

func (in *ArgoAddonSpec) DestinationServiceAccount(tenant *capsulev1beta2.Tenant) string

Prints Argo Destination annotation.

func (*ArgoAddonSpec) ForceTenant

func (in *ArgoAddonSpec) ForceTenant(tenant *capsulev1beta2.Tenant) bool

Determines if existing resources should be overwritten (forced).

func (*ArgoAddonSpec) GetClusterDestination

func (in *ArgoAddonSpec) GetClusterDestination(_ *capsulev1beta2.Tenant) (dest string)

Get the Cluster-URL within argo-cd.

func (*ArgoAddonSpec) ReadOnlyTenant

func (in *ArgoAddonSpec) ReadOnlyTenant(tenant *capsulev1beta2.Tenant) bool

Determines read-only is applied on tenant-basis.

func (*ArgoAddonSpec) RegisterCluster

func (in *ArgoAddonSpec) RegisterCluster(tenant *capsulev1beta2.Tenant) (provision bool)

Determines if an argo cluster destination should be registered on a tenant-basis.

func (*ArgoAddonSpec) ServiceAccountNamespace

func (in *ArgoAddonSpec) ServiceAccountNamespace(tenant *capsulev1beta2.Tenant) (namespace string)

Namespace where the serviceaccount will be placed.

type ArgoAddonStatus

type ArgoAddonStatus struct {
	// Last applied valid configuration
	Config ArgoAddonSpec `json:"loaded,omitempty"`
}

ArgoAddonStatus defines the observed state of ArgoAddon.

func (*ArgoAddonStatus) DeepCopy

func (in *ArgoAddonStatus) DeepCopy() *ArgoAddonStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoAddonStatus.

func (*ArgoAddonStatus) DeepCopyInto

func (in *ArgoAddonStatus) DeepCopyInto(out *ArgoAddonStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ArgoResource

type ArgoResource string

Create enums for ArgoCD Permissions Resources.

const (
	ResourceApplications    ArgoResource = "applications"
	ResourceApplicationSets ArgoResource = "applicationsets"
	ResourceClusters        ArgoResource = "clusters"
	ResourceProjects        ArgoResource = "projects"
	ResourceRepositories    ArgoResource = "repositories"
	ResourceAccounts        ArgoResource = "accounts"
	ResourceCertificates    ArgoResource = "certificates"
	ResourceGpgKeys         ArgoResource = "gpgkeys"
	ResourceLogs            ArgoResource = "logs"
	ResourceExec            ArgoResource = "exec"
	ResourceExtensions      ArgoResource = "extensions"
	ResourceWildcard        ArgoResource = "*"
)

type ArgoTranslator

type ArgoTranslator struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ArgoTranslatorSpec   `json:"spec,omitempty"`
	Status ArgoTranslatorStatus `json:"status,omitempty"`
}

ArgoTranslator is the Schema for the argotranslators API.

func (*ArgoTranslator) CollectStatus

func (in *ArgoTranslator) CollectStatus()

Assign Tenants to the ArgoTranslator.

func (*ArgoTranslator) DeepCopy

func (in *ArgoTranslator) DeepCopy() *ArgoTranslator

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoTranslator.

func (*ArgoTranslator) DeepCopyInto

func (in *ArgoTranslator) DeepCopyInto(out *ArgoTranslator)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArgoTranslator) DeepCopyObject

func (in *ArgoTranslator) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ArgoTranslator) GetTenantCondition

func (in *ArgoTranslator) GetTenantCondition(tnt *capsulev1beta2.Tenant) *metav1.Condition

Get Condition for a tenant, if no condition is present (tenant absent) returns nil.

func (*ArgoTranslator) GetTenantNames

func (in *ArgoTranslator) GetTenantNames() (tnts []string)

Just Extract the tenants.

func (*ArgoTranslator) GetTenantStatus added in v0.4.0

func (in *ArgoTranslator) GetTenantStatus(tnt *capsulev1beta2.Tenant) *TenantStatus

Get Status for a tenant, if no status is present (tenant absent) returns nil.

func (*ArgoTranslator) GetTenants

func (in *ArgoTranslator) GetTenants() []TenantStatus

Assign Tenants to the ArgoTranslator.

func (*ArgoTranslator) MatchesObject added in v0.4.0

func (in *ArgoTranslator) MatchesObject(obj client.Object) (match bool)

Function to verify if an object matches the translator.

func (*ArgoTranslator) PruneMissingTenantStatuses added in v0.8.0

func (in *ArgoTranslator) PruneMissingTenantStatuses(tenants []capsulev1beta2.Tenant)

PruneMissingTenantStatuses removes status entries for tenants that no longer exist.

func (*ArgoTranslator) RemoveTenantCondition

func (in *ArgoTranslator) RemoveTenantCondition(tnt string)

Removes a tenant from the ArgoTranslator Status.

func (*ArgoTranslator) SyncFinalizerStatus added in v0.4.0

func (in *ArgoTranslator) SyncFinalizerStatus()

Assign Tenants to the ArgoTranslator.

func (*ArgoTranslator) UpdateTenantCondition

func (in *ArgoTranslator) UpdateTenantCondition(tnt TenantStatus)

Update the condition for a single Tenant.

type ArgoTranslatorList

type ArgoTranslatorList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ArgoTranslator `json:"items"`
}

ArgoTranslatorList contains a list of ArgoTranslator.

func (*ArgoTranslatorList) DeepCopy

func (in *ArgoTranslatorList) DeepCopy() *ArgoTranslatorList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoTranslatorList.

func (*ArgoTranslatorList) DeepCopyInto

func (in *ArgoTranslatorList) DeepCopyInto(out *ArgoTranslatorList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArgoTranslatorList) DeepCopyObject

func (in *ArgoTranslatorList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ArgoTranslatorSpec

type ArgoTranslatorSpec struct {
	// Selector to match tenants which are used for the translator
	Selector *metav1.LabelSelector `json:"selector,omitempty"`

	// Application-Project Roles for the tenant
	ProjectRoles []ArgocdProjectRolesTranslator `json:"roles,omitempty"`

	// Additional settings for the argocd project
	ProjectSettings *ArgocdProjectProperties `json:"settings,omitempty"`

	// In this field you can define custom policies. It must result in a valid argocd policy format (CSV)
	// You can use Sprig Templating with this field
	CustomPolicy string `json:"customPolicy,omitempty"`
}

ArgoTranslatorSpec defines the desired state of ArgoTranslator.

func (*ArgoTranslatorSpec) DeepCopy

func (in *ArgoTranslatorSpec) DeepCopy() *ArgoTranslatorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoTranslatorSpec.

func (*ArgoTranslatorSpec) DeepCopyInto

func (in *ArgoTranslatorSpec) DeepCopyInto(out *ArgoTranslatorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ArgoTranslatorStatus

type ArgoTranslatorStatus struct {
	// List of tenants selected by this translator
	Tenants []TenantStatus `json:"tenants,omitempty"`
	// Amount of tenants selected by this translator
	Size uint `json:"size,omitempty"`
	// Ready field indicating overall readiness of the translator
	Ready string `json:"ready,omitempty"`
}

ArgoTranslatorStatus defines the observed state of ArgoTranslator.

func (*ArgoTranslatorStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoTranslatorStatus.

func (*ArgoTranslatorStatus) DeepCopyInto

func (in *ArgoTranslatorStatus) DeepCopyInto(out *ArgoTranslatorStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ArgoVerb

type ArgoVerb string

Create enums for ArgoCD Permissions Resources.

const (
	VerbAllow ArgoVerb = "allow"
	VerbDeny  ArgoVerb = "deny"
)

type ArgocdPolicyDefinition

type ArgocdPolicyDefinition struct {
	// Name for permission mapping
	Resource ArgoResource `json:"resource,omitempty"`

	// Allowed actions for this permission. You may specify multiple actions. To allow all actions use "*"
	// +kubebuilder:default={get}
	Action []string `json:"action,omitempty"`

	// Verb for this permission (can be allow, deny)
	// +kubebuilder:default=allow
	Verb ArgoVerb `json:"verb,omitempty"`

	// You may specify a custom path for the resource. The available path for argo is <app-project>/<app-ns>/<app-name>
	// however <app-project> is already set to the argocd project name. Therefor you can only add <app-ns>/<app-name>
	// +kubebuilder:default="*"
	Path string `json:"path,omitempty"`
}

func (*ArgocdPolicyDefinition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgocdPolicyDefinition.

func (*ArgocdPolicyDefinition) DeepCopyInto

func (in *ArgocdPolicyDefinition) DeepCopyInto(out *ArgocdPolicyDefinition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ArgocdProjectPropertieMeta

type ArgocdProjectPropertieMeta struct {
	// Labels for the project
	//+kubebuilder:optional
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations for the project
	//+kubebuilder:optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Finalizers for the project
	//+kubebuilder:optional
	Finalizers []string `json:"finalizers,omitempty"`
}

func (*ArgocdProjectPropertieMeta) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgocdProjectPropertieMeta.

func (*ArgocdProjectPropertieMeta) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ArgocdProjectProperties

type ArgocdProjectProperties struct {
	// Structured Properties for the argocd project
	Structured *ArgocdProjectStructuredProperties `json:"structured,omitempty"`
	// Use a template to generate to argo project settings
	Template string `json:"template,omitempty"`
}

func (*ArgocdProjectProperties) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgocdProjectProperties.

func (*ArgocdProjectProperties) DeepCopyInto

func (in *ArgocdProjectProperties) DeepCopyInto(out *ArgocdProjectProperties)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ArgocdProjectProperties) GetConfig

func (t *ArgocdProjectProperties) GetConfig(
	data interface{},
	funcmap template.FuncMap,
) (props *ArgocdProjectStructuredProperties, err error)

Get Combined Configuration from structured and Template.

func (*ArgocdProjectProperties) GetConfigs

func (t *ArgocdProjectProperties) GetConfigs(
	data interface{},
	funcmap template.FuncMap,
) (structured *ArgocdProjectStructuredProperties, templated *ArgocdProjectStructuredProperties, err error)

Get Combined Configuration from structured and Template.

func (*ArgocdProjectProperties) RenderTemplate

func (t *ArgocdProjectProperties) RenderTemplate(
	data interface{},
	funcmap template.FuncMap,
) (props *ArgocdProjectStructuredProperties, err error)

Field templating for the ArgoCD project properties. Needs to unmarshal in json, because of the json tags from argocd.

type ArgocdProjectRolesTranslator

type ArgocdProjectRolesTranslator struct {
	// Name for permission mapping
	Name string `json:"name,omitempty"`

	// TenantRoles selects tenant users based on their cluster roles to this Permission
	ClusterRoles []string `json:"clusterRoles,omitempty"`

	// Roles are reflected in the argocd rbac configmap
	Policies []ArgocdPolicyDefinition `json:"policies,omitempty"`

	// Define if the selected users are owners of the appproject. Being owner allows the users
	// to update the project and effectively manage everything. By default the selected users get
	// read-only access to the project.
	// +kubebuilder:default=false
	Owner bool `json:"owner,omitempty"`
}

Define Permission mappings for an ArogCD Project.

func (*ArgocdProjectRolesTranslator) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgocdProjectRolesTranslator.

func (*ArgocdProjectRolesTranslator) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ArgocdProjectStructuredProperties

type ArgocdProjectStructuredProperties struct {
	// Project Metadata
	ProjectMeta *ArgocdProjectPropertieMeta `json:"meta,omitempty"`
	// Application Project Spec (Upstream ArgoCD)
	ProjectSpec argocdv1alpha1.AppProjectSpec `json:"spec,omitempty"`
}

func (*ArgocdProjectStructuredProperties) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgocdProjectStructuredProperties.

func (*ArgocdProjectStructuredProperties) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ControllerArgoCDConfig

type ControllerArgoCDConfig struct {
	// Namespace where the ArgoCD instance is running
	// +kubebuilder:default=argocd
	Namespace string `json:"namespace,omitempty"`

	// Name of the ArgoCD rbac configmap (required for the controller)
	// +kubebuilder:default=argocd-rbac-cm
	RBACConfigMap string `json:"rbacConfigMap,omitempty"`

	// If you are not using the capsule-proxy integration this destination is registered
	// for each appproject.
	// +kubebuilder:default="https://kubernetes.default.svc"
	Destination string `json:"destination,omitempty"`

	// This is a feature which will be released with argocd +v2.13.0
	// If you are not yet on that version, you can't use this feature. Currently Feature is in state Alpha
	// +kubebuilder:default=true
	DestinationServiceAccounts bool `json:"destinationServiceAccounts,omitempty"`

	// Default Namespace to create ServiceAccounts used by arog-cd
	// The namespace must be part of capsuleUsers and have "list", "get" and "watch" privileges for the entire cluster
	// It's best to have a dedicated namespace for these serviceaccounts
	ServiceAccountNamespace string `json:"serviceAccountNamespace"`

	// ClusterRoles assigned to serviceaccounts generated by the addon and added as owners to the capsule tenant
	// +kubebuilder:default={admin,capsule-namespace-deleter}
	ServiceAccountClusterRoles []string `json:"serviceAccountClusterRoles"`
}

Controller Configuration for ArgoCD.

func (*ControllerArgoCDConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerArgoCDConfig.

func (*ControllerArgoCDConfig) DeepCopyInto

func (in *ControllerArgoCDConfig) DeepCopyInto(out *ControllerArgoCDConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TenantStatus

type TenantStatus struct {
	// List of tenants selected by this translator
	Name string `json:"name,omitempty"`
	// UID of the tracked Tenant to pin point tracking
	k8stypes.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid"`
	// Conditions represent the latest available observations of an object's state
	Condition metav1.Condition `json:"condition,omitempty"`
	// Serving  Settings for this Tenant
	Serving *ArgocdProjectProperties `json:"serving,omitempty"`
}

func (*TenantStatus) DeepCopy

func (in *TenantStatus) DeepCopy() *TenantStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantStatus.

func (*TenantStatus) DeepCopyInto

func (in *TenantStatus) DeepCopyInto(out *TenantStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL