alb

package
v0.0.0-...-ef16b87 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ECSBackendType = "ecs"
	ENIBackendType = "eni"
)
View Source
const (
	OnFlag  = FlagType("on")
	OffFlag = FlagType("off")
)
View Source
const DefaultPrefix = "k8s"

Variables

This section is empty.

Functions

This section is empty.

Types

type ALBListenerRuleSpec

type ALBListenerRuleSpec struct {
	Priority       int         `json:"Priority" xml:"Priority"`
	RuleId         string      `json:"RuleId" xml:"RuleId"`
	RuleName       string      `json:"RuleName" xml:"RuleName"`
	RuleStatus     string      `json:"RuleStatus" xml:"RuleStatus"`
	RuleActions    []Action    `json:"RuleActions" xml:"RuleActions"`
	RuleConditions []Condition `json:"RuleConditions" xml:"RuleConditions"`
}

type ALBListenerSpec

type ALBListenerSpec struct {
	DefaultActions      []Action            `json:"DefaultActions" xml:"DefaultActions"`
	Certificates        []Certificate       `json:"Certificates" xml:"Certificates"`
	CaCertificates      []Certificate       `json:"CaCertificates" xml:"CaCertificates"`
	GzipEnabled         bool                `json:"GzipEnabled" xml:"GzipEnabled"`
	Http2Enabled        bool                `json:"Http2Enabled" xml:"Http2Enabled"`
	IdleTimeout         int                 `json:"IdleTimeout" xml:"IdleTimeout"`
	ListenerDescription string              `json:"ListenerDescription" xml:"ListenerDescription"`
	ListenerId          string              `json:"ListenerId" xml:"ListenerId"`
	ListenerPort        int                 `json:"ListenerPort" xml:"ListenerPort"`
	ListenerProtocol    string              `json:"ListenerProtocol" xml:"ListenerProtocol"`
	ListenerStatus      string              `json:"ListenerStatus" xml:"ListenerStatus"`
	RequestTimeout      int                 `json:"RequestTimeout" xml:"RequestTimeout"`
	SecurityPolicyId    string              `json:"SecurityPolicyId" xml:"SecurityPolicyId"`
	LogConfig           LogConfig           `json:"LogConfig" xml:"LogConfig"`
	QuicConfig          QuicConfig          `json:"QuicConfig" xml:"QuicConfig"`
	XForwardedForConfig XForwardedForConfig `json:"XForwardedForConfig" xml:"XForwardedForConfig"`
}

type ALBLoadBalancerSpec

type ALBLoadBalancerSpec struct {
	AddressAllocatedMode         string                       `json:"AddressAllocatedMode" xml:"AddressAllocatedMode"`
	AddressType                  string                       `json:"AddressType" xml:"AddressType"`
	DNSName                      string                       `json:"DNSName" xml:"DNSName"`
	LoadBalancerEdition          string                       `json:"LoadBalancerEdition" xml:"LoadBalancerEdition"`
	LoadBalancerId               string                       `json:"LoadBalancerId" xml:"LoadBalancerId"`
	LoadBalancerName             string                       `json:"LoadBalancerName" xml:"LoadBalancerName"`
	LoadBalancerStatus           string                       `json:"LoadBalancerStatus" xml:"LoadBalancerStatus"`
	ResourceGroupId              string                       `json:"ResourceGroupId" xml:"ResourceGroupId"`
	VpcId                        string                       `json:"VpcId" xml:"VpcId"`
	ForceOverride                *bool                        `json:"ForceOverride" xml:"ForceOverride"`
	AccessLogConfig              AccessLogConfig              `json:"AccessLogConfig" xml:"AccessLogConfig"`
	DeletionProtectionConfig     DeletionProtectionConfig     `json:"DeletionProtectionConfig" xml:"DeletionProtectionConfig"`
	LoadBalancerBillingConfig    LoadBalancerBillingConfig    `json:"LoadBalancerBillingConfig" xml:"LoadBalancerBillingConfig"`
	ModificationProtectionConfig ModificationProtectionConfig `json:"ModificationProtectionConfig" xml:"ModificationProtectionConfig"`
	LoadBalancerOperationLocks   []LoadBalancerOperationLock  `json:"LoadBalancerOperationLocks" xml:"LoadBalancerOperationLocks"`
	Tags                         []ALBTag                     `json:"Tags" xml:"Tags"`
	ZoneMapping                  []ZoneMapping                `json:"ZoneMapping" xml:"ZoneMapping"`
}

type ALBServerGroupSpec

type ALBServerGroupSpec struct {
	Protocol            string              `json:"Protocol" xml:"Protocol"`
	ResourceGroupId     string              `json:"ResourceGroupId" xml:"ResourceGroupId"`
	Scheduler           string              `json:"Scheduler" xml:"Scheduler"`
	ServerGroupId       string              `json:"ServerGroupId" xml:"ServerGroupId"`
	ServerGroupName     string              `json:"ServerGroupName" xml:"ServerGroupName"`
	ServerGroupStatus   string              `json:"ServerGroupStatus" xml:"ServerGroupStatus"`
	ServerGroupType     string              `json:"ServerGroupType" xml:"ServerGroupType"`
	VpcId               string              `json:"VpcId" xml:"VpcId"`
	HealthCheckConfig   HealthCheckConfig   `json:"HealthCheckConfig" xml:"HealthCheckConfig"`
	StickySessionConfig StickySessionConfig `json:"StickySessionConfig" xml:"StickySessionConfig"`
	Tags                []ALBTag            `json:"Tags" xml:"Tags"`
}

type ALBTag

type ALBTag struct {
	Key   string `json:"Key" xml:"Key"`
	Value string `json:"Value" xml:"Value"`
}

type AccessLog

type AccessLog struct {
	LogProject string `json:"project"`
	LogStore   string `json:"logstore"`
}

type AccessLogConfig

type AccessLogConfig struct {
	LogStore   string `json:"LogStore" xml:"LogStore"`
	LogProject string `json:"LogProject" xml:"LogProject"`
}

type AccessLogTracingConfig

type AccessLogTracingConfig struct {
	TracingSample  int    `json:"TracingSample" xml:"TracingSample"`
	TracingType    string `json:"TracingType" xml:"TracingType"`
	TracingEnabled bool   `json:"TracingEnabled" xml:"TracingEnabled"`
}

type Action

type Action struct {
	Order               int                  `json:"Order" xml:"Order"`
	Type                string               `json:"Type" xml:"Type"`
	ForwardConfig       *ForwardActionConfig `json:"forwardConfig,omitempty"`
	FixedResponseConfig *FixedResponseConfig `json:"FixedResponseConfig" xml:"FixedResponseConfig"`
	RedirectConfig      *RedirectConfig      `json:"RedirectConfig" xml:"RedirectConfig"`
	InsertHeaderConfig  *InsertHeaderConfig  `json:"InsertHeaderConfig" xml:"InsertHeaderConfig"`
	RemoveHeaderConfig  *RemoveHeaderConfig  `json:"RemoveHeaderConfig" xml:"RemoveHeaderConfig"`
	RewriteConfig       *RewriteConfig       `json:"RewriteConfig" xml:"RewriteConfig"`
	TrafficMirrorConfig *TrafficMirrorConfig `json:"TrafficMirrorConfig" xml:"TrafficMirrorConfig"`
	TrafficLimitConfig  *TrafficLimitConfig  `json:"TrafficLimitConfig" xml:"TrafficLimitConfig"`
}

type AlbLoadBalancer

type AlbLoadBalancer struct {
	core.ResourceMeta `json:"-"`

	Spec ALBLoadBalancerSpec `json:"spec"`

	Status *LoadBalancerStatus `json:"status,omitempty"`
}

func NewAlbLoadBalancer

func NewAlbLoadBalancer(stack core.Manager, id string, spec ALBLoadBalancerSpec) *AlbLoadBalancer

func (*AlbLoadBalancer) DNSName

func (lb *AlbLoadBalancer) DNSName() core.StringToken

func (*AlbLoadBalancer) LoadBalancerID

func (lb *AlbLoadBalancer) LoadBalancerID() core.StringToken

func (*AlbLoadBalancer) SetStatus

func (lb *AlbLoadBalancer) SetStatus(status LoadBalancerStatus)

type AlbLoadBalancerWithTags

type AlbLoadBalancerWithTags struct {
	albsdk.LoadBalancer
	Tags map[string]string
}

type BackendItem

type BackendItem struct {
	Pod         *v1.Pod
	Description string
	ServerId    string
	ServerIp    string
	Weight      int
	Port        int
	Type        string
}

type Certificate

type Certificate struct {
	IsDefault     bool   `json:"IsDefault" xml:"IsDefault"`
	CertificateId string `json:"CertificateId" xml:"CertificateId"`
	Status        string `json:"Status" xml:"Status"`
}

type Condition

type Condition struct {
	Type                     string                   `json:"Type" xml:"Type"`
	CookieConfig             CookieConfig             `json:"CookieConfig" xml:"CookieConfig"`
	HeaderConfig             HeaderConfig             `json:"HeaderConfig" xml:"HeaderConfig"`
	HostConfig               HostConfig               `json:"HostConfig" xml:"HostConfig"`
	MethodConfig             MethodConfig             `json:"MethodConfig" xml:"MethodConfig"`
	PathConfig               PathConfig               `json:"PathConfig" xml:"PathConfig"`
	QueryStringConfig        QueryStringConfig        `json:"QueryStringConfig" xml:"QueryStringConfig"`
	SourceIpConfig           SourceIpConfig           `json:"SourceIpConfig" xml:"SourceIpConfig"`
	ResponseStatusCodeConfig ResponseStatusCodeConfig `json:"ResponseStatusCodeConfig" xml:"ResponseStatusCodeConfig"`
	ResponseHeaderConfig     ResponseHeaderConfig     `json:"ResponseHeaderConfig" xml:"ResponseHeaderConfig"`
}

type CookieConfig

type CookieConfig struct {
	Values []Value `json:"Values" xml:"Values"`
}

type DeletionProtectionConfig

type DeletionProtectionConfig struct {
	Enabled     bool   `json:"Enabled" xml:"Enabled"`
	EnabledTime string `json:"EnabledTime" xml:"EnabledTime"`
}

type FixedResponseConfig

type FixedResponseConfig struct {
	Content     string `json:"Content" xml:"Content"`
	ContentType string `json:"ContentType" xml:"ContentType"`
	HttpCode    string `json:"HttpCode" xml:"HttpCode"`
}

type FlagType

type FlagType string

type ForwardActionConfig

type ForwardActionConfig struct {
	ServerGroupStickySession *ServerGroupStickySession `json:"ServerGroupStickySession" xml:"ServerGroupStickySession"`
	ServerGroups             []ServerGroupTuple        `json:"serverGroups"`
}

type HeaderConfig

type HeaderConfig struct {
	Key    string   `json:"Key" xml:"Key"`
	Values []string `json:"Values" xml:"Values"`
}

type HealthCheckConfig

type HealthCheckConfig struct {
	HealthCheckConnectPort         int      `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"`
	HealthCheckEnabled             bool     `json:"HealthCheckEnabled" xml:"HealthCheckEnabled"`
	HealthCheckHost                string   `json:"HealthCheckHost" xml:"HealthCheckHost"`
	HealthCheckHttpVersion         string   `json:"HealthCheckHttpVersion" xml:"HealthCheckHttpVersion"`
	HealthCheckInterval            int      `json:"HealthCheckInterval" xml:"HealthCheckInterval"`
	HealthCheckMethod              string   `json:"HealthCheckMethod" xml:"HealthCheckMethod"`
	HealthCheckPath                string   `json:"HealthCheckPath" xml:"HealthCheckPath"`
	HealthCheckProtocol            string   `json:"HealthCheckProtocol" xml:"HealthCheckProtocol"`
	HealthCheckTimeout             int      `json:"HealthCheckTimeout" xml:"HealthCheckTimeout"`
	HealthyThreshold               int      `json:"HealthyThreshold" xml:"HealthyThreshold"`
	UnhealthyThreshold             int      `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"`
	HealthCheckTcpFastCloseEnabled bool     `json:"HealthCheckTcpFastCloseEnabled" xml:"HealthCheckTcpFastCloseEnabled"`
	HealthCheckHttpCodes           []string `json:"HealthCheckHttpCodes" xml:"HealthCheckHttpCodes"`
	HealthCheckCodes               []string `json:"HealthCheckCodes" xml:"HealthCheckCodes"`
}

type HostConfig

type HostConfig struct {
	Values []string `json:"Values" xml:"Values"`
}

type InsertHeaderConfig

type InsertHeaderConfig struct {
	CoverEnabled bool   `json:"CoverEnabled" xml:"CoverEnabled"`
	Key          string `json:"Key" xml:"Key"`
	Value        string `json:"Value" xml:"Value"`
	ValueType    string `json:"ValueType" xml:"ValueType"`
}

type Listener

type Listener struct {
	core.ResourceMeta `json:"-"`

	Spec ListenerSpec `json:"spec"`

	Status *ListenerStatus `json:"status,omitempty"`
}

func NewListener

func NewListener(stack core.Manager, id string, spec ListenerSpec) *Listener

func (*Listener) ListenerID

func (ls *Listener) ListenerID() core.StringToken

func (*Listener) SetStatus

func (ls *Listener) SetStatus(status ListenerStatus)

type ListenerRule

type ListenerRule struct {
	core.ResourceMeta `json:"-"`

	Spec ListenerRuleSpec `json:"spec"`

	Status *ListenerRuleStatus `json:"status,omitempty"`
}

func NewListenerRule

func NewListenerRule(stack core.Manager, id string, spec ListenerRuleSpec) *ListenerRule

func (*ListenerRule) SetStatus

func (lr *ListenerRule) SetStatus(status ListenerRuleStatus)

type ListenerRuleSpec

type ListenerRuleSpec struct {
	ListenerID core.StringToken `json:"listenerID"`
	ALBListenerRuleSpec
}

type ListenerRuleStatus

type ListenerRuleStatus struct {
	RuleID string `json:"ruleID"`
}

type ListenerSpec

type ListenerSpec struct {
	LoadBalancerID core.StringToken `json:"loadBalancerID"`
	ALBListenerSpec
}

type ListenerStatus

type ListenerStatus struct {
	ListenerID string `json:"listenerID"`
}

type LoadBalancerAddress

type LoadBalancerAddress struct {
	Address string `json:"Address" xml:"Address"`
}

type LoadBalancerBillingConfig

type LoadBalancerBillingConfig struct {
	InternetBandwidth  int    `json:"InternetBandwidth" xml:"InternetBandwidth"`
	InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"`
	PayType            string `json:"PayType" xml:"PayType"`
}

type LoadBalancerOperationLock

type LoadBalancerOperationLock struct {
	LockReason string `json:"LockReason" xml:"LockReason"`
	LockType   string `json:"LockType" xml:"LockType"`
}

type LoadBalancerStatus

type LoadBalancerStatus struct {
	DNSName        string `json:"dnsName"`
	LoadBalancerID string `json:"loadBalancerID"`
}

type LogConfig

type LogConfig struct {
	AccessLogRecordCustomizedHeadersEnabled bool                   `json:"AccessLogRecordCustomizedHeadersEnabled" xml:"AccessLogRecordCustomizedHeadersEnabled"`
	AccessLogTracingConfig                  AccessLogTracingConfig `json:"AccessLogTracingConfig" xml:"AccessLogTracingConfig"`
}

type MethodConfig

type MethodConfig struct {
	Values []string `json:"Values" xml:"Values"`
}

type MirrorGroupConfig

type MirrorGroupConfig struct {
	ServerGroupTuples []ServerGroupTuple `json:"ServerGroupTuples" xml:"ServerGroupTuples"`
}

type ModificationProtectionConfig

type ModificationProtectionConfig struct {
	Reason string `json:"Reason" xml:"Reason"`
	Status string `json:"Status" xml:"Status"`
}

type PathConfig

type PathConfig struct {
	Values []string `json:"Values" xml:"Values"`
}

type QueryStringConfig

type QueryStringConfig struct {
	Values []Value `json:"Values" xml:"Values"`
}

type QuicConfig

type QuicConfig struct {
	QuicUpgradeEnabled bool   `json:"QuicUpgradeEnabled" xml:"QuicUpgradeEnabled"`
	QuicListenerId     string `json:"QuicListenerId" xml:"QuicListenerId"`
}

type RedirectConfig

type RedirectConfig struct {
	Host     string `json:"Host" xml:"Host"`
	HttpCode string `json:"HttpCode" xml:"HttpCode"`
	Path     string `json:"Path" xml:"Path"`
	Port     string `json:"Port" xml:"Port"`
	Protocol string `json:"Protocol" xml:"Protocol"`
	Query    string `json:"Query" xml:"Query"`
}

type RemoveHeaderConfig

type RemoveHeaderConfig struct {
	Key string `json:"Key" xml:"Key"`
}

type ResAndSDKListenerRulePair

type ResAndSDKListenerRulePair struct {
	ResLR *ListenerRule
	SdkLR *albsdk.Rule
}

type ResponseHeaderConfig

type ResponseHeaderConfig struct {
	Key    string   `json:"Key" xml:"Key"`
	Values []string `json:"Values" xml:"Values"`
}

type ResponseStatusCodeConfig

type ResponseStatusCodeConfig struct {
	Values []string `json:"Values" xml:"Values"`
}

type RewriteConfig

type RewriteConfig struct {
	Host  string `json:"Host" xml:"Host"`
	Path  string `json:"Path" xml:"Path"`
	Query string `json:"Query" xml:"Query"`
}

type ServerGroup

type ServerGroup struct {
	core.ResourceMeta `json:"-"`

	Spec ServerGroupSpec `json:"spec"`

	Status *ServerGroupStatus `json:"status,omitempty"`
}

func NewServerGroup

func NewServerGroup(stack core.Manager, id string, spec ServerGroupSpec) *ServerGroup

func (*ServerGroup) ServerGroupID

func (sgp *ServerGroup) ServerGroupID() core.StringToken

func (*ServerGroup) SetStatus

func (sgp *ServerGroup) SetStatus(status ServerGroupStatus)

type ServerGroupNamedKey

type ServerGroupNamedKey struct {
	Prefix      string
	ClusterID   string
	Namespace   string
	IngressName string
	ServiceName string
	ServicePort int
}

func (*ServerGroupNamedKey) Key

func (n *ServerGroupNamedKey) Key() string

func (*ServerGroupNamedKey) String

func (n *ServerGroupNamedKey) String() string

type ServerGroupSpec

type ServerGroupSpec struct {
	ServerGroupNamedKey
	ALBServerGroupSpec
}

type ServerGroupStatus

type ServerGroupStatus struct {
	ServerGroupID string `json:"serverGroupID"`
}

type ServerGroupStickySession

type ServerGroupStickySession struct {
	Enabled bool `json:"Enabled" xml:"Enabled"`
	Timeout int  `json:"Timeout" xml:"Timeout"`
}

type ServerGroupTuple

type ServerGroupTuple struct {
	ServerGroupID core.StringToken `json:"serverGroupID"`

	ServiceName string `json:"serviceName"`

	ServicePort int `json:"servicePort"`

	Weight int `json:"weight,omitempty"`
}

type ServerGroupWithIngress

type ServerGroupWithIngress struct {
	IngressNames []string
	Backends     []BackendItem
}

type ServerGroupWithTags

type ServerGroupWithTags struct {
	albsdk.ServerGroup
	Servers []albsdk.BackendServer
	Tags    map[string]string
}

type ServiceGroupWithNameKey

type ServiceGroupWithNameKey struct {
	NamedKey *ServerGroupNamedKey
	Backends []BackendItem
}

type ServiceManager

type ServiceManager struct {
	ClusterID string

	Namespace string
	Name      string

	PortToServerGroup map[int32]*ServerGroupWithIngress

	TrafficPolicy                   string
	ContainsPotentialReadyEndpoints bool
}

type ServiceStackContext

type ServiceStackContext struct {
	ClusterID string

	ServiceNamespace string
	ServiceName      string

	Service *v1.Service

	ServicePortToIngressNames map[int32][]string

	IsServiceNotFound bool
}

type SourceIpConfig

type SourceIpConfig struct {
	Values []string `json:"Values" xml:"Values"`
}

type StickySessionConfig

type StickySessionConfig struct {
	Cookie               string `json:"Cookie" xml:"Cookie"`
	CookieTimeout        int    `json:"CookieTimeout" xml:"CookieTimeout"`
	StickySessionEnabled bool   `json:"StickySessionEnabled" xml:"StickySessionEnabled"`
	StickySessionType    string `json:"StickySessionType" xml:"StickySessionType"`
}

type TrafficLimitConfig

type TrafficLimitConfig struct {
	QPS int `json:"QPS" xml:"QPS"`
}

type TrafficMirrorConfig

type TrafficMirrorConfig struct {
	TargetType        string            `json:"TargetType" xml:"TargetType"`
	MirrorGroupConfig MirrorGroupConfig `json:"MirrorGroupConfig" xml:"MirrorGroupConfig"`
}

type Value

type Value struct {
	Key   string `json:"Key" xml:"Key"`
	Value string `json:"Value" xml:"Value"`
}

type XForwardedForConfig

type XForwardedForConfig struct {
	XForwardedForClientCertSubjectDNAlias      string `json:"XForwardedForClientCertSubjectDNAlias" xml:"XForwardedForClientCertSubjectDNAlias"`
	XForwardedForClientCertSubjectDNEnabled    bool   `json:"XForwardedForClientCertSubjectDNEnabled" xml:"XForwardedForClientCertSubjectDNEnabled"`
	XForwardedForProtoEnabled                  bool   `json:"XForwardedForProtoEnabled" xml:"XForwardedForProtoEnabled"`
	XForwardedForClientCertIssuerDNEnabled     bool   `json:"XForwardedForClientCertIssuerDNEnabled" xml:"XForwardedForClientCertIssuerDNEnabled"`
	XForwardedForSLBIdEnabled                  bool   `json:"XForwardedForSLBIdEnabled" xml:"XForwardedForSLBIdEnabled"`
	XForwardedForClientSrcPortEnabled          bool   `json:"XForwardedForClientSrcPortEnabled" xml:"XForwardedForClientSrcPortEnabled"`
	XForwardedForClientCertFingerprintEnabled  bool   `json:"XForwardedForClientCertFingerprintEnabled" xml:"XForwardedForClientCertFingerprintEnabled"`
	XForwardedForEnabled                       bool   `json:"XForwardedForEnabled" xml:"XForwardedForEnabled"`
	XForwardedForSLBPortEnabled                bool   `json:"XForwardedForSLBPortEnabled" xml:"XForwardedForSLBPortEnabled"`
	XForwardedForClientCertClientVerifyAlias   string `json:"XForwardedForClientCertClientVerifyAlias" xml:"XForwardedForClientCertClientVerifyAlias"`
	XForwardedForClientCertIssuerDNAlias       string `json:"XForwardedForClientCertIssuerDNAlias" xml:"XForwardedForClientCertIssuerDNAlias"`
	XForwardedForClientCertFingerprintAlias    string `json:"XForwardedForClientCertFingerprintAlias" xml:"XForwardedForClientCertFingerprintAlias"`
	XForwardedForClientCertClientVerifyEnabled bool   `json:"XForwardedForClientCertClientVerifyEnabled" xml:"XForwardedForClientCertClientVerifyEnabled"`
}

type ZoneMapping

type ZoneMapping struct {
	VSwitchId             string                `json:"VSwitchId" xml:"VSwitchId"`
	ZoneId                string                `json:"ZoneId" xml:"ZoneId"`
	LoadBalancerAddresses []LoadBalancerAddress `json:"LoadBalancerAddresses" xml:"LoadBalancerAddresses"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL