v1

package
v0.0.0-...-ac4f492 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the db v1 API group +kubebuilder:object:generate=true +groupName=db.gogo.io

Index

Constants

View Source
const (
	DEBUG = "DEBUG"
	Empty = "EMPTY" // crd有bug,空的env会被填上值,使用empty占位符
)

Variables

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

func GetEnv

func GetEnv(env []corev1.EnvVar, key string) string

func LookupEnv

func LookupEnv(env []corev1.EnvVar, key string) (string, bool)

func MergeEnv

func MergeEnv(src, dst []corev1.EnvVar) []corev1.EnvVar

func SetEnv

func SetEnv(env []corev1.EnvVar, key, val string) []corev1.EnvVar

func SetEnvIfUnset

func SetEnvIfUnset(env []corev1.EnvVar, key, def string) []corev1.EnvVar

Types

type Etcd

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

	Spec   EtcdSpec   `json:"spec,omitempty"`
	Status EtcdStatus `json:"status,omitempty"`
}

Etcd is the Schema for the etcds API

func (*Etcd) DeepCopy

func (in *Etcd) DeepCopy() *Etcd

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

func (*Etcd) DeepCopyInto

func (in *Etcd) DeepCopyInto(out *Etcd)

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

func (*Etcd) DeepCopyObject

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

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

func (*Etcd) Default

func (in *Etcd) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*Etcd) SetupWebhookWithManager

func (in *Etcd) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Etcd) ValidateCreate

func (in *Etcd) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Etcd) ValidateDelete

func (in *Etcd) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Etcd) ValidateUpdate

func (in *Etcd) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type EtcdList

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

EtcdList contains a list of Etcd

func (*EtcdList) DeepCopy

func (in *EtcdList) DeepCopy() *EtcdList

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

func (*EtcdList) DeepCopyInto

func (in *EtcdList) DeepCopyInto(out *EtcdList)

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

func (*EtcdList) DeepCopyObject

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

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

type EtcdSpec

type EtcdSpec struct {
	Members      int    `json:"members,omitempty"`
	ExternalHost string `json:"externalHost,omitempty"`

	// quota 配额
	Cpu              string `json:"cpu,omitempty"`
	Memory           string `json:"memory,omitempty"`
	Storage          string `json:"storage,omitempty"`
	StorageClassName string `json:"storageClassName,omitempty"`

	Image            string                        `json:"image,omitempty"`
	ImagePullPolicy  corev1.PullPolicy             `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"`
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,15,rep,name=imagePullSecrets"`

	ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,8,opt,name=serviceAccountName"`

	Env []corev1.EnvVar `json:"env,omitempty"`

	PodSpec PodSpec `json:"podSpec,omitempty"`
}

EtcdSpec defines the desired state of Etcd

func (*EtcdSpec) DeepCopy

func (in *EtcdSpec) DeepCopy() *EtcdSpec

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

func (*EtcdSpec) DeepCopyInto

func (in *EtcdSpec) DeepCopyInto(out *EtcdSpec)

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

type EtcdStatus

type EtcdStatus struct {
	Status      NodeStatus         `json:"status"`
	ConnectAddr string             `json:"connectAddr,omitempty"`
	Conditions  []metav1.Condition `json:"conditions,omitempty"`
}

EtcdStatus defines the observed state of Etcd

func (*EtcdStatus) DeepCopy

func (in *EtcdStatus) DeepCopy() *EtcdStatus

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

func (*EtcdStatus) DeepCopyInto

func (in *EtcdStatus) DeepCopyInto(out *EtcdStatus)

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

type NodeStatus

type NodeStatus string
const (
	StatusReady        NodeStatus = "Ready"
	StatusPartialReady NodeStatus = "PartialReady"
	StatusFailed       NodeStatus = "Failed"
	StatusUnknown      NodeStatus = "Unknown"
)

type PodSpec

type PodSpec struct {
	HostAliases     []corev1.HostAlias         `json:"hostAliases,omitempty" patchStrategy:"merge" patchMergeKey:"ip" protobuf:"bytes,23,rep,name=hostAliases"`
	RestartPolicy   corev1.RestartPolicy       `json:"restartPolicy,omitempty" protobuf:"bytes,3,opt,name=restartPolicy,casttype=RestartPolicy"`
	NodeSelector    map[string]string          `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"`
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,14,opt,name=securityContext"`
	Affinity        *corev1.Affinity           `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"`
	Tolerations     []corev1.Toleration        `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`
}

copy from corev1.PodSpec

func (*PodSpec) DeepCopy

func (in *PodSpec) DeepCopy() *PodSpec

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

func (*PodSpec) DeepCopyInto

func (in *PodSpec) DeepCopyInto(out *PodSpec)

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