v1alpha1

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 12 Imported by: 3

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the approuting v1alpha1 API group +kubebuilder:object:generate=true +groupName=approuting.kubernetes.azure.com

Index

Constants

View Source
const (
	// ConditionTypeAvailable indicates whether the NGINX Ingress Controller is available. Its condition status is one of
	// - "True" when the NGINX Ingress Controller is available and can be used
	// - "False" when the NGINX Ingress Controller is not available and cannot offer full functionality
	// - "Unknown" when the NGINX Ingress Controller's availability cannot be determined
	ConditionTypeAvailable = "Available"

	// ConditionTypeIngressClassReady indicates whether the IngressClass exists. Its condition status is one of
	// - "True" when the IngressClass exists
	// - "False" when the IngressClass does not exist
	// - "Collision" when the IngressClass exists, but it's not owned by the NginxIngressController.
	// - "Unknown" when the IngressClass's existence cannot be determined
	ConditionTypeIngressClassReady = "IngressClassReady"

	// ConditionTypeControllerAvailable indicates whether the NGINX Ingress Controller deployment is available. Its condition status is one of
	// - "True" when the NGINX Ingress Controller deployment is available
	// - "False" when the NGINX Ingress Controller deployment is not available
	// - "Unknown" when the NGINX Ingress Controller deployment's availability cannot be determined
	ConditionTypeControllerAvailable = "ControllerAvailable"

	// ConditionTypeProgressing indicates whether the NGINX Ingress Controller availability is progressing. Its condition status is one of
	// - "True" when the NGINX Ingress Controller availability is progressing
	// - "False" when the NGINX Ingress Controller availability is not progressing
	// - "Unknown" when the NGINX Ingress Controller availability's progress cannot be determined
	ConditionTypeProgressing = "Progressing"
)
View Source
const (
	// MaxCollisions is the maximum number of collisions allowed when generating a name for a managed resource. This corresponds to the status.CollisionCount
	MaxCollisions = 5
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "approuting.kubernetes.azure.com", Version: "v1alpha1"}

	// 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 DefaultSSLCertificate added in v0.2.2

type DefaultSSLCertificate struct {
	// Secret is a struct that holds the name and namespace fields used for the default ssl secret
	// +optional
	Secret *Secret `json:"secret,omitempty"`

	// Secret in the form of a Key Vault URI
	// +optional
	KeyVaultURI *string `json:"keyVaultURI"`
}

DefaultSSLCertificate holds a secret in the form of a secret struct with name and namespace properties or a key vault uri +kubebuilder:validation:MaxProperties=1 +kubebuilder:validation:XValidation:rule="(isURL(self.keyVaultURI) || !has(self.keyVaultURI))"

func (*DefaultSSLCertificate) DeepCopy added in v0.2.2

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

func (*DefaultSSLCertificate) DeepCopyInto added in v0.2.2

func (in *DefaultSSLCertificate) DeepCopyInto(out *DefaultSSLCertificate)

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

type ManagedObjectReference

type ManagedObjectReference struct {
	// Name is the name of the managed object
	Name string `json:"name"`

	// Namespace is the namespace of the managed object. If not specified, the resource is cluster-scoped
	// +optional
	Namespace string `json:"namespace"`

	// Kind is the kind of the managed object
	Kind string `json:"kind"`

	// APIGroup is the API group of the managed object. If not specified, the resource is in the core API group
	// +optional
	APIGroup string `json:"apiGroup"`
}

ManagedObjectReference is a reference to an object

func (*ManagedObjectReference) DeepCopy

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

func (*ManagedObjectReference) DeepCopyInto

func (in *ManagedObjectReference) DeepCopyInto(out *ManagedObjectReference)

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

type NginxIngressController

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

	// +required
	// +kubebuilder:default:={"ingressClassName":"nginx.approuting.kubernetes.azure.com","controllerNamePrefix":"nginx"}
	Spec NginxIngressControllerSpec `json:"spec"` // ^ for the above thing https://github.com/kubernetes-sigs/controller-tools/issues/622 defaulting doesn't cascade, so we have to define it all. Comment on this line so it's not in crd spec.

	// +optional
	Status NginxIngressControllerStatus `json:"status,omitempty"`
}

NginxIngressController is the Schema for the nginxingresscontrollers API

func (*NginxIngressController) Collides added in v0.1.2

Collides returns whether the fields in this NginxIngressController would collide with an existing resources making it impossible for this NginxIngressController to become available. This should be run before an NginxIngressController is created. Returns whether there's a collision, the collision reason, and an error if one occurred. The collision reason is something that the user can use to understand and resolve.

func (*NginxIngressController) DeepCopy

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

func (*NginxIngressController) DeepCopyInto

func (in *NginxIngressController) DeepCopyInto(out *NginxIngressController)

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

func (*NginxIngressController) DeepCopyObject

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

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

func (*NginxIngressController) GetCondition

func (n *NginxIngressController) GetCondition(t string) *metav1.Condition

func (*NginxIngressController) SetCondition

func (n *NginxIngressController) SetCondition(c metav1.Condition)

type NginxIngressControllerList

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

NginxIngressControllerList contains a list of NginxIngressController

func (*NginxIngressControllerList) DeepCopy

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

func (*NginxIngressControllerList) DeepCopyInto

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

func (*NginxIngressControllerList) DeepCopyObject

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

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

type NginxIngressControllerSpec

type NginxIngressControllerSpec struct {
	// IngressClassName is the name of the IngressClass that will be used for the NGINX Ingress Controller. Defaults to metadata.name if
	// not specified.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:default:=nginx.approuting.kubernetes.azure.com
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
	// +kubebuilder:validation:Pattern=`^[a-z0-9][-a-z0-9\.]*[a-z0-9]$`
	// +kubebuilder:validation:Required
	IngressClassName string `json:"ingressClassName"`

	// ControllerNamePrefix is the name to use for the managed NGINX Ingress Controller resources.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=60
	// +kubebuilder:default:=nginx
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
	// +kubebuilder:validation:Pattern=`^[a-z0-9][-a-z0-9]*[a-z0-9]$`
	// +kubebuilder:validation:Required
	ControllerNamePrefix string `json:"controllerNamePrefix"`

	// LoadBalancerAnnotations is a map of annotations to apply to the NGINX Ingress Controller's Service. Common annotations
	// will be from the Azure LoadBalancer annotations here https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#loadbalancer-annotations
	// +optional
	LoadBalancerAnnotations map[string]string `json:"loadBalancerAnnotations,omitempty"`

	// DefaultSSLCertificate defines whether the NginxIngressController should use a certain SSL certificate by default.
	// If this field is omitted, no default certificate will be used.
	// +optional
	DefaultSSLCertificate *DefaultSSLCertificate `json:"defaultSSLCertificate,omitempty"`

	// Scaling defines configuration options for how the Ingress Controller scales
	// +optional
	Scaling *Scaling `json:"scaling,omitempty"`
}

NginxIngressControllerSpec defines the desired state of NginxIngressController

func (*NginxIngressControllerSpec) DeepCopy

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

func (*NginxIngressControllerSpec) DeepCopyInto

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

type NginxIngressControllerStatus

type NginxIngressControllerStatus struct {
	// Conditions is an array of current observed conditions for the NGINX Ingress Controller
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions"`

	// ControllerReplicas is the desired number of replicas of the NGINX Ingress Controller
	// +optional
	ControllerReplicas int32 `json:"controllerReplicas"`

	// ControllerReadyReplicas is the number of ready replicas of the NGINX Ingress Controller deployment
	// +optional
	ControllerReadyReplicas int32 `json:"controllerReadyReplicas"`

	// ControllerAvailableReplicas is the number of available replicas of the NGINX Ingress Controller deployment
	// +optional
	ControllerAvailableReplicas int32 `json:"controllerAvailableReplicas"`

	// ControllerUnavailableReplicas is the number of unavailable replicas of the NGINX Ingress Controller deployment
	// +optional
	ControllerUnavailableReplicas int32 `json:"controllerUnavailableReplicas"`

	// Count of hash collisions for the managed resources. The App Routing Operator uses this field
	// as a collision avoidance mechanism when it needs to create the name for the managed resources.
	// +optional
	// +kubebuilder:validation:Maximum=5
	CollisionCount int32 `json:"collisionCount"`

	// ManagedResourceRefs is a list of references to the managed resources
	// +optional
	ManagedResourceRefs []ManagedObjectReference `json:"managedResourceRefs,omitempty"`
}

NginxIngressControllerStatus defines the observed state of NginxIngressController

func (*NginxIngressControllerStatus) DeepCopy

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

func (*NginxIngressControllerStatus) DeepCopyInto

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

type Scaling added in v0.2.2

type Scaling struct {
	// MinReplicas is the lower limit for the number of Ingress Controller replicas. It defaults to 2 pods.
	// +kubebuilder:validation:Minimum=1
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// MaxReplicas is the upper limit for the number of Ingress Controller replicas. It defaults to 100 pods.
	// +kubebuilder:validation:Minimum=1
	// +optional
	MaxReplicas *int32 `json:"maxReplicas,omitempty"`

	// Threshold defines how quickly the Ingress Controller pods should scale based on workload. Rapid means the Ingress Controller
	// will scale quickly and aggressively, which is the best choice for handling sudden and significant traffic spikes. Steady
	// is the opposite, prioritizing cost-effectiveness. Steady is the best choice when fewer replicas handling more work is desired or when
	// traffic isn't expected to fluctuate. Balanced is a good mix between the two that works for most use-cases. If unspecified, this field
	// defaults to balanced.
	// +kubebuilder:validation:Enum=rapid;balanced;steady;
	// +optional
	Threshold *Threshold `json:"threshold,omitempty"`
}

Scaling holds specification for how the Ingress Controller scales +kubebuilder:validation:XValidation:rule="(!has(self.minReplicas)) || (!has(self.maxReplicas)) || (self.minReplicas <= self.maxReplicas)"

func (*Scaling) DeepCopy added in v0.2.2

func (in *Scaling) DeepCopy() *Scaling

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

func (*Scaling) DeepCopyInto added in v0.2.2

func (in *Scaling) DeepCopyInto(out *Scaling)

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

type Secret added in v0.2.2

type Secret struct {
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:Pattern=`^[a-z0-9][-a-z0-9\.]*[a-z0-9]$`
	Name string `json:"name"`

	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:Pattern=`^[a-z0-9][-a-z0-9\.]*[a-z0-9]$`
	Namespace string `json:"namespace"`
}

Secret is a struct that holds a name and namespace to be used in DefaultSSLCertificate

func (*Secret) DeepCopy added in v0.2.2

func (in *Secret) DeepCopy() *Secret

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

func (*Secret) DeepCopyInto added in v0.2.2

func (in *Secret) DeepCopyInto(out *Secret)

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

type Threshold added in v0.2.2

type Threshold string
const (
	RapidThreshold    Threshold = "rapid"
	BalancedThreshold Threshold = "balanced"
	SteadyThreshold   Threshold = "steady"
)

Jump to

Keyboard shortcuts

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