v1alpha1

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: BSD-3-Clause Imports: 7 Imported by: 4

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the nginx v1alpha1 API group +kubebuilder:object:generate=true +groupName=nginx.tsuru.io

Index

Constants

View Source
const (
	// ConfigKindConfigMap is a Kind of configuration that points to a configmap
	ConfigKindConfigMap = ConfigKind("ConfigMap")
	// ConfigKindInline is a kinda of configuration that is setup as a annotation on the Pod
	// and is inject as a file on the container using the Downward API.
	ConfigKindInline = ConfigKind("Inline")
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "nginx.tsuru.io", 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 ConfigKind

type ConfigKind string

type ConfigRef

type ConfigRef struct {
	// Kind of the config object. Defaults to "ConfigMap".
	Kind ConfigKind `json:"kind"`
	// Name of the ConfigMap object with "nginx.conf" key inside. It must reside
	// in the same Namespace as the Nginx resource. Required when Kind is "ConfigMap".
	//
	// It's mutually exclusive with Value field.
	// +optional
	Name string `json:"name,omitempty"`
	// Value is the raw Nginx configuration. Required when Kind is "Inline".
	//
	// It's mutually exclusive with Name field.
	// +optional
	Value string `json:"value,omitempty"`
}

ConfigRef is a reference to a config object.

func (*ConfigRef) DeepCopy

func (in *ConfigRef) DeepCopy() *ConfigRef

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

func (*ConfigRef) DeepCopyInto

func (in *ConfigRef) DeepCopyInto(out *ConfigRef)

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

type DeploymentStatus added in v0.8.2

type DeploymentStatus struct {
	// Name is the name of the Deployment created by nginx
	Name string `json:"name"`
}

func (*DeploymentStatus) DeepCopy added in v0.8.2

func (in *DeploymentStatus) DeepCopy() *DeploymentStatus

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

func (*DeploymentStatus) DeepCopyInto added in v0.8.2

func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus)

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

type FilesRef

type FilesRef struct {
	// Name points to a ConfigMap resource (in the same namespace) which holds
	// the files.
	Name string `json:"name"`
	// Files maps each key entry from the ConfigMap to its relative location on
	// the nginx filesystem.
	// +optional
	Files map[string]string `json:"files,omitempty"`
}

FilesRef is a reference to arbitrary files stored into a ConfigMap in the cluster.

func (*FilesRef) DeepCopy

func (in *FilesRef) DeepCopy() *FilesRef

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

func (*FilesRef) DeepCopyInto

func (in *FilesRef) DeepCopyInto(out *FilesRef)

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

type IngressStatus added in v0.8.0

type IngressStatus struct {
	// Name is the name of the Ingress created by nginx
	Name      string   `json:"name"`
	IPs       []string `json:"ips,omitempty"`
	Hostnames []string `json:"hostnames,omitempty"`
}

func (*IngressStatus) DeepCopy added in v0.8.0

func (in *IngressStatus) DeepCopy() *IngressStatus

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

func (*IngressStatus) DeepCopyInto added in v0.8.0

func (in *IngressStatus) DeepCopyInto(out *IngressStatus)

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

type Nginx

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

	Spec   NginxSpec   `json:"spec,omitempty"`
	Status NginxStatus `json:"status,omitempty"`
}

Nginx is the Schema for the nginxes API

func (*Nginx) DeepCopy

func (in *Nginx) DeepCopy() *Nginx

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

func (*Nginx) DeepCopyInto

func (in *Nginx) DeepCopyInto(out *Nginx)

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

func (*Nginx) DeepCopyObject

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

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

type NginxCacheSpec

type NginxCacheSpec struct {
	// InMemory if set to true creates a memory backed volume.
	InMemory bool `json:"inMemory,omitempty"`
	// Path is the mount path for the cache volume.
	Path string `json:"path"`
	// Size is the maximum size allowed for the cache volume.
	// +optional
	Size *resource.Quantity `json:"size,omitempty"`
}

func (*NginxCacheSpec) DeepCopy

func (in *NginxCacheSpec) DeepCopy() *NginxCacheSpec

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

func (*NginxCacheSpec) DeepCopyInto

func (in *NginxCacheSpec) DeepCopyInto(out *NginxCacheSpec)

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

type NginxIngress added in v0.8.0

type NginxIngress struct {
	// Annotations are extra annotations for the Ingress resource.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
	// Labels are extra labels for the Ingress resource.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// IngressClassName is the class to be set on Ingress.
	// +optional
	IngressClassName *string `json:"ingressClassName,omitempty"`
}

func (*NginxIngress) DeepCopy added in v0.8.0

func (in *NginxIngress) DeepCopy() *NginxIngress

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

func (*NginxIngress) DeepCopyInto added in v0.8.0

func (in *NginxIngress) DeepCopyInto(out *NginxIngress)

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

type NginxLifecycle

type NginxLifecycle struct {
	PostStart *NginxLifecycleHandler `json:"postStart,omitempty"`
	PreStop   *NginxLifecycleHandler `json:"preStop,omitempty"`
}

func (*NginxLifecycle) DeepCopy

func (in *NginxLifecycle) DeepCopy() *NginxLifecycle

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

func (*NginxLifecycle) DeepCopyInto

func (in *NginxLifecycle) DeepCopyInto(out *NginxLifecycle)

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

type NginxLifecycleHandler

type NginxLifecycleHandler struct {
	Exec *corev1.ExecAction `json:"exec,omitempty"`
}

func (*NginxLifecycleHandler) DeepCopy

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

func (*NginxLifecycleHandler) DeepCopyInto

func (in *NginxLifecycleHandler) DeepCopyInto(out *NginxLifecycleHandler)

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

type NginxList

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

NginxList contains a list of Nginx

func (*NginxList) DeepCopy

func (in *NginxList) DeepCopy() *NginxList

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

func (*NginxList) DeepCopyInto

func (in *NginxList) DeepCopyInto(out *NginxList)

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

func (*NginxList) DeepCopyObject

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

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

type NginxPodTemplateSpec

type NginxPodTemplateSpec struct {
	// Affinity to be set on the nginx pod.
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// NodeSelector to be set on the nginx pod.
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// Annotations are custom annotations to be set into Pod.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
	// Labels are custom labels to be added into Pod.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// HostNetwork enabled causes the pod to use the host's network namespace.
	// +optional
	HostNetwork bool `json:"hostNetwork,omitempty"`
	// Ports is the list of ports used by nginx.
	// +optional
	Ports []corev1.ContainerPort `json:"ports,omitempty"`
	// TerminationGracePeriodSeconds defines the max duration seconds which the
	// pod needs to terminate gracefully. Defaults to pod's
	// terminationGracePeriodSeconds default value.
	// +optional
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
	// PodSecurityContext configures security attributes for the nginx pod.
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// ContainerSecurityContext configures security attributes for the nginx container.
	// +optional
	ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`

	// Volumes that will attach to nginx instances
	// +optional
	Volumes []corev1.Volume `json:"volumes,omitempty"`
	// VolumeMounts will mount volume declared above in directories
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	// InitContainers are executed in order prior to containers being started
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
	// +optional
	InitContainers []corev1.Container `json:"initContainers,omitempty"`
	// Containers are executed in parallel to the main nginx container
	// +optional
	Containers []corev1.Container `json:"containers,omitempty"`
	// RollingUpdate defines params to control the desired behavior of rolling update.
	// +optional
	RollingUpdate *appsv1.RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
	// Toletarion defines list of taints that pod can tolerate.
	// +optional
	Toleration []corev1.Toleration `json:"toleration,omitempty"`
	// ServiceAccountName is the name of the ServiceAccount to use to run this nginx instance.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// TopologySpreadConstraints describes how a group of pods ought to spread across topology domains.
	// +optional
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

func (*NginxPodTemplateSpec) DeepCopy

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

func (*NginxPodTemplateSpec) DeepCopyInto

func (in *NginxPodTemplateSpec) DeepCopyInto(out *NginxPodTemplateSpec)

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

type NginxService

type NginxService struct {
	// Type is the type of the service. Defaults to the default service type value.
	// +optional
	Type corev1.ServiceType `json:"type,omitempty"`
	// LoadBalancerIP is an optional load balancer IP for the service.
	// +optional
	LoadBalancerIP string `json:"loadBalancerIP,omitempty"`
	// Labels are extra labels for the service.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// Annotations are extra annotations for the service.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
	// ExternalTrafficPolicy defines whether external traffic will be routed to
	// node-local or cluster-wide endpoints. Defaults to the default Service
	// externalTrafficPolicy value.
	// +optional
	ExternalTrafficPolicy corev1.ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty"`
	// UsePodSelector defines whether Service should automatically map the
	// endpoints using the pod's label selector. Defaults to true.
	// +optional
	UsePodSelector *bool `json:"usePodSelector,omitempty"`
}

func (*NginxService) DeepCopy

func (in *NginxService) DeepCopy() *NginxService

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

func (*NginxService) DeepCopyInto

func (in *NginxService) DeepCopyInto(out *NginxService)

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

type NginxSpec

type NginxSpec struct {
	// Replicas is the number of desired pods. Defaults to the default deployment
	// replicas value.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
	// Image is the container image name. Defaults to "nginx:latest".
	// +optional
	Image string `json:"image,omitempty"`
	// Config is a reference to the NGINX config object which stores the NGINX
	// configuration file. When provided the file is mounted in NGINX container on
	// "/etc/nginx/nginx.conf".
	// +optional
	Config *ConfigRef `json:"config,omitempty"`
	// TLS configuration.
	// +optional
	TLS []NginxTLS `json:"tls,omitempty"`
	// Template used to configure the nginx pod.
	// +optional
	PodTemplate NginxPodTemplateSpec `json:"podTemplate,omitempty"`
	// Service to expose the nginx pod
	// +optional
	Service *NginxService `json:"service,omitempty"`
	// Ingress defines a convenient way to expose the Nginx service.
	// +optional
	Ingress *NginxIngress `json:"ingress,omitempty"`
	// ExtraFiles references to additional files into a object in the cluster.
	// These additional files will be mounted on `/etc/nginx/extra_files`.
	// +optional
	ExtraFiles *FilesRef `json:"extraFiles,omitempty"`
	// HealthcheckPath defines the endpoint used to check whether instance is
	// working or not.
	// +optional
	HealthcheckPath string `json:"healthcheckPath,omitempty"`
	// Resources requirements to be set on the NGINX container.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
	// Cache allows configuring a cache volume for nginx to use.
	// +optional
	Cache NginxCacheSpec `json:"cache,omitempty"`
	// Lifecycle describes actions that should be executed when
	// some event happens to nginx container.
	// +optional
	Lifecycle *NginxLifecycle `json:"lifecycle,omitempty"`
}

NginxSpec defines the desired state of Nginx

func (*NginxSpec) DeepCopy

func (in *NginxSpec) DeepCopy() *NginxSpec

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

func (*NginxSpec) DeepCopyInto

func (in *NginxSpec) DeepCopyInto(out *NginxSpec)

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

type NginxStatus

type NginxStatus struct {
	// CurrentReplicas is the last observed number from the NGINX object.
	CurrentReplicas int32 `json:"currentReplicas,omitempty"`
	// PodSelector is the NGINX's pod label selector.
	PodSelector string `json:"podSelector,omitempty"`

	Deployments []DeploymentStatus `json:"deployments,omitempty"`
	Services    []ServiceStatus    `json:"services,omitempty"`
	Ingresses   []IngressStatus    `json:"ingresses,omitempty"`
}

NginxStatus defines the observed state of Nginx

func (*NginxStatus) DeepCopy

func (in *NginxStatus) DeepCopy() *NginxStatus

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

func (*NginxStatus) DeepCopyInto

func (in *NginxStatus) DeepCopyInto(out *NginxStatus)

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

type NginxTLS added in v0.8.0

type NginxTLS struct {
	// SecretName is the name of the Secret which contains the certificate-key
	// pair. It must reside in the same Namespace as the Nginx resource.
	//
	// NOTE: The Secret should follow the Kubernetes TLS secrets type.
	// More info: https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets.
	SecretName string `json:"secretName"`
	// Hosts are a list of hosts included in the TLS certificate. Defaults to the
	// wildcard of hosts: "*".
	// +optional
	Hosts []string `json:"hosts,omitempty"`
}

func (*NginxTLS) DeepCopy added in v0.8.0

func (in *NginxTLS) DeepCopy() *NginxTLS

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

func (*NginxTLS) DeepCopyInto added in v0.8.0

func (in *NginxTLS) DeepCopyInto(out *NginxTLS)

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

type ServiceStatus

type ServiceStatus struct {
	// Name is the name of the Service created by nginx
	Name      string   `json:"name"`
	IPs       []string `json:"ips,omitempty"`
	Hostnames []string `json:"hostnames,omitempty"`
}

func (*ServiceStatus) DeepCopy

func (in *ServiceStatus) DeepCopy() *ServiceStatus

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

func (*ServiceStatus) DeepCopyInto

func (in *ServiceStatus) DeepCopyInto(out *ServiceStatus)

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