v1

package
v0.0.0-...-dc0d138 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the devops v1 API group +kubebuilder:object:generate=true +groupName=devops.github.com

Index

Constants

View Source
const (
	// ConfigKindConfigMap 配置
	ConfigKindConfigMap = ConfigKind("ConfigMap")
	// ConfigKindInline 在Pod上设置为注释的配置, 并使用Downward API作为文件注入到容器中.
	ConfigKindInline = ConfigKind("Inline")
	Kind             = "Nginx"
)

Variables

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

type DeploymentStatus struct {
	Name string `json:"name"`
}

func (*DeploymentStatus) DeepCopy

func (in *DeploymentStatus) DeepCopy() *DeploymentStatus

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

func (*DeploymentStatus) DeepCopyInto

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

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

type IngressStatus

type IngressStatus struct {
	Name string `json:"name"`
}

func (*IngressStatus) DeepCopy

func (in *IngressStatus) DeepCopy() *IngressStatus

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

func (*IngressStatus) DeepCopyInto

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 NginxIngress

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

func (in *NginxIngress) DeepCopy() *NginxIngress

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

func (*NginxIngress) DeepCopyInto

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

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 使用默认权限即可:kubebuilder:object:root=true

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 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是所需pod的数量。默认为 default deployment
	// replicas value.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
	// Image是容器镜像名称。默认值为 "nginx:latest".
	// +optional
	Image string `json:"image,omitempty"`
	// Config是对NGINX配置对象的引用,该对象存储NGINX配置文件。如果提供该文件,则将其装载在上的NGINX容器中
	// "/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 PodTemplateSpec `json:"podTemplate,omitempty"`
	// Service 服务配置
	// +optional
	Service *NginxService `json:"service,omitempty"`
	// Ingress 配置
	// +optional
	Ingress *NginxIngress `json:"ingress,omitempty"`
	// 健康检查路径
	// working or not.
	// +optional
	HealthcheckPath string `json:"healthcheckPath,omitempty"`
	// Resources 资源限制
	// +optional
	Resources coreV1.ResourceRequirements `json:"resources,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 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

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

func (in *NginxTLS) DeepCopy() *NginxTLS

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

func (*NginxTLS) DeepCopyInto

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

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

type PodTemplateSpec

type PodTemplateSpec 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"`
	// SecurityContext configures security attributes for the nginx pod.
	// +optional
	SecurityContext *coreV1.SecurityContext `json:"securityContext,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"`
	// Toleration 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"`
}

func (*PodTemplateSpec) DeepCopy

func (in *PodTemplateSpec) DeepCopy() *PodTemplateSpec

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

func (*PodTemplateSpec) DeepCopyInto

func (in *PodTemplateSpec) DeepCopyInto(out *PodTemplateSpec)

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

type ServiceStatus

type ServiceStatus struct {
	Name string `json:"name"`
}

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