v1alpha1

package
v0.0.0-...-0c61176 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the bgrouter v1alpha1 API group +kubebuilder:object:generate=true +groupName=bgrouter.yashirook.github.io

Index

Constants

This section is empty.

Variables

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

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

	Spec   BGRouterSpec   `json:"spec,omitempty"`
	Status BGRouterStatus `json:"status,omitempty"`
}

BGRouter is the Schema for the bgrouters API

func (*BGRouter) DeepCopy

func (in *BGRouter) DeepCopy() *BGRouter

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

func (*BGRouter) DeepCopyInto

func (in *BGRouter) DeepCopyInto(out *BGRouter)

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

func (*BGRouter) DeepCopyObject

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

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

type BGRouterList

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

BGRouterList contains a list of BGRouter

func (*BGRouterList) DeepCopy

func (in *BGRouterList) DeepCopy() *BGRouterList

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

func (*BGRouterList) DeepCopyInto

func (in *BGRouterList) DeepCopyInto(out *BGRouterList)

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

func (*BGRouterList) DeepCopyObject

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

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

type BGRouterSpec

type BGRouterSpec struct {
	// ActiveColor specifies the color label (blue or green) assigned to the pods to
	// witch you want to direct traffic.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=blue;green
	ActiveColor string `json:"activeColor,omitempty"`

	// ActiveReplicas is the number of pods with active color labels.
	// +kubebuilder:default=1
	// +kubebuilder:validation:Minimum=0
	// +optional
	ActiveReplicas int32 `json:"activeReplicas,omitempty"`

	// IdleReplicas is the number of pods with idle color labels.
	// +kubebuilder:default=1
	// +kubebuilder:validation:Minimum=0
	// +optional
	IdleReplicas int32 `json:"idleReplicas,omitempty"`

	// HpaBaseName is suffix using for name of hpa resource managed by bgrouter controller.
	// +optional
	HpaBaseName string `json:"hpaBaseName,omitempty"`

	// DeploymentBaseName is suffix using for name of deployment.
	// Deployment name have to be ${DeploymentBaseName}-blue or ${DeploymentBaseName}-green format.
	// +kubebuilder:validation:Required
	DeploymentBaseName string `json:"deploymentBaseName,omitempty"`

	// VirtualServiceConfig is set of information for building VirtualService resource.
	// +kubebuilder:validation:Required
	VirtualServiceConfig VirtualServiceConfig `json:"virtualServiceConfig,omitempty"`
}

BGRouterSpec defines the desired state of BGRouter

func (*BGRouterSpec) DeepCopy

func (in *BGRouterSpec) DeepCopy() *BGRouterSpec

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

func (*BGRouterSpec) DeepCopyInto

func (in *BGRouterSpec) DeepCopyInto(out *BGRouterSpec)

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

type BGRouterStatus

type BGRouterStatus struct {
	// CurrentActiveColor represent for current active color.
	// +kubebuilder:validation:Enum=blue;green
	CurrentActiveColor string `json:"currentActiveColor,omitempty"`

	// Progress describe the progress of swithing operation.
	// +kubebuilder:validation:Enum=DONE;ONGOING
	Progress string `json:"progress,omitempty"`
}

BGRouterStatus defines the observed state of BGRouter

func (*BGRouterStatus) DeepCopy

func (in *BGRouterStatus) DeepCopy() *BGRouterStatus

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

func (*BGRouterStatus) DeepCopyInto

func (in *BGRouterStatus) DeepCopyInto(out *BGRouterStatus)

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

type VirtualServiceConfig

type VirtualServiceConfig struct {
	// Name is the name for VirtualService managed by bgrouter controller.
	// +kubebuilder:validation:Required
	Name string `json:"name,omitempty"`

	// TargetServiceName is the FQDN for accessing target Service resource.
	// If you wanna access the service named "foo-service" in "foo" namespace,
	// you specifies "foo-service.foo.svc.cluster.local".
	// +kubebuilder:validation:Required
	TargetServiceName string `json:"targetServiceName,omitempty"`

	// HostsForInternalTraffic is list of hosts for in-cluster traffic.
	// +kubebuilder:validation:Required
	HostsForInClusterTraffic []string `json:"hostsForInClusterTraffic,omitempty"`

	// HostsForOutsideClusterTraffic is list of hosts for outside cluster
	// +optional
	HostsForOutsideClusterTraffic []string `json:"hostsForOutsideClusterTraffic,omitempty"`
}

func (*VirtualServiceConfig) DeepCopy

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

func (*VirtualServiceConfig) DeepCopyInto

func (in *VirtualServiceConfig) DeepCopyInto(out *VirtualServiceConfig)

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