v1

package
v0.20.16 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the network v1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=bk-bcs/bcs-services/bcs-clb-controller/pkg/apis/network +k8s:defaulter-gen=TypeMeta +groupName=network.bmsf.tencent.com

Package v1 contains API Schema definitions for the network v1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=bk-bcs/bcs-services/bcs-clb-controller/pkg/apis/network +k8s:defaulter-gen=TypeMeta +groupName=network.bmsf.tencent.com

Index

Constants

View Source
const (
	// ClbNetworkTypePublic public network type
	ClbNetworkTypePublic = "public"
	// ClbNetworkTypePrivate private network type
	ClbNetworkTypePrivate = "private"
	// ClbLBPolicyWRR wrr lb policy
	ClbLBPolicyWRR = "wrr"
	// ClbLBPolicyLeastConn least connection lb policy
	ClbLBPolicyLeastConn = "least_conn"
	// ClbLBPolicyIPHash ip hashed lb policy
	ClbLBPolicyIPHash = "ip_hash"
	// ClbListenerProtocolHTTP http protocol
	ClbListenerProtocolHTTP = "http"
	// ClbListenerProtocolHTTPS https protocol
	ClbListenerProtocolHTTPS = "https"
	// ClbListenerProtocolTCP tcp protocol
	ClbListenerProtocolTCP = "tcp"
	// ClbListenerProtocolUDP udp protocol
	ClbListenerProtocolUDP = "udp"
	// ClbListenerTLSModeUniDirectional unidirectional tls mode
	ClbListenerTLSModeUniDirectional = "unidirectional"
	// ClbListenerTLSModeMutual mutual tls mode
	ClbListenerTLSModeMutual = "mutual"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "network.bmsf.tencent.com", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme is required by pkg/client/...
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

Types

type Backend

type Backend struct {
	IP string `json:"ip"`
	// +kubebuilder:validation:Maximum=65535
	// +kubebuilder:validation:Minimum=1
	Port   int `json:"port"`
	Weight int `json:"weight"`
}

Backend info for one service node

func NewBackend

func NewBackend(ip string, port int) *Backend

NewBackend create new backend

func (*Backend) DeepCopy

func (in *Backend) DeepCopy() *Backend

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

func (*Backend) DeepCopyInto

func (in *Backend) DeepCopyInto(out *Backend)

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

func (*Backend) IsEqual

func (b *Backend) IsEqual(other *Backend) bool

IsEqual check if a backend is equal to the other

func (*Backend) SetWeight

func (b *Backend) SetWeight(weight int)

SetWeight set weight

type BackendList

type BackendList []*Backend

BackendList sort for backend list

func (BackendList) DeepCopy

func (in BackendList) DeepCopy() BackendList

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

func (BackendList) DeepCopyInto

func (in BackendList) DeepCopyInto(out *BackendList)

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

func (BackendList) Len

func (bl BackendList) Len() int

Len is the number of elements in the collection.

type CloudListener

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

	Spec   CloudListenerSpec   `json:"spec,omitempty"`
	Status CloudListenerStatus `json:"status,omitempty"`
}

CloudListener is the Schema for the cloudlisteners API +k8s:openapi-gen=true

func (*CloudListener) DeepCopy

func (in *CloudListener) DeepCopy() *CloudListener

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

func (*CloudListener) DeepCopyInto

func (in *CloudListener) DeepCopyInto(out *CloudListener)

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

func (*CloudListener) DeepCopyObject

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

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

func (*CloudListener) GetDiffRules

func (cl *CloudListener) GetDiffRules(cur *CloudListener) (dels RuleList, adds RuleList)

GetDiffRules get deleted rules and added rules for cur listener compared to cl listener

func (*CloudListener) GetRuleByID

func (cl *CloudListener) GetRuleByID(id string) (*Rule, error)

GetRuleByID rule by rule id

func (*CloudListener) GetUpdateRules

func (cl *CloudListener) GetUpdateRules(cur *CloudListener) (olds RuleList, updates RuleList)

GetUpdateRules get updated rules for cur listener compared to cl listener

func (*CloudListener) IsEqual

func (cl *CloudListener) IsEqual(other *CloudListener) bool

IsEqual check if Listener is equal to the other

func (*CloudListener) Key

func (cl *CloudListener) Key() string

Key get key of cloudlistener

func (*CloudListener) ToString

func (cl *CloudListener) ToString() string

ToString format object to string

type CloudListenerBackendHealthStatus

type CloudListenerBackendHealthStatus struct {
	IP                 string `json:"ip"`
	Port               int    `json:"port"`
	HealthStatus       bool   `json:"healthStatus"`
	TargetID           string `json:"targetId"`
	HealthStatusDetail string `json:"healthStatusDetail"`
}

CloudListenerBackendHealthStatus backend health status of listener

func (*CloudListenerBackendHealthStatus) DeepCopy

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

func (*CloudListenerBackendHealthStatus) DeepCopyInto

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

type CloudListenerHealthStatus

type CloudListenerHealthStatus struct {
	RulesHealth []*CloudListenerRuleHealthStatus `json:"rules,omitempty"`
}

CloudListenerHealthStatus health status of listener

func (*CloudListenerHealthStatus) DeepCopy

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

func (*CloudListenerHealthStatus) DeepCopyInto

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

type CloudListenerList

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

CloudListenerList contains a list of CloudListener

func (*CloudListenerList) DeepCopy

func (in *CloudListenerList) DeepCopy() *CloudListenerList

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

func (*CloudListenerList) DeepCopyInto

func (in *CloudListenerList) DeepCopyInto(out *CloudListenerList)

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

func (*CloudListenerList) DeepCopyObject

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

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

type CloudListenerRuleHealthStatus

type CloudListenerRuleHealthStatus struct {
	Domain   string                              `json:"domain"`
	URL      string                              `json:"url"`
	Backends []*CloudListenerBackendHealthStatus `json:"backends,omitempty"`
}

CloudListenerRuleHealthStatus rule health status of listener

func (*CloudListenerRuleHealthStatus) DeepCopy

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

func (*CloudListenerRuleHealthStatus) DeepCopyInto

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

type CloudListenerSpec

type CloudListenerSpec struct {
	ListenerID     string            `json:"listenerId"`    //clb listenerId/elb arn
	LoadBalancerID string            `json:"loadbalanceId"` //loadbalancer reference id
	Protocol       string            `json:"protocol"`      //service name
	TLS            *CloudListenerTls `json:"tls,omitempty"` //clb tls config
	// +kubebuilder:validation:Maximum=65535
	// +kubebuilder:validation:Minimum=1
	ListenPort int `json:"listenPort"` //export ports info
	//SSLCertID   string       `json:"sslCertId,omitempty"`   //SSL certificate Id for https
	TargetGroup *TargetGroup `json:"targetGroup,omitempty"` //only for tcp & udp
	Rules       RuleList     `json:"rules,omitempty"`       //only for http/https
}

CloudListenerSpec defines the desired state of CloudListener

func (*CloudListenerSpec) DeepCopy

func (in *CloudListenerSpec) DeepCopy() *CloudListenerSpec

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

func (*CloudListenerSpec) DeepCopyInto

func (in *CloudListenerSpec) DeepCopyInto(out *CloudListenerSpec)

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

type CloudListenerStatus

type CloudListenerStatus struct {
	// last updated timestamp
	LastUpdateTime metav1.Time                `json:"lastUpdateTime,omitempty"`
	HealthStatus   *CloudListenerHealthStatus `json:"healthStatus,omitempty"`
}

CloudListenerStatus defines the observed state of CloudListener

func (*CloudListenerStatus) DeepCopy

func (in *CloudListenerStatus) DeepCopy() *CloudListenerStatus

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

func (*CloudListenerStatus) DeepCopyInto

func (in *CloudListenerStatus) DeepCopyInto(out *CloudListenerStatus)

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

type CloudListenerTls

type CloudListenerTls struct {
	Mode                string `json:"mode,omitempty"`
	CertID              string `json:"certId,omitempty"`
	CertCaID            string `json:"certCaId,omitempty"`
	CertServerName      string `json:"certServerName,omitempty"`
	CertServerKey       string `json:"certServerKey,omitempty"`
	CertServerContent   string `json:"certServerContent,omitempty"`
	CertClientCaName    string `json:"certClientCaName,omitempty"`
	CertClientCaContent string `json:"certCilentCaContent,omitempty"`
}

CloudListenerTls cloud listener tls attributes

func (*CloudListenerTls) DeepCopy

func (in *CloudListenerTls) DeepCopy() *CloudListenerTls

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

func (*CloudListenerTls) DeepCopyInto

func (in *CloudListenerTls) DeepCopyInto(out *CloudListenerTls)

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

type CloudLoadBalancer

type CloudLoadBalancer struct {
	ID          string   `json:"id"` //clb id or elb arn
	NetworkType string   `json:"net"`
	Name        string   `json:"name"`
	PublicIPs   []string `json:"publicIPs"`
	VIPS        []string `json:"vips"`
}

CloudLoadBalancer information for cloud Loadbalancer in aws/qcloud

func (*CloudLoadBalancer) DeepCopy

func (in *CloudLoadBalancer) DeepCopy() *CloudLoadBalancer

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

func (*CloudLoadBalancer) DeepCopyInto

func (in *CloudLoadBalancer) DeepCopyInto(out *CloudLoadBalancer)

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

type Rule

type Rule struct {
	ID     string `json:"id,omitempty"`
	Domain string `json:"domain"`
	URL    string `json:"url"`
	//Balance     string       `json:"balance,omitempty"`
	TargetGroup *TargetGroup `json:"targetGroup"`
}

Rule only use for http/https

func NewRule

func NewRule(domain string, url string) *Rule

NewRule new a rule

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

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

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

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

func (*Rule) IsConflict

func (r *Rule) IsConflict(ruleList RuleList) bool

IsConflict check if a rule is conflict with the other

func (*Rule) IsEqual

func (r *Rule) IsEqual(other *Rule) bool

IsEqual check if a Rule is equal to the other

type RuleList

type RuleList []*Rule

RuleList list of Rule

func (RuleList) DeepCopy

func (in RuleList) DeepCopy() RuleList

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

func (RuleList) DeepCopyInto

func (in RuleList) DeepCopyInto(out *RuleList)

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

func (RuleList) Len

func (rl RuleList) Len() int

Len is the number of elements in the collection.

type TargetGroup

type TargetGroup struct {
	ID       string `json:"id,omitempty"`       //elb arn
	Name     string `json:"name"`               //elb or clb name
	Protocol string `json:"protocol,omitempty"` //elb protocol info
	// +kubebuilder:validation:Maximum=65535
	// +kubebuilder:validation:Minimum=1
	Port          int `json:"port,omitempty"` //elb port
	SessionExpire int `json:"sessionExpire,omitempty"`
	//HealthCheckPath string      `json:"healthCheckPath,omitempty"` //need health check path for http and https
	HealthCheck *TargetGroupHealthCheck `json:"healthCheck,omitempty"`
	LBPolicy    string                  `json:"lbPolicy,omitempty"`
	Backends    BackendList             `json:"backends,omitempty"` //CVM instance backend
}

TargetGroup backend info for all

func NewTargetGroup

func NewTargetGroup(id, name, protocol string, port int) *TargetGroup

NewTargetGroup new target group

func (*TargetGroup) AddBackends

func (tg *TargetGroup) AddBackends(adds BackendList)

AddBackends add backends to target group

func (*TargetGroup) DeepCopy

func (in *TargetGroup) DeepCopy() *TargetGroup

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

func (*TargetGroup) DeepCopyInto

func (in *TargetGroup) DeepCopyInto(out *TargetGroup)

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

func (*TargetGroup) GetDiffBackend

func (tg *TargetGroup) GetDiffBackend(cur *TargetGroup) (dels BackendList, adds BackendList)

GetDiffBackend check

func (*TargetGroup) GetUpdateBackend

func (tg *TargetGroup) GetUpdateBackend(cur *TargetGroup) (updates BackendList)

GetUpdateBackend get update backend from tg compared to cur ** [NOT USED] to reduce api calling times, we do not use this function temporarily, to update backend, we delete it and create a new one **

func (*TargetGroup) IsAttrEqual

func (tg *TargetGroup) IsAttrEqual(other *TargetGroup) bool

IsAttrEqual if TargetGroup equal to another except for backends

func (*TargetGroup) IsEqual

func (tg *TargetGroup) IsEqual(other *TargetGroup) bool

IsEqual if TargetGroup equal to another

func (*TargetGroup) RemoveBackend

func (tg *TargetGroup) RemoveBackend(dels BackendList)

RemoveBackend clean all backend info

type TargetGroupHealthCheck

type TargetGroupHealthCheck struct {
	Enabled       int    `json:"enabled"`
	Timeout       int    `json:"timeOut,omitempty"`
	IntervalTime  int    `json:"intervalTime,omitempty"`
	HealthNum     int    `json:"healthNum,omitempty"`
	UnHealthNum   int    `json:"unHealthNum,omitempty"`
	HTTPCode      int    `json:"httpCode,omitempty"`
	HTTPCheckPath string `json:"httpCheckPath,omitempty"`
}

TargetGroupHealthCheck target group health check setting

func NewTargetGroupHealthCheck

func NewTargetGroupHealthCheck() *TargetGroupHealthCheck

NewTargetGroupHealthCheck new target group health check

func (*TargetGroupHealthCheck) DeepCopy

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

func (*TargetGroupHealthCheck) DeepCopyInto

func (in *TargetGroupHealthCheck) DeepCopyInto(out *TargetGroupHealthCheck)

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