unleash_nais_io_v1

package
v0.0.0-...-6f313e0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 13 Imported by: 3

Documentation

Overview

Package v1 contains API Schema definitions for the unleash.nais.io v1 API group +kubebuilder:object:generate=true +groupName=unleash.nais.io +versionName=v1

Index

Constants

View Source
const (
	UnleashStatusConditionTypeReconciled = "Reconciled"
	UnleashStatusConditionTypeConnected  = "Connected"
	UnleashStatusConditionTypeDegraded   = "Degraded"

	ApiTokenStatusConditionTypeCreated = "Created"
	ApiTokenStatusConditionTypeFailed  = "Failed"
	ApiTokenStatusConditionTypeDeleted = "Deleted"

	UnleashSecretNamePrefix = "unleasherator"
	UnleashSecretTokenKey   = "token"

	ApiTokenSecretTokenEnv    = "UNLEASH_SERVER_API_TOKEN"
	ApiTokenSecretServerEnv   = "UNLEASH_SERVER_API_URL"
	ApiTokenSecretEnvEnv      = "UNLEASH_SERVER_API_ENV"
	ApiTokenSecretTypeEnv     = "UNLEASH_SERVER_API_TYPE"
	ApiTokenSecretProjectsEnv = "UNLEASH_SERVER_API_PROJECTS"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "unleash.nais.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 ApiToken

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

	Spec   ApiTokenSpec   `json:"spec,omitempty"`
	Status ApiTokenStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Created",type=boolean,JSONPath=`.status.created` +kubebuilder:printcolumn:name="Secret",type=string,JSONPath=`.spec.secretName` +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type` +kubebuilder:printcolumn:name="Environment",type=string,JSONPath=`.spec.environment` +kubebuilder:printcolumn:name="Failed",type=boolean,JSONPath=`.status.failed`

func (*ApiToken) ApiTokenName

func (t *ApiToken) ApiTokenName(suffix string) string

ApiTokenName returns the name of the Unleash client for this token. The name is the same as the token name, but with a suffix. This is to avoid name collisions between multiple Unleasherator instances operating on the same Unleash instance.

func (*ApiToken) ApiTokenRequest

func (t *ApiToken) ApiTokenRequest(suffix string) unleashclient.ApiTokenRequest

func (*ApiToken) DeepCopy

func (in *ApiToken) DeepCopy() *ApiToken

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

func (*ApiToken) DeepCopyInto

func (in *ApiToken) DeepCopyInto(out *ApiToken)

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

func (*ApiToken) DeepCopyObject

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

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

func (*ApiToken) Diff

func (t *ApiToken) Diff(token unleashclient.ApiToken) string

func (*ApiToken) ExistsInList

func (t *ApiToken) ExistsInList(list []unleashclient.ApiToken) (*unleashclient.ApiToken, bool)

ExistsInList checks if the token equals any token in the list by comparing the type, environment, and projects attributes of the token. It returns the matching token and a boolean indicating if a match was found.

func (*ApiToken) IsEqual

func (t *ApiToken) IsEqual(token unleashclient.ApiToken) bool

IsEqual checks if the token equals another token by comparing the type, environment, and projects attributes of the token.

func (*ApiToken) NamespacedName

func (t *ApiToken) NamespacedName() types.NamespacedName

type ApiTokenList

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

+kubebuilder:object:root=true

func (*ApiTokenList) DeepCopy

func (in *ApiTokenList) DeepCopy() *ApiTokenList

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

func (*ApiTokenList) DeepCopyInto

func (in *ApiTokenList) DeepCopyInto(out *ApiTokenList)

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

func (*ApiTokenList) DeepCopyObject

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

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

type ApiTokenSpec

type ApiTokenSpec struct {
	// UnleashInstance is the Unleash instance this token is for.
	// +kubebuilder:validation:Required
	UnleashInstance ApiTokenUnleashInstance `json:"unleashInstance"`

	// SecretName is the name of the secret where the token will be stored.
	// +kubebuilder:validation:Required
	SecretName string `json:"secretName"`

	// Type is the type of token to create. Valid values are "CLIENT" and "FRONTEND".
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum=CLIENT;FRONTEND
	// +kubebuilder:default="CLIENT"
	Type string `json:"type,omitempty"`

	// Environment is the environment to create the token for.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default="development"
	Environment string `json:"environment,omitempty"`

	// Projects is the list of projects to create the token for.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default={"default"}
	Projects []string `json:"projects,omitempty"`
}

ApiTokenSpec defines the desired state of ApiToken

func (*ApiTokenSpec) DeepCopy

func (in *ApiTokenSpec) DeepCopy() *ApiTokenSpec

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

func (*ApiTokenSpec) DeepCopyInto

func (in *ApiTokenSpec) DeepCopyInto(out *ApiTokenSpec)

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

type ApiTokenStatus

type ApiTokenStatus struct {
	// Represents the observations of a ApiToken's current state.
	// Unleash.status.conditions.type are: "Created", and "Failed"
	// Unleash.status.conditions.status are one of True, False, Unknown.
	// Unleash.status.conditions.reason the value should be a CamelCase string and producers of specific
	// condition types may define expected values and meanings for this field, and whether the values
	// are considered a guaranteed API.
	// Unleash.status.conditions.Message is a human readable message indicating details about the transition.
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Created is true when the Unleash API token has been created successfully
	// in the Unleash instance.
	// This is used for kubectl printing purposes. Rather than relying on this
	// value, check the conditions instead.
	// +kubebuilder:default=false
	Created bool `json:"created,omitempty"`

	// Failed is true when the Unleash API token reconcile has failed
	// This is used for kubectl printing purposes. Rather than relying on this
	// value, check the conditions instead.
	// +kubebuilder:default=false
	Failed bool `json:"failed,omitempty"`
}

ApiTokenStatus defines the observed state of ApiToken

func (*ApiTokenStatus) DeepCopy

func (in *ApiTokenStatus) DeepCopy() *ApiTokenStatus

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

func (*ApiTokenStatus) DeepCopyInto

func (in *ApiTokenStatus) DeepCopyInto(out *ApiTokenStatus)

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

type ApiTokenUnleashInstance

type ApiTokenUnleashInstance struct {
	// ApiVersion is the API version of the Unleash instance.
	// +kubebuilder:validation:Required
	// +kubebuilder:default=unleash.nais.io/v1
	ApiVersion string `json:"apiVersion"`

	// Kind is the API kind of the Unleash instance.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=Unleash;RemoteUnleash
	Kind string `json:"kind"`

	// Name is the name of the Unleash instance.
	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

ApiTokenUnleashInstance defines the Unleash instance this token is for.

func (*ApiTokenUnleashInstance) DeepCopy

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

func (*ApiTokenUnleashInstance) DeepCopyInto

func (in *ApiTokenUnleashInstance) DeepCopyInto(out *ApiTokenUnleashInstance)

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

type RemoteUnleash

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

	Spec   RemoteUnleashSpec   `json:"spec,omitempty"`
	Status RemoteUnleashStatus `json:"status,omitempty"`
}

RemoteUnleash defines an RemoteUnleash instance +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="URL",type=string,JSONPath=`.spec.unleashInstance.url` +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.status.version` +kubebuilder:printcolumn:name="Reconciled",type=boolean,JSONPath=`.status.reconciled` +kubebuilder:printcolumn:name="Connected",type=boolean,JSONPath=`.status.connected`

func (*RemoteUnleash) AdminSecretNamespacedName

func (u *RemoteUnleash) AdminSecretNamespacedName() types.NamespacedName

AdminSecretNamespacedName returns the namespaced name of the secret containing the Unleash instance's API token.

func (*RemoteUnleash) AdminToken

func (u *RemoteUnleash) AdminToken(ctx context.Context, client client.Client, namespace string) ([]byte, error)

AdminToken returns the admin API token for the Unleash instance.

func (*RemoteUnleash) ApiClient

func (u *RemoteUnleash) ApiClient(ctx context.Context, client client.Client, namespace string) (*unleashclient.Client, error)

ApiClient returns an Unleash API client for the Unleash instance.

func (*RemoteUnleash) DeepCopy

func (in *RemoteUnleash) DeepCopy() *RemoteUnleash

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

func (*RemoteUnleash) DeepCopyInto

func (in *RemoteUnleash) DeepCopyInto(out *RemoteUnleash)

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

func (*RemoteUnleash) DeepCopyObject

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

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

func (*RemoteUnleash) IsReady

func (u *RemoteUnleash) IsReady() bool

IsReady returns true if the Unleash instance is ready. We define ready as having both the Available and Connection conditions set to true.

func (*RemoteUnleash) NamespacedName

func (u *RemoteUnleash) NamespacedName() types.NamespacedName

NamespacedName returns the namespaced name of the Unleash instance.

func (*RemoteUnleash) URL

func (u *RemoteUnleash) URL() string

URL returns the URL of the Unleash instance.

type RemoteUnleashList

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

RemoteUnleashList contains a list of RemoteUnleash +kubebuilder:object:root=true

func (*RemoteUnleashList) DeepCopy

func (in *RemoteUnleashList) DeepCopy() *RemoteUnleashList

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

func (*RemoteUnleashList) DeepCopyInto

func (in *RemoteUnleashList) DeepCopyInto(out *RemoteUnleashList)

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

func (*RemoteUnleashList) DeepCopyObject

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

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

type RemoteUnleashSecret

type RemoteUnleashSecret struct {
	// Name is the name of the secret containing the Unleash instance's API token.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=`^unleasherator-.+$`
	Name string `json:"name"`

	// TokenKey is the key of the secret containing the Unleash instance's API token.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=token
	Key string `json:"key,omitempty"`

	// Namespace is the namespace of the secret containing the Unleash instance's API token.
	// +kubebuilder:validation:Optional
	Namespace string `json:"namespace,omitempty"`
}

RemoteUnleashSecret defines the secret containing the Unleash instance's API token.

func (*RemoteUnleashSecret) DeepCopy

func (in *RemoteUnleashSecret) DeepCopy() *RemoteUnleashSecret

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

func (*RemoteUnleashSecret) DeepCopyInto

func (in *RemoteUnleashSecret) DeepCopyInto(out *RemoteUnleashSecret)

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

type RemoteUnleashServer

type RemoteUnleashServer struct {
	// URL is the URL of the Unleash instance.
	// The URL must be a valid URL, and must start with either http:// or https://.
	// The URL must be to the root of the Unleash instance, and must not contain any path.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=`^https?://`
	URL string `json:"url"`
}

RemoteUnleashServer defines the Unleash instance this token is for.

func (*RemoteUnleashServer) DeepCopy

func (in *RemoteUnleashServer) DeepCopy() *RemoteUnleashServer

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

func (*RemoteUnleashServer) DeepCopyInto

func (in *RemoteUnleashServer) DeepCopyInto(out *RemoteUnleashServer)

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

type RemoteUnleashSpec

type RemoteUnleashSpec struct {
	// Server is the Unleash instance this token is for.
	// +kubebuilder:validation:Required
	Server RemoteUnleashServer `json:"unleashInstance"`

	// Secret is the secret containing the Unleash instance's API token.
	// +kubebuilder:validation:Required
	AdminSecret RemoteUnleashSecret `json:"adminSecret"`
}

RemoteUnleashSpec defines the desired state of RemoteUnleash

func (*RemoteUnleashSpec) DeepCopy

func (in *RemoteUnleashSpec) DeepCopy() *RemoteUnleashSpec

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

func (*RemoteUnleashSpec) DeepCopyInto

func (in *RemoteUnleashSpec) DeepCopyInto(out *RemoteUnleashSpec)

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

type RemoteUnleashStatus

type RemoteUnleashStatus struct {
	// Represents the observations of a RemoteUnleash's current state.
	// RemoteUnleash.status.conditions.type are: "Reconciled", "Connected", and "Degraded"
	// RemoteUnleash.status.conditions.status are one of True, False, Unknown.
	// RemoteUnleash.status.conditions.reason the value should be a CamelCase string and producers of specific
	// condition types may define expected values and meanings for this field, and whether the values
	// are considered a guaranteed API.
	// RemoteUnleash.status.conditions.Message is a human readable message indicating details about the transition.
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Reconciled is true when the Unleash resources hav been reconciled
	// successfully.
	// This is used for kubectl printing purposes. Rather than relying on this
	// value, check the conditions instead.
	// +kubebuilder:default=false
	Reconciled bool `json:"reconciled,omitempty"`

	// Connected is true when the Unleash resource has been connected to the Unleash server
	// This is used for kubectl printing purposes. Rather than relying on this
	// value, check the conditions instead.
	// +kubebuilder:default=false
	Connected bool `json:"connected,omitempty"`

	// Version is the reported version of the Unleash server
	// +kubebuilder:default="unknown"
	Version string `json:"version,omitempty"`
}

RemoteUnleashStatus defines the observed state of RemoteUnleash

func (*RemoteUnleashStatus) DeepCopy

func (in *RemoteUnleashStatus) DeepCopy() *RemoteUnleashStatus

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

func (*RemoteUnleashStatus) DeepCopyInto

func (in *RemoteUnleashStatus) DeepCopyInto(out *RemoteUnleashStatus)

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

type Unleash

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

	Spec   UnleashSpec   `json:"spec,omitempty"`
	Status UnleashStatus `json:"status,omitempty"`
}

Unleash defines an Unleash instance +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="API Ingress",type=string,JSONPath=`.spec.apiIngress.host` +kubebuilder:printcolumn:name="Web Ingress",type=string,JSONPath=`.spec.webIngress.host` +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.status.version` +kubebuilder:printcolumn:name="Reconciled",type=boolean,JSONPath=`.status.reconciled` +kubebuilder:printcolumn:name="Connected",type=boolean,JSONPath=`.status.connected`

func (*Unleash) AdminToken

func (u *Unleash) AdminToken(ctx context.Context, client client.Client, namespace string) ([]byte, error)

func (*Unleash) ApiClient

func (u *Unleash) ApiClient(ctx context.Context, client client.Client, namespace string) (*unleashclient.Client, error)

func (*Unleash) DeepCopy

func (in *Unleash) DeepCopy() *Unleash

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

func (*Unleash) DeepCopyInto

func (in *Unleash) DeepCopyInto(out *Unleash)

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

func (*Unleash) DeepCopyObject

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

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

func (*Unleash) GetInstanceSecretName

func (u *Unleash) GetInstanceSecretName() string

func (*Unleash) GetOperatorSecretName

func (u *Unleash) GetOperatorSecretName() string

func (*Unleash) IsReady

func (u *Unleash) IsReady() bool

IsReady returns true if the Unleash instance is ready. We define ready as having both the Available and Connection conditions set to true.

func (*Unleash) NamespacedInstanceSecretName

func (u *Unleash) NamespacedInstanceSecretName() types.NamespacedName

func (*Unleash) NamespacedName

func (u *Unleash) NamespacedName() types.NamespacedName

func (*Unleash) NamespacedNameWithSuffix

func (u *Unleash) NamespacedNameWithSuffix(suffix string) types.NamespacedName

func (*Unleash) NamespacedOperatorSecretName

func (u *Unleash) NamespacedOperatorSecretName(namespace string) types.NamespacedName

func (*Unleash) PublicApiURL

func (u *Unleash) PublicApiURL() string

func (*Unleash) PublicWebURL

func (u *Unleash) PublicWebURL() string

func (*Unleash) URL

func (u *Unleash) URL() string

type UnleashDatabaseConfig

type UnleashDatabaseConfig struct {
	// SecretName is the name of the secret containing the database credentials
	SecretName string `json:"secretName,omitempty"`

	// SecretURLKey is the key in the secret containing the database URL
	SecretURLKey string `json:"secretURLKey,omitempty"`

	// SecretUserKey is the key in the secret containing the database user
	SecretUserKey string `json:"secretUserKey,omitempty"`

	// SecretPassKey is the key in the secret containing the database password
	SecretPassKey string `json:"secretPassKey,omitempty"`

	// SecretPortKey is the key in the secret containing the database port
	SecretPortKey string `json:"secretPortKey,omitempty"`

	// SecretHostKey is the key in the secret containing the database host
	SecretHostKey string `json:"secretHostKey,omitempty"`

	// SecretDatabaseNameKey is the key in the secret containing the database name
	SecretDatabaseNameKey string `json:"secretDatabaseNameKey,omitempty"`

	// SecretSSLKey is the key in the secret containing the database SSL configuration
	SecretSSLKey string `json:"secretSSLKey,omitempty"`

	// URL defines the database URL
	URL string `json:"url,omitempty"`

	// DatabaseName defines the name of the database to be used
	DatabaseName string `json:"databaseName,omitempty"`

	// Host defines the host of the database to be used
	Host string `json:"host,omitempty"`

	// Port defines the port of the database to be used
	Port string `json:"port,omitempty"`

	// Username defines the username of the database to be used
	User string `json:"user,omitempty"`

	// SSL defines if the database connection should use SSL
	SSL string `json:"ssl,omitempty"`
}

UnleashDatabaseConfig defines the database configuration

func (*UnleashDatabaseConfig) DeepCopy

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

func (*UnleashDatabaseConfig) DeepCopyInto

func (in *UnleashDatabaseConfig) DeepCopyInto(out *UnleashDatabaseConfig)

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

type UnleashFederationConfig

type UnleashFederationConfig struct {
	// Enable enables Unleash federation
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// Clusters are the clusters to federate to
	// +kubebuilder:validation:Optional
	Clusters []string `json:"clusters,omitempty"`

	// Namespaces are the namespaces to federate to
	// +kubebuilder:validation:Optional
	Namespaces []string `json:"namespaces,omitempty"`

	// SecretNonce is the shared secret used for federation
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern=`^[a-z0-9]+$`
	SecretNonce string `json:"secretNonce,omitempty"`
}

UnleashFederationConfig defines the configuration for Unleash federation

func (*UnleashFederationConfig) DeepCopy

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

func (*UnleashFederationConfig) DeepCopyInto

func (in *UnleashFederationConfig) DeepCopyInto(out *UnleashFederationConfig)

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

type UnleashIngressConfig

type UnleashIngressConfig struct {
	// Enable enables the ingress
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// Host is the hostname to use for the ingress
	// +kubebuilder:validation:Optional
	Host string `json:"host,omitempty"`

	// Path is the path to use for the ingress
	// +kubebuilder:validation:Optional
	// +kubebuilder:default="/"
	Path string `json:"path,omitempty"`

	// TLS is the TLS configuration to use for the ingress
	// +kubebuilder:validation:Optional
	TLS *UnleashIngressTLSConfig `json:"tls,omitempty"`

	// Annotations is a map of annotations to add to the ingress
	// +kubebuilder:validation:Optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Class is the ingress class to use for the ingress
	// +kubebuilder:validation:Optional
	Class string `json:"class,omitempty"`
}

UnleashIngressConfig defines the ingress configuration

func (*UnleashIngressConfig) DeepCopy

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

func (*UnleashIngressConfig) DeepCopyInto

func (in *UnleashIngressConfig) DeepCopyInto(out *UnleashIngressConfig)

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

type UnleashIngressTLSConfig

type UnleashIngressTLSConfig struct {
	// SecretName is the name of the secret containing the TLS certificate
	// +kubebuilder:validation:Required
	SecretName string `json:"secretName,omitempty"`

	// SecretCertKey is the key in the secret containing the TLS certificate
	// +kubebuilder:validation:Required
	SecretCertKey string `json:"secretCertKey,omitempty"`

	// SecretKeyKey is the key in the secret containing the TLS key
	// +kubebuilder:validation:Required
	SecretKeyKey string `json:"secretKeyKey,omitempty"`
}

UnleashIngressTLSConfig defines the TLS configuration for the ingress

func (*UnleashIngressTLSConfig) DeepCopy

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

func (*UnleashIngressTLSConfig) DeepCopyInto

func (in *UnleashIngressTLSConfig) DeepCopyInto(out *UnleashIngressTLSConfig)

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

type UnleashList

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

UnleashList contains a list of Unleash +kubebuilder:object:root=true

func (*UnleashList) DeepCopy

func (in *UnleashList) DeepCopy() *UnleashList

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

func (*UnleashList) DeepCopyInto

func (in *UnleashList) DeepCopyInto(out *UnleashList)

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

func (*UnleashList) DeepCopyObject

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

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

type UnleashNetworkPolicyConfig

type UnleashNetworkPolicyConfig struct {
	// Enable enables the network policy
	// +kubebuilder:default=true
	Enabled bool `json:"enabled,omitempty"`

	// AllowDNS enables DNS traffic
	// +kubebuilder:default=true
	AllowDNS bool `json:"allowDNS,omitempty"`

	// AllowAllFromCluster enables all ingress traffic from the same cluster
	// +kubebuilder:default=false
	AllowAllFromCluster bool `json:"allowAll,omitempty"`

	// AllowAllFromSameNamespace enables all ingress traffic from the same namespace
	// +kubebuilder:default=false
	AllowAllFromSameNamespace bool `json:"allowAllSameNamespace,omitempty"`

	// AllowAllFromNamespaces is a list of namespaces to allow ingress traffic from
	// +kubebuilder:validation:Optional
	AllowAllFromNamespaces []string `json:"allowFromNamespaces,omitempty"`

	// ExtraIngressRules is a list of extra ingress rules to add to the network policy
	// +kubebuilder:validation:Optional
	ExtraIngressRules []networkingv1.NetworkPolicyIngressRule `json:"extraIngressRules,omitempty"`

	// ExtraEgressRules is a list of extra egress rules to add to the network policy
	// +kubebuilder:validation:Optional
	ExtraEgressRules []networkingv1.NetworkPolicyEgressRule `json:"extraEgressRules,omitempty"`
}

UnleashNetworkPolicyConfig defines the network policy configuration

func (*UnleashNetworkPolicyConfig) DeepCopy

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

func (*UnleashNetworkPolicyConfig) DeepCopyInto

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

type UnleashPrometheusConfig

type UnleashPrometheusConfig struct {
	// Enable enables the prometheus metrics endpoint
	// +kubebuilder:default=true
	Enabled bool `json:"enabled,omitempty"`
}

UnleashPrometheusConfig defines the prometheus configuration

func (*UnleashPrometheusConfig) DeepCopy

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

func (*UnleashPrometheusConfig) DeepCopyInto

func (in *UnleashPrometheusConfig) DeepCopyInto(out *UnleashPrometheusConfig)

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

type UnleashSpec

type UnleashSpec struct {
	// Size is the size of the Unleash deployment.
	// +kubebuilder:default=1
	Size int32 `json:"size,omitempty"`

	// CustomImage points to a custom image, which overrides all other version settings.
	// Use at your own risk.
	// +kubebuilder:validation:Optional
	CustomImage string `json:"customImage,omitempty"`

	// Prometheus defines the Prometheus metrics collection configuration.
	// +kubebuilder:validation:Optional
	Prometheus UnleashPrometheusConfig `json:"prometheus,omitempty"`

	// Database is the database configuration.
	// +kubebuilder:validation:Required
	Database UnleashDatabaseConfig `json:"database,omitempty"`

	// WebIngress defines the ingress configuration for the web interface.
	// +kubebuilder:validation:Optional
	WebIngress UnleashIngressConfig `json:"webIngress,omitempty"`

	// ApiIngress defines the ingress for the endpoints of Unleash.
	// +kubebuilder:validation:Optional
	ApiIngress UnleashIngressConfig `json:"apiIngress,omitempty"`

	// NetworkPolicy defines the network policy configuration.
	// +kubebuilder:validation:Optional
	NetworkPolicy UnleashNetworkPolicyConfig `json:"networkPolicy,omitempty"`

	// ExtraEnvVars is a list of extra environment variables to add to the deployment.
	// +kubebuilder:validation:Optional
	ExtraEnvVars []corev1.EnvVar `json:"extraEnvVars,omitempty"`

	// ExtraVolumes is a list of extra volume mounts to add to the deployment.
	// +kubebuilder:validation:Optional
	ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`

	// ExtraVolumeMounts is a list of extra volume mounts to add to the deployment.
	// +kubebuilder:validation:Optional
	ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`

	// ExtraContainers is a list of extra containers to add to the deployment.
	// +kubebuilder:validation:Optional
	ExtraContainers []corev1.Container `json:"extraContainers,omitempty"`

	// ExistingServiceAccountName is the name of an already existing Kubernetes service account.
	// +kubebuilder:validation:Optional
	ExistingServiceAccountName string `json:"existingServiceAccountName,omitempty"`

	// Resources are the resource requests and limits for the Unleash deployment.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default:={requests: {cpu: "300m", memory: "256Mi"}, limits: { memory: "512Mi"}}
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Federation is the configuration for Unleash federation.
	// +kubebuilder:validation:Optional
	Federation UnleashFederationConfig `json:"federation,omitempty"`

	// PodAnnotations are additional annotations to add to the Unleash pods.
	// +kubebuilder:validation:Optional
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

	// PodLabels are additional labels to add to the Unleash pods.
	// +kubebuilder:validation:Optional
	PodLabels map[string]string `json:"podLabels,omitempty"`
}

UnleashSpec defines the desired state of Unleash UnleashSpec represents the specification for an Unleash deployment.

func (*UnleashSpec) DeepCopy

func (in *UnleashSpec) DeepCopy() *UnleashSpec

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

func (*UnleashSpec) DeepCopyInto

func (in *UnleashSpec) DeepCopyInto(out *UnleashSpec)

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

type UnleashStatus

type UnleashStatus struct {
	// Represents the observations of a Unleash's current state.
	// Unleash.status.conditions.type are: "Reconciled", "Connected", and "Degraded"
	// Unleash.status.conditions.status are one of True, False, Unknown.
	// Unleash.status.conditions.reason the value should be a CamelCase string and producers of specific
	// condition types may define expected values and meanings for this field, and whether the values
	// are considered a guaranteed API.
	// Unleash.status.conditions.Message is a human readable message indicating details about the transition.
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Reconciled is true when the Unleash resources hav been reconciled
	// successfully.
	// This is used for kubectl printing purposes. Rather than relying on this
	// value, check the conditions instead.
	// +kubebuilder:default=false
	Reconciled bool `json:"reconciled,omitempty"`

	// Connected is true when the Unleash resource has been connected to the Unleash server
	// This is used for kubectl printing purposes. Rather than relying on this
	// value, check the conditions instead.
	// +kubebuilder:default=false
	Connected bool `json:"connected,omitempty"`

	// Version is the reported version of the Unleash server
	// +kubebuilder:default="unknown"
	Version string `json:"version,omitempty"`
}

UnleashStatus defines the observed state of Unleash

func (*UnleashStatus) DeepCopy

func (in *UnleashStatus) DeepCopy() *UnleashStatus

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

func (*UnleashStatus) DeepCopyInto

func (in *UnleashStatus) DeepCopyInto(out *UnleashStatus)

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