Documentation ¶
Index ¶
- Constants
- func GenBackendKey(ip string, port int32, protocol corev1.Protocol) string
- func GenServicePortRef(svcNs, svcName, portName string) string
- func GenSvcID(svcNS string, svcName string) string
- func GenSvcPortKey(ns, name string) string
- func GetClusterIPs(spec corev1.ServiceSpec) []string
- func GetNsAndNameFromSvcID(svcID string) (string, string)
- func NewBackendCache() cache.Indexer
- func NewBaseSvcCache() cache.Indexer
- func NewSvcPortCache() cache.Indexer
- type Backend
- type BaseSvc
- func (b *BaseSvc) ChangeAffinityMode(new *BaseSvc) bool
- func (b *BaseSvc) ChangeAffinityTimeout(new *BaseSvc) bool
- func (b *BaseSvc) DeepCopy() *BaseSvc
- func (b *BaseSvc) DiffClusterIPs(new *BaseSvc) (add, del []string)
- func (b *BaseSvc) DiffPorts(new *BaseSvc) (add, update, del []*Port)
- func (b *BaseSvc) ListPorts() []*Port
- type Port
- type SvcPort
Constants ¶
View Source
const (
DefaultSessionAffinityTimeout int32 = 10800
)
View Source
const PortNameIndex = "PortNameIndex"
View Source
const ServicePortIndex = "ServicePortIndex"
Variables ¶
This section is empty.
Functions ¶
func GenServicePortRef ¶
func GenSvcPortKey ¶
func GetClusterIPs ¶
func GetClusterIPs(spec corev1.ServiceSpec) []string
func GetNsAndNameFromSvcID ¶
func NewBackendCache ¶
func NewBaseSvcCache ¶
func NewSvcPortCache ¶
Types ¶
type Backend ¶
type BaseSvc ¶
type BaseSvc struct { // SvcID is unique identifier of BaseSvc, it should be set svcNamespace/svcName SvcID string SvcType corev1.ServiceType ClusterIPs []string // Ports the key is portname Ports map[string]*Port // ExternalTrafficPolicy ClusterIP doesn't use it ExternalTrafficPolicy ertype.TrafficPolicyType InternalTrafficPolicy ertype.TrafficPolicyType SessionAffinity corev1.ServiceAffinity // SessionAffinityTimeout,the unit is seconds SessionAffinityTimeout int32 }
BaseSvc store a service base info
func ServiceToBaseSvc ¶
func (*BaseSvc) ChangeAffinityMode ¶
func (*BaseSvc) ChangeAffinityTimeout ¶
func (*BaseSvc) DiffClusterIPs ¶
type Port ¶
type Port struct { // Name represents the associated name with this Port number. Name string // Protocol for port. Must be UDP, TCP TODO not icmp webhook Protocol corev1.Protocol // Port represents the ClusterIP Service Port number. Port int32 // Nodeport represents the NodePort Service NodePort number. NodePort int32 }
Port is service port info
type SvcPort ¶
func GenSvcPortFromServicePort ¶
func GenSvcPortFromServicePort(servicePort *everoutesvc.ServicePort) *SvcPort
Click to show internal directories.
Click to hide internal directories.