Documentation ¶
Index ¶
- Constants
- Variables
- func AS3NameFormatter(name string) string
- func DeepEqualJSON(decl1, decl2 as3Declaration) bool
- func JoinBigipPath(partition, objName string) string
- type Agent
- type AgentParams
- type BigIPSSLProfiles
- type CRInformer
- type Controller
- func (ctlr *Controller) GetPodsForService(namespace, serviceName string) *v1.PodList
- func (ctlr *Controller) GetServicesForPod(pod *v1.Pod) *v1.Service
- func (ctlr *Controller) ProcessAssociatedExternalDNS(hostnames []string)
- func (ctlr *Controller) ProcessNodeUpdate(obj interface{}, err error)
- func (ctlr *Controller) SetupNodePolling(nodePollInterval int, nodeLabelSelector string, vxlanMode string, ...) error
- func (ctlr *Controller) Start()
- func (ctlr *Controller) Stop()
- type ControllerMode
- type CustomProfile
- type CustomProfileStore
- type DNSConfig
- type DataGroupNamespaceMap
- type EssentialInformer
- type ExtendedRouteGroupConfig
- type ExtendedRouteGroupSpec
- type GSLBPool
- type GTMParams
- type IRule
- type IRulesMap
- type InternalDataGroup
- type InternalDataGroupMap
- type InternalDataGroupRecord
- type InternalDataGroupRecords
- type LTMConfig
- type Monitor
- type Monitors
- type NPLAnnoations
- type NPLAnnotation
- type NPLStore
- type NRInformer
- type NSInformer
- type NameRef
- type Node
- type Params
- type Policies
- type Policy
- type Pool
- type PoolMember
- type PoolMemberCache
- type Pools
- type PostManager
- type PostParams
- type ProcessedHostPath
- type ProfileRef
- type ProfileRefs
- type ProfileTCP
- type ResourceConfig
- type ResourceConfigRequest
- type ResourceConfigs
- type ResourceMap
- type ResourceStore
- type Rule
- type Rules
- type SecretKey
- type ServiceAddress
- type ServiceTypeLBHealthMonitor
- type Services
- type SourceAddrTranslation
- type TLSContext
- type Virtual
- type Virtuals
- type WideIP
- type WideIPs
Constants ¶
const ( KubernetesMode ControllerMode = "kubernetes" OpenShiftMode ControllerMode = "openshift" CustomResourceMode ControllerMode = "customresource" Create = "Create" Update = "Update" Delete = "Delete" // DefaultNativeResourceLabel is a label used for kubernetes/openshift Resources. DefaultNativeResourceLabel = "f5nr in (true)" F5RouterName = "F5 BIG-IP" HTTP = "http" HTTPS = "https" )
const ( // DefaultCustomResourceLabel is a label used for F5 Custom Resources. DefaultCustomResourceLabel = "f5cr in (true)" // VirtualServer is a F5 Custom Resource Kind. VirtualServer = "VirtualServer" // TLSProfile is a F5 Custom Resource Kind TLSProfile = "TLSProfile" // IngressLink is a Custom Resource used by both F5 and Nginx IngressLink = "IngressLink" // TransportServer is a F5 Custom Resource Kind TransportServer = "TransportServer" // ExternalDNS is a F5 Custom Resource Kind ExternalDNS = "ExternalDNS" // Policy is collection of BIG-IP profiles, LTM policies and iRules CustomPolicy = "CustomPolicy" // IPAM is a F5 Custom Resource Kind IPAM = "IPAM" // Service is a k8s native Service Resource. Service = "Service" //Pod is a k8s native object Pod = "Pod" // Endpoints is a k8s native Endpoint Resource. Endpoints = "Endpoints" // Namespace is k8s namespace Namespace = "Namespace" // ConfigMap is k8s native ConfigMap resource ConfigMap = "ConfigMap" // Route is OpenShift Route Route = "Route" NodePort = "nodeport" PolicyControlForward = "forwarding" // Namespace for IPAM CRD IPAMNamespace = "kube-system" // TLS Terminations TLSEdge = "edge" TLSReencrypt = "reencrypt" TLSPassthrough = "passthrough" TLSRedirectInsecure = "redirect" TLSAllowInsecure = "allow" TLSNoInsecure = "none" LBServiceIPAMLabelAnnotation = "cis.f5.com/ipamLabel" HealthMonitorAnnotation = "cis.f5.com/health" LBServicePolicyNameAnnotation = "cis.f5.com/policyName" //Antrea NodePortLocal support NPLPodAnnotation = "nodeportlocal.antrea.io" NPLSvcAnnotation = "nodeportlocal.antrea.io/enabled" NodePortLocal = "nodeportlocal" )
const ( DEFAULT_MODE string = "tcp" DEFAULT_BALANCE string = "round-robin" DEFAULT_HTTP_PORT int32 = 80 DEFAULT_HTTPS_PORT int32 = 443 DEFAULT_SNAT string = "auto" // Constants for CustomProfile.Type as defined in CCCL CustomProfileAll string = "all" CustomProfileClient string = "clientside" CustomProfileServer string = "serverside" // Constants for CustomProfile.PeerCertMode PeerCertRequired = "require" PeerCertIgnored = "ignore" PeerCertDefault = PeerCertIgnored // Constants HttpRedirectIRuleName = "http_redirect_irule" // Constants HttpRedirectNoHostIRuleName = "http_redirect_irule_nohost" // Internal data group for https redirect HttpsRedirectDgName = "https_redirect_dg" TLSIRuleName = "tls_irule" )
const ( // reference for profiles stored in BIG-IP BIGIP = "bigip" // reference for profiles stores as secrets in k8s cluster Secret = "secret" // reference for routes Certificate = "certificate" )
constants for TLS references
const ( NotEnabled = iota InvalidInput NotRequested Requested Allocated )
const AbDeploymentDgName = "ab_deployment_dg"
Internal data group for ab deployment routes.
const EdgeHostsDgName = "ssl_edge_servername_dg"
Internal data group for edge termination.
const EdgeServerSslDgName = "ssl_edge_serverssl_dg"
Internal data group for edge termination that maps the host name to the false. This will help Irule to understand ssl should be disabled on serverside.
const PassthroughHostsDgName = "ssl_passthrough_servername_dg"
Internal data group for passthrough termination.
const ReencryptHostsDgName = "ssl_reencrypt_servername_dg"
Internal data group for reencrypt termination.
const ReencryptServerSslDgName = "ssl_reencrypt_serverssl_dg"
Internal data group for reencrypt termination that maps the host name to the server ssl profile.
Variables ¶
var DEFAULT_PARTITION string
var K8SCoreServices = map[string]bool{ "kube-dns": true, "kube-scheduler": true, "kube-controller-manager": true, "kube-apiserver": true, "docker-registry": true, "kubernetes": true, "registry-console": true, "router": true, "kubelet": true, "console": true, "alertmanager-main": true, "alertmanager-operated": true, "cluster-monitoring-operator": true, "kube-state-metrics": true, "node-exporter": true, "prometheus-k8s": true, "prometheus-operated": true, "prometheus-operatorwebconsole": true, "kube-proxy": true, "flannel": true, "etcd": true, "antrea": true, }
Functions ¶
func AS3NameFormatter ¶
AS3NameFormatter formarts resources names according to AS3 convention TODO: Should we use this? Or this will be done in agent?
func DeepEqualJSON ¶
func DeepEqualJSON(decl1, decl2 as3Declaration) bool
func JoinBigipPath ¶
Types ¶
type Agent ¶
type Agent struct { *PostManager Partition string ConfigWriter writer.Writer EventChan chan interface{} PythonDriverPID int HttpAddress string EnableIPV6 bool // contains filtered or unexported fields }
func NewAgent ¶
func NewAgent(params AgentParams) *Agent
func (*Agent) PostConfig ¶
func (agent *Agent) PostConfig(rsConfig ResourceConfigRequest)
func (*Agent) PostGTMConfig ¶
func (agent *Agent) PostGTMConfig(config ResourceConfigRequest)
type AgentParams ¶
type BigIPSSLProfiles ¶
type BigIPSSLProfiles struct {
// contains filtered or unexported fields
}
type CRInformer ¶
type CRInformer struct {
// contains filtered or unexported fields
}
CRInformer defines the structure of Custom Resource Informer
type Controller ¶
type Controller struct { Partition string Agent *Agent PoolMemberType string UseNodeInternal bool SSLContext map[string]*v1.Secret TeemData *teem.TeemsData // contains filtered or unexported fields }
Controller defines the structure of K-Native and Custom Resource Controller
func NewController ¶
func NewController(params Params) *Controller
NewController creates a new Controller Instance.
func (*Controller) GetPodsForService ¶
func (ctlr *Controller) GetPodsForService(namespace, serviceName string) *v1.PodList
returns podlist with labels set to svc selector
func (*Controller) GetServicesForPod ¶
func (ctlr *Controller) GetServicesForPod(pod *v1.Pod) *v1.Service
func (*Controller) ProcessAssociatedExternalDNS ¶
func (ctlr *Controller) ProcessAssociatedExternalDNS(hostnames []string)
func (*Controller) ProcessNodeUpdate ¶
func (ctlr *Controller) ProcessNodeUpdate( obj interface{}, err error, )
Check for a change in Node state
func (*Controller) SetupNodePolling ¶
type ControllerMode ¶
type ControllerMode string
type CustomProfile ¶
type CustomProfile struct { Name string `json:"name"` Partition string `json:"-"` Context string `json:"context"` // 'clientside', 'serverside', or 'all' Cert string `json:"cert"` Key string `json:"key"` ServerName string `json:"serverName,omitempty"` SNIDefault bool `json:"sniDefault,omitempty"` PeerCertMode string `json:"peerCertMode,omitempty"` CAFile string `json:"caFile,omitempty"` ChainCA string `json:"chainCA,onitempty"` }
SSL Profile loaded from Secret or Route object
func NewCustomProfile ¶
func NewCustomProfile( profile ProfileRef, cert, key, serverName string, sni bool, peerCertMode, caFile string, chainCA string, ) CustomProfile
type CustomProfileStore ¶
type CustomProfileStore struct { sync.Mutex Profs map[SecretKey]CustomProfile }
Store of CustomProfiles
type DataGroupNamespaceMap ¶
type DataGroupNamespaceMap map[string]*InternalDataGroup
type EssentialInformer ¶
type EssentialInformer struct {
// contains filtered or unexported fields
}
type ExtendedRouteGroupConfig ¶
type ExtendedRouteGroupConfig struct { Namespace string `yaml:"namespace"` // Group Identifier ExtendedRouteGroupSpec `yaml:",inline"` }
type ExtendedRouteGroupSpec ¶
type ExtendedRouteGroupSpec struct { VServerName string `yaml:"vserverName"` VServerAddr string `yaml:"vserverAddr"` AllowOverride string `yaml:"allowOverride"` SNAT string `yaml:"snat"` WAF string `yaml:"waf"` IRules []string `yaml:"iRules,omitempty"` HealthMonitors Monitors `yaml:"healthMonitors,omitempty"` }
type IRule ¶
type IRule struct { Name string `json:"name"` Partition string `json:"-"` Code string `json:"apiAnonymous"` }
iRules
type InternalDataGroup ¶
type InternalDataGroup struct { Name string `json:"name"` Partition string `json:"-"` Records InternalDataGroupRecords `json:"records"` }
func (*InternalDataGroup) AddOrUpdateRecord ¶
func (idg *InternalDataGroup) AddOrUpdateRecord(name, data string) bool
func (*InternalDataGroup) RemoveRecord ¶
func (idg *InternalDataGroup) RemoveRecord(name string) bool
type InternalDataGroupMap ¶
type InternalDataGroupMap map[NameRef]DataGroupNamespaceMap
type InternalDataGroupRecord ¶
type InternalDataGroupRecords ¶
type InternalDataGroupRecords []InternalDataGroupRecord
func (InternalDataGroupRecords) Len ¶
func (slice InternalDataGroupRecords) Len() int
func (InternalDataGroupRecords) Less ¶
func (slice InternalDataGroupRecords) Less(i, j int) bool
func (InternalDataGroupRecords) Swap ¶
func (slice InternalDataGroupRecords) Swap(i, j int)
type LTMConfig ¶
type LTMConfig map[string]ResourceMap
LTMConfig contain partition based ResourceMap
func (LTMConfig) GetAllPoolMembers ¶
func (lc LTMConfig) GetAllPoolMembers() []PoolMember
type Monitor ¶
type Monitor struct { Name string `json:"name"` Partition string `json:"-"` Interval int `json:"interval,omitempty"` Type string `json:"type,omitempty"` Send string `json:"send,omitempty"` Recv string `json:"recv"` Timeout int `json:"timeout,omitempty"` TargetPort int32 `json:"targetPort,omitempty"` Path string `json:"path,omitempty"` InUse bool `json:"-"` }
Monitor is Pool health monitor
type NPLAnnotation ¶
type NPLAnnotation struct { PodPort int32 `json:"podPort"` NodeIP string `json:"nodeIP"` NodePort int32 `json:"nodePort"` }
NPL information from pod annotation
type NPLStore ¶
type NPLStore map[string]NPLAnnoations
key is namespace/pod. stores list of npl annotation on pod
type NRInformer ¶
type NRInformer struct {
// contains filtered or unexported fields
}
NRInformer is informer context for Native Resources of Kubernetes/Openshift
type NSInformer ¶
type NSInformer struct {
// contains filtered or unexported fields
}
type Params ¶
type Params struct { Config *rest.Config Namespaces []string NamespaceLabel string Partition string Agent *Agent PoolMemberType string VXLANName string VXLANMode string UseNodeInternal bool NodePollInterval int NodeLabelSelector string IPAM bool DefaultRouteDomain int Mode ControllerMode RouteSpecConfigmap string RouteLabel string }
Params defines parameters
type Policy ¶
type Policy struct { Name string `json:"name"` Partition string `json:"-"` SubPath string `json:"subPath,omitempty"` Controls []string `json:"controls,omitempty"` Description string `json:"description,omitempty"` Legacy bool `json:"legacy,omitempty"` Requires []string `json:"requires,omitempty"` Rules Rules `json:"rules,omitempty"` Strategy string `json:"strategy,omitempty"` }
Policy Virtual policy
type Pool ¶
type Pool struct { Name string `json:"name"` Partition string `json:"-"` ServiceName string `json:"-"` ServicePort intstr.IntOrString `json:"-"` Balance string `json:"loadBalancingMethod,omitempty"` Members []PoolMember `json:"members"` NodeMemberLabel string `json:"-"` MonitorNames []string `json:"monitors,omitempty"` }
Pool config
type PoolMember ¶
type PoolMemberCache ¶
type PoolMemberCache map[string]poolMembersInfo
PoolMemberCache key is namespace/service
type PostManager ¶
type PostManager struct { PostParams // contains filtered or unexported fields }
func NewPostManager ¶
func NewPostManager(params PostParams) *PostManager
func (*PostManager) GetBigipAS3Version ¶
func (postMgr *PostManager) GetBigipAS3Version() error
GetBigipAS3Version ...
func (*PostManager) GetBigipRegKey ¶
func (postMgr *PostManager) GetBigipRegKey() (string, error)
GetBigipRegKey ...
type PostParams ¶
type ProcessedHostPath ¶
Store of CustomProfiles
type ProfileRef ¶
type ProfileRef struct { Name string `json:"name"` Partition string `json:"partition"` Context string `json:"context"` // 'clientside', 'serverside', or 'all' // Used as reference to which Namespace/Ingress this profile came from // (for deletion purposes) Namespace string `json:"-"` BigIPProfile bool `json:"-"` }
ProfileRef is a Reference to pre-existing profiles
func ConvertStringToProfileRef ¶
func ConvertStringToProfileRef(profileName, context, ns string) ProfileRef
ConvertStringToProfileRef converts strings to profile references
type ProfileRefs ¶
type ProfileRefs []ProfileRef
ProfileRefs is a list of ProfileRef
func (ProfileRefs) Len ¶
func (slice ProfileRefs) Len() int
func (ProfileRefs) Less ¶
func (slice ProfileRefs) Less(i, j int) bool
func (ProfileRefs) Swap ¶
func (slice ProfileRefs) Swap(i, j int)
type ProfileTCP ¶
type ResourceConfig ¶
type ResourceConfig struct { MetaData metaData `json:"-"` Virtual Virtual `json:"virtual,omitempty"` Pools Pools `json:"pools,omitempty"` Policies Policies `json:"policies,omitempty"` Monitors []Monitor `json:"monitors,omitempty"` ServiceAddress []ServiceAddress `json:"serviceAddress,omitempty"` IRulesMap IRulesMap IntDgMap InternalDataGroupMap // contains filtered or unexported fields }
ResourceConfig contains a set of LTM resources to create a Virtual Server
func (*ResourceConfig) AddRuleToPolicy ¶
func (rsCfg *ResourceConfig) AddRuleToPolicy(policyName, partition string, rules *Rules)
func (*ResourceConfig) FindPolicy ¶
func (rc *ResourceConfig) FindPolicy(controlType string) *Policy
FindPolicy gets the information of a policy
func (*ResourceConfig) GetName ¶
func (cfg *ResourceConfig) GetName() string
func (*ResourceConfig) SetPolicy ¶
func (rc *ResourceConfig) SetPolicy(policy Policy)
SetPolicy sets a policy
type ResourceConfigRequest ¶
type ResourceConfigRequest struct {
// contains filtered or unexported fields
}
type ResourceConfigs ¶
type ResourceConfigs []*ResourceConfig
ResourceConfigs is group of ResourceConfig
type ResourceMap ¶
type ResourceMap map[string]*ResourceConfig
ResourceMap key is resource name, value is pointer to config. May be shared.
type ResourceStore ¶
type ResourceStore struct {
// contains filtered or unexported fields
}
ResourceStore contain processed LTM and GTM resource data
func NewResourceStore ¶
func NewResourceStore() *ResourceStore
NewResourceStore is Constructor for ResourceStore
func (*ResourceStore) Init ¶
func (rs *ResourceStore) Init()
Init is Receiver to initialize the object.
type Rule ¶
type Rule struct { Name string `json:"name"` FullURI string `json:"-"` Ordinal int `json:"ordinal,omitempty"` Actions []*action `json:"actions,omitempty"` Conditions []*condition `json:"conditions,omitempty"` }
Rule config for a Policy
type ServiceAddress ¶
type ServiceAddress struct { ArpEnabled bool `json:"arpEnabled,omitempty"` ICMPEcho string `json:"icmpEcho,omitempty"` RouteAdvertisement string `json:"routeAdvertisement,omitempty"` TrafficGroup string `json:"trafficGroup,omitempty"` SpanningEnabled bool `json:"spanningEnabled,omitempty"` }
ServiceAddress Service IP address definition (BIG-IP virtual-address).
type ServiceTypeLBHealthMonitor ¶
type ServiceTypeLBHealthMonitor struct { Interval int `json:"interval"` Timeout int `json:"timeout"` }
This is the format for each item in the health monitor annotation used in the ServiceType LB objects.
type SourceAddrTranslation ¶
SourceAddrTranslation is Virtual Server Source Address Translation
type TLSContext ¶
type TLSContext struct {
// contains filtered or unexported fields
}
type Virtual ¶
type Virtual struct { Name string `json:"name"` PoolName string `json:"pool,omitempty"` Partition string `json:"-"` Destination string `json:"destination"` Enabled bool `json:"enabled"` IpProtocol string `json:"ipProtocol,omitempty"` SourceAddrTranslation SourceAddrTranslation `json:"sourceAddressTranslation,omitempty"` Policies []nameRef `json:"policies,omitempty"` Profiles ProfileRefs `json:"profiles,omitempty"` IRules []string `json:"rules,omitempty"` Description string `json:"description,omitempty"` VirtualAddress *virtualAddress `json:"-"` SNAT string `json:"snat,omitempty"` WAF string `json:"waf,omitempty"` Firewall string `json:"firewallPolicy,omitempty"` LogProfiles []string `json:"logProfiles,omitempty"` ProfileL4 string `json:"profileL4,omitempty"` ProfileMultiplex string `json:"profileMultiplex,omitempty"` ProfileDOS string `json:"profileDOS,omitempty"` ProfileBotDefense string `json:"profileBotDefense,omitempty"` TCP ProfileTCP `json:"tcp,omitempty"` Mode string `json:"mode,omitempty"` TranslateServerAddress bool `json:"translateServerAddress"` TranslateServerPort bool `json:"translateServerPort"` Source string `json:"source,omitempty"` AllowVLANs []string `json:"allowVlans,omitempty"` PersistenceProfile string `json:"persistenceProfile,omitempty"` TLSTermination string `json:"-"` }
Virtual server config
func (*Virtual) AddOrUpdateProfile ¶
func (v *Virtual) AddOrUpdateProfile(prof ProfileRef) bool
AddOrUpdateProfile updates profile to rsCfg
func (*Virtual) SetVirtualAddress ¶
SetVirtualAddress sets a VirtualAddress