Documentation ¶
Index ¶
- Constants
- Variables
- func Contains(x interface{}, y interface{}) bool
- func ExtractCertificateName(fn string) string
- func FormatConfigMapVSName(cm *v1.ConfigMap) string
- func FormatIngressPoolName(namespace, svc string) string
- func FormatIngressSslProfileName(secret string) string
- func FormatIngressVSName(ip string, port int32) string
- func FormatMonitorName(poolName, monitorType string) string
- func FormatRoutePoolName(namespace, svcName string) string
- func GetServicePort(ns string, svcName string, svcIndexer cache.Indexer, portName string, ...) (int32, error)
- func IsAnnotationRule(ruleName string) bool
- func JoinBigipPath(partition, objName string) string
- func MakeCertificateFileName(partition, name string) string
- func NewObjectDependencies(obj interface{}) (ObjectDependency, ObjectDependencies)
- func ParseAnnotationURL(urlString string) *url.URL
- func ParseAppRootURLRewriteAnnotations(annotation string) map[string]string
- func ParseRewriteAction(targetUrlPath, valueUrlPath string) string
- func ParseWhitelistSourceRangeAnnotations(annotation string) []string
- func SetAnnotationRulesForRoute(policyName string, urlRewriteRule *Rule, appRootRules []*Rule, ...)
- func SetProfilesForMode(mode string, cfg *ResourceConfig)
- func SplitBigipPath(path string, keepSlash bool) (partition, objName string)
- func Split_ip_with_route_domain(address string) (ip string, rd string)
- type Action
- type AgentCfgMap
- type AgentResources
- type AnnotationHealthMonitor
- type AnnotationHealthMonitors
- type AnnotationProfile
- type AnnotationProfiles
- type BigIPConfig
- type Condition
- type ConfigMap
- type ConfigMapMonitor
- type ConstVirtuals
- type CustomProfile
- type CustomProfileStore
- type DataGroupNamespaceMap
- type F5Resources
- type FlattenConflictFunc
- type HostToPathMap
- type IApp
- type IRule
- type IRulesMap
- type InternalDataGroup
- type InternalDataGroupMap
- type InternalDataGroupRecord
- type InternalDataGroupRecords
- type InternalF5Resources
- type InternalF5ResourcesGroup
- type Member
- type MergedRuleEntry
- type MessageRequest
- type MessageResponse
- type MetaData
- type Monitor
- type Monitors
- type NameRef
- type ObjectDependencies
- type ObjectDependency
- type ObjectDependencyMap
- type PartitionMap
- type PathToRuleMap
- type Policies
- type Policy
- type Pool
- type Pools
- type ProfileRef
- type ProfileRefs
- type Record
- type ResourceConfig
- func (rc *ResourceConfig) AddRuleToPolicy(policyName string, rule *Rule)
- func (rc *ResourceConfig) CopyConfig(cfg *ResourceConfig)
- func (rc *ResourceConfig) DeleteRouteProfile(namespace, name string)
- func (rc *ResourceConfig) DeleteRuleFromPolicy(policyName string, rule *Rule, ...)
- func (rsCfg *ResourceConfig) DeleteWhitelistCondition()
- func (rc *ResourceConfig) FindPolicy(controlType string) *Policy
- func (cfg *ResourceConfig) GetName() string
- func (cfg *ResourceConfig) GetPartition() string
- func (rc *ResourceConfig) MergeRules(mergedRulesMap map[string]map[string]MergedRuleEntry)
- func (rc *ResourceConfig) RemoveMonitor(pool string) bool
- func (rc *ResourceConfig) RemovePolicy(policy Policy)
- func (rc *ResourceConfig) RemovePool(namespace, poolName string, ...) (bool, *ServiceKey)
- func (rc *ResourceConfig) RemovePoolAt(offset int) bool
- func (rc *ResourceConfig) SetMonitor(pool *Pool, monitor Monitor) bool
- func (rc *ResourceConfig) SetPolicy(policy Policy)
- func (rc *ResourceConfig) SortMonitors()
- func (rc *ResourceConfig) UnmergeRule(ruleName string, mergedRulesMap map[string]map[string]MergedRuleEntry) bool
- type ResourceConfigMap
- type ResourceConfigs
- type ResourceEnumFunc
- type ResourceInterface
- type ResourceRequest
- type ResourceResponse
- type Resources
- func (rs *Resources) Assign(svcKey ServiceKey, name string, cfg *ResourceConfig)
- func (rs *Resources) CountOf(svcKey ServiceKey) int
- func (rs *Resources) Delete(svcKey ServiceKey, name string) bool
- func (rs *Resources) DeleteKeyRef(sKey ServiceKey, name string) bool
- func (rs *Resources) DeleteKeyRefLocked(sKey ServiceKey, name string) bool
- func (rs *Resources) ForEach(f ResourceEnumFunc)
- func (rs *Resources) Get(svcKey ServiceKey, name string) (*ResourceConfig, bool)
- func (rs *Resources) GetAll(svcKey ServiceKey) ResourceConfigs
- func (rs *Resources) GetAllResources() ResourceConfigs
- func (rs *Resources) GetAllWithName(name string) (ResourceConfigs, []ServiceKey)
- func (rs *Resources) GetByName(name string) (*ResourceConfig, bool)
- func (rs *Resources) Init()
- func (rs *Resources) PoolCount() int
- func (rs *Resources) RemoveDependency(key ObjectDependency)
- func (rs *Resources) UpdateDependencies(newKey ObjectDependency, newDeps ObjectDependencies, ...) ([]ObjectDependency, []ObjectDependency)
- func (rs *Resources) UpdatePolicy(rsName string, policyName string, ruleName string)
- func (rs *Resources) VirtualCount() int
- type RouteKey
- type RouteService
- type Rule
- type RuleData
- type RuleMap
- type Rules
- type SecretKey
- type ServiceAddress
- type ServiceKey
- type SourceAddrTranslation
- type Virtual
- func (v *Virtual) AddIRule(ruleName string) bool
- func (v *Virtual) AddOrUpdateProfile(prof ProfileRef) bool
- func (v *Virtual) GetProfileCountByContext(context string) int
- func (v *Virtual) ReferencesProfile(profile CustomProfile) bool
- func (v *Virtual) RemoveIRule(ruleName string) bool
- func (v *Virtual) RemoveProfile(prof ProfileRef) bool
- func (v *Virtual) SetVirtualAddress(bindAddr string, port int32)
- func (v *Virtual) ToString() string
- type VirtualAddress
- type Virtuals
Constants ¶
const ( MultiServiceIngressType = iota SingleServiceIngressType RouteType )
const ( DEFAULT_MODE string = "tcp" DEFAULT_BALANCE string = "round-robin" DEFAULT_HTTP_PORT int32 = 80 DEFAULT_HTTPS_PORT int32 = 443 InsecurePolicyName = "openshift_insecure_routes" SecurePolicyName = "openshift_secure_routes" // 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 for Resource Types ResourceTypeIngress string = "ingress" ResourceTypeRoute string = "route" ResourceTypeCfgMap string = "cfgMap" DefaultSourceAddrTranslation = "automap" SnatSourceAddrTranslation = "snat" )
const AbDeploymentDgName = "ab_deployment_dg"
Internal data group for ab deployment routes.
const AbDeploymentPathIRuleName = "ab_deployment_path_irule"
const AppRootDep = "App-Root-Annotation"
const CISControllerName = "f5.com/cntr-ingress-svcs"
const DefaultConfigMapLabel = "f5type in (virtual-server)"
const DefaultIngressClass = "ingressclass.kubernetes.io/is-default-class"
const DefaultSslServerCAName = "openshift_route_cluster_default-ca"
const EdgeHostsDgName = "ssl_edge_servername_dg"
Internal data group for edge routes.
const EdgeServerSslDgName = "ssl_edge_serverssl_dg"
Internal data group for edge routes that maps the host name to the false. This will help Irule to understand ssl should be disabled on serverside.
const F5ClientSslProfileAnnotation = "virtual-server.f5.com/clientssl"
const F5ServerSslProfileAnnotation = "virtual-server.f5.com/serverssl"
const F5ServerSslSecureAnnotation = "virtual-server.f5.com/secure-serverssl"
const F5VsAllowSourceRangeAnnotation = "virtual-server.f5.com/allow-source-range"
const F5VsAppRootAnnotation = "virtual-server.f5.com/rewrite-app-root"
const F5VsBalanceAnnotation = "virtual-server.f5.com/balance"
const F5VsBindAddrAnnotation = "virtual-server.f5.com/ip"
const F5VsHttpPortAnnotation = "virtual-server.f5.com/http-port"
const F5VsHttpsPortAnnotation = "virtual-server.f5.com/https-port"
const F5VsPartitionAnnotation = "virtual-server.f5.com/partition"
const F5VsURLRewriteAnnotation = "virtual-server.f5.com/rewrite-target-url"
const F5VsWAFPolicy = "virtual-server.f5.com/waf"
const F5VsWhitelistSourceRangeAnnotation = "virtual-server.f5.com/whitelist-source-range"
const HealthMonitorAnnotation = "virtual-server.f5.com/health"
const HttpRedirectIRuleName = "http_redirect_irule"
const HttpsRedirectDgName = "https_redirect_dg"
Internal data group for https redirect
const IngressAllowHttp = "ingress.kubernetes.io/allow-http"
const IngressSslRedirect = "ingress.kubernetes.io/ssl-redirect"
const K8sIngressClass = "kubernetes.io/ingress.class"
const NodePortLocal = "nodeportlocal"
const OprTypeCreate = "create"
const OprTypeDelete = "delete"
const OprTypeUpdate = "update"
const PassthroughHostsDgName = "ssl_passthrough_servername_dg"
Internal data group for passthrough routes to map server names to pools.
const ReencryptHostsDgName = "ssl_reencrypt_servername_dg"
Internal data group for reencrypt routes.
const ReencryptServerSslDgName = "ssl_reencrypt_serverssl_dg"
Internal data group for reencrypt routes that maps the host name to the server ssl profile.
const RuleDep = "Rule"
const ServiceDep = "Service"
const SslPassthroughIRuleName = "openshift_passthrough_irule"
const URLDep = "URL-Rewrite-Annotation"
const VsStatusBindAddrAnnotation = "status.virtual-server.f5.com/ip"
const WhitelistDep = "Whitelist-Annotation"
Variables ¶
var DEFAULT_PARTITION string = "k8s"
Functions ¶
func Contains ¶
func Contains(x interface{}, y interface{}) bool
Contains returns whether x Contains y
func ExtractCertificateName ¶
func FormatConfigMapVSName ¶
To handle VS name which start with Number, we are prefixing with 'cfgmap_' to avoid errors with bigip.
func FormatIngressPoolName ¶
format the pool name for an Ingress
func FormatIngressVSName ¶
format the virtual server name for an Ingress
func FormatMonitorName ¶
formats a health monitor name
func FormatRoutePoolName ¶
format the pool name for a Route
func GetServicePort ¶
func GetServicePort( ns string, svcName string, svcIndexer cache.Indexer, portName string, rscType string, ) (int32, error)
GetServicePort returns the port number, for a given port name, else, returns the first port found for a Route's service.
func IsAnnotationRule ¶
func JoinBigipPath ¶
func MakeCertificateFileName ¶
func NewObjectDependencies ¶
func NewObjectDependencies( obj interface{}, ) (ObjectDependency, ObjectDependencies)
NewObjectDependencies parses an object and returns a map of its dependencies
func ParseAnnotationURL ¶
func ParseRewriteAction ¶
func SetAnnotationRulesForRoute ¶
func SetAnnotationRulesForRoute( policyName string, urlRewriteRule *Rule, appRootRules []*Rule, rc *ResourceConfig, skipUrlRewriteRule bool, )
func SetProfilesForMode ¶
func SetProfilesForMode(mode string, cfg *ResourceConfig)
func SplitBigipPath ¶
Types ¶
type Action ¶
type Action struct { Name string `json:"name"` Pool string `json:"pool,omitempty"` HTTPHost bool `json:"httpHost,omitempty"` HttpReply bool `json:"httpReply,omitempty"` HTTPURI bool `json:"httpUri,omitempty"` Forward bool `json:"forward,omitempty"` Location string `json:"location,omitempty"` Path string `json:"path,omitempty"` Redirect bool `json:"redirect,omitempty"` Replace bool `json:"replace,omitempty"` Request bool `json:"request,omitempty"` Reset bool `json:"reset,omitempty"` Select bool `json:"select,omitempty"` Value string `json:"value,omitempty"` }
Action config for a Rule
type AgentCfgMap ¶
type AgentResources ¶
type AgentResources struct { RsMap ResourceConfigMap RsCfgs ResourceConfigs }
type AnnotationHealthMonitor ¶
type AnnotationHealthMonitor struct { Path string `json:"path"` Interval int `json:"interval"` Send string `json:"send"` Recv string `json:"recv"` Timeout int `json:"timeout"` Type string `json:"type"` }
This is the format for each item in the health monitor annotation used in the Ingress and Route objects.
type AnnotationHealthMonitors ¶
type AnnotationHealthMonitors []AnnotationHealthMonitor
type AnnotationProfile ¶
type AnnotationProfile struct { Hosts []string `json:"hosts,omitempty"` Bigipprofile string `json:"bigIpProfile"` }
This is the format for each item in the clientssl annotation used in the Ingress objects.
type AnnotationProfiles ¶
type AnnotationProfiles []AnnotationProfile
type BigIPConfig ¶
type BigIPConfig struct { Virtuals Virtuals `json:"virtualServers,omitempty"` Pools Pools `json:"pools,omitempty"` Monitors Monitors `json:"monitors,omitempty"` Policies []Policy `json:"l7Policies,omitempty"` CustomProfiles []CustomProfile `json:"customProfiles,omitempty"` IRules []IRule `json:"iRules,omitempty"` InternalDataGroups []InternalDataGroup `json:"internalDataGroups,omitempty"` IApps []IApp `json:"iapps,omitempty"` ServiceIPAddress []ServiceAddress `json:"serviceAddress,omitempty"` }
Config of all resources to configure on the BIG-IP
func (*BigIPConfig) SortMonitors ¶
func (cfg *BigIPConfig) SortMonitors()
func (*BigIPConfig) SortPools ¶
func (cfg *BigIPConfig) SortPools()
func (*BigIPConfig) SortVirtuals ¶
func (cfg *BigIPConfig) SortVirtuals()
type Condition ¶
type Condition struct { Name string `json:"name"` Address bool `json:"address,omitempty"` CaseInsensitive bool `json:"caseInsensitive,omitempty"` Equals bool `json:"equals,omitempty"` EndsWith bool `json:"endsWith,omitempty"` External bool `json:"external,omitempty"` HTTPHost bool `json:"httpHost,omitempty"` Host bool `json:"host,omitempty"` HTTPURI bool `json:"httpUri,omitempty"` Index int `json:"index,omitempty"` Matches bool `json:"matches,omitempty"` Path bool `json:"path,omitempty"` PathSegment bool `json:"pathSegment,omitempty"` Present bool `json:"present,omitempty"` Remote bool `json:"remote,omitempty"` Request bool `json:"request,omitempty"` Scheme bool `json:"scheme,omitempty"` Tcp bool `json:"tcp,omitempty"` Values []string `json:"values"` }
Condition config for a Rule
type ConfigMap ¶
type ConfigMap struct {
VirtualServer struct {
Backend configMapBackend `json:"backend"`
Frontend configMapFrontend `json:"frontend"`
} `json:"virtualServer"`
}
Used to unmarshal ConfigMap data
type ConfigMapMonitor ¶
type ConfigMapMonitor struct { Name string `json:"name"` Partition string `json:"partition,omitempty"` Interval int `json:"interval,omitempty"` Protocol string `json:"protocol,omitempty"` Send string `json:"send,omitempty"` Recv string `json:"recv,omitempty"` Timeout int `json:"timeout,omitempty"` }
type ConstVirtuals ¶
type ConstVirtuals int
AS3 Backend supported features
const ( HTTP ConstVirtuals = iota HTTPS HTTPANDS )
Determines which virtual server needs a specific feature applied.
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
func (DataGroupNamespaceMap) FlattenNamespaces ¶
func (dgnm DataGroupNamespaceMap) FlattenNamespaces() *InternalDataGroup
type F5Resources ¶
type F5Resources struct { Virtual ConstVirtuals // 0 - HTTP, 1 - HTTPS, 2 - HTTP/S WAFPolicy string }
type FlattenConflictFunc ¶
DataGroup flattening.
type HostToPathMap ¶
type HostToPathMap map[string]PathToRuleMap
type IApp ¶
type IApp struct { Name string `json:"name"` Partition string `json:"-"` IApp string `json:"template"` IAppPoolMemberTable *iappPoolMemberTable `json:"poolMemberTable,omitempty"` IAppOptions map[string]string `json:"options,omitempty"` IAppTables map[string]iappTableEntry `json:"tables,omitempty"` IAppVariables map[string]string `json:"variables,omitempty"` }
IApp
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 NewInternalDataGroup ¶
func NewInternalDataGroup(name, partition string) *InternalDataGroup
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 InternalF5Resources ¶
type InternalF5Resources map[Record]F5Resources
type InternalF5ResourcesGroup ¶
type InternalF5ResourcesGroup map[string]InternalF5Resources
Routes annotation features that are possible by an AS3 declaration can be added here. Initially enabling a WAF policy is added as an AS3 feature. | Host + Path | Virtual Server to Apply | WAF Policy Name | |-------------|-------------------------|-----------------| Host + Path is a unique record. The columns can be extended to add future features. InternalF5ResourcesGroup takes OpenShift/Kubernetes namespace as key
type Member ¶
type Member struct { Address string `json:"address"` Port int32 `json:"port"` SvcPort int32 `json:"svcPort"` Session string `json:"session,omitempty"` }
Pool Member
type MergedRuleEntry ¶
type MessageRequest ¶
type MessageRequest struct { ReqID uint MsgType string ResourceRequest }
type MessageResponse ¶
type MessageResponse struct { ReqID uint ResourceResponse }
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,omitempty"` Timeout int `json:"timeout,omitempty"` }
Pool health monitor
type ObjectDependencies ¶
type ObjectDependencies map[ObjectDependency]int
ObjectDependencies contains each dependency and its use count (usually 1)
type ObjectDependency ¶
ObjectDependency identifies a K8s Object
type ObjectDependencyMap ¶
type ObjectDependencyMap map[ObjectDependency]ObjectDependencies
ObjectDependencyMap key is an Ingress or Route and the value is a map of other objects it depends on - typically services.
type PathToRuleMap ¶
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"` }
Virtual policy
func CreatePolicy ¶
func (*Policy) RemoveRuleAt ¶
func (*Policy) RemoveRules ¶
type Pool ¶
type Pool struct { Name string `json:"name"` Partition string `json:"-"` ServiceName string `json:"-"` ServicePort int32 `json:"-"` Balance string `json:"loadBalancingMode"` Members []Member `json:"members"` MonitorNames []string `json:"monitors,omitempty"` }
Pool config
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:"-"` }
Reference to pre-existing profiles
func ConvertStringToProfileRef ¶
func ConvertStringToProfileRef(profileName, context, ns string) ProfileRef
func MakeRouteClientSSLProfileRef ¶
func MakeRouteClientSSLProfileRef(partition, namespace, name string) ProfileRef
format the client ssl profile name for a Route
func MakeRouteServerSSLProfileRef ¶
func MakeRouteServerSSLProfileRef(partition, namespace, name string) ProfileRef
format the server ssl profile name for a Route
type ProfileRefs ¶
type ProfileRefs []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 ResourceConfig ¶
type ResourceConfig struct { MetaData MetaData `json:"-"` Virtual Virtual `json:"virtual,omitempty"` IApp IApp `json:"iapp,omitempty"` Pools Pools `json:"pools,omitempty"` Monitors Monitors `json:"monitors,omitempty"` Policies Policies `json:"policies,omitempty"` ServiceAddress []ServiceAddress `json:"serviceAddress,omitempty"` }
Config for a single resource (ConfigMap, Ingress, or Route)
func ParseConfigMap ¶
func ParseConfigMap(cm *v1.ConfigMap, schemaDBPath, snatPoolName string) (*ResourceConfig, error)
Unmarshal an expected ConfigMap object
func (*ResourceConfig) AddRuleToPolicy ¶
func (rc *ResourceConfig) AddRuleToPolicy( policyName string, rule *Rule, )
func (*ResourceConfig) CopyConfig ¶
func (rc *ResourceConfig) CopyConfig(cfg *ResourceConfig)
Copies from an existing config into our new config
func (*ResourceConfig) DeleteRouteProfile ¶
func (rc *ResourceConfig) DeleteRouteProfile(namespace, name string)
func (*ResourceConfig) DeleteRuleFromPolicy ¶
func (rc *ResourceConfig) DeleteRuleFromPolicy( policyName string, rule *Rule, mergedRulesMap map[string]map[string]MergedRuleEntry, )
func (*ResourceConfig) DeleteWhitelistCondition ¶
func (rsCfg *ResourceConfig) DeleteWhitelistCondition()
Deletes a whitelist reset rule
func (*ResourceConfig) FindPolicy ¶
func (rc *ResourceConfig) FindPolicy(controlType string) *Policy
func (*ResourceConfig) GetName ¶
func (cfg *ResourceConfig) GetName() string
func (*ResourceConfig) GetPartition ¶
func (cfg *ResourceConfig) GetPartition() string
func (*ResourceConfig) MergeRules ¶
func (rc *ResourceConfig) MergeRules(mergedRulesMap map[string]map[string]MergedRuleEntry)
func (*ResourceConfig) RemoveMonitor ¶
func (rc *ResourceConfig) RemoveMonitor(pool string) bool
func (*ResourceConfig) RemovePolicy ¶
func (rc *ResourceConfig) RemovePolicy(policy Policy)
func (*ResourceConfig) RemovePool ¶
func (rc *ResourceConfig) RemovePool( namespace, poolName string, mergedRulesMap map[string]map[string]MergedRuleEntry, ) (bool, *ServiceKey)
func (*ResourceConfig) RemovePoolAt ¶
func (rc *ResourceConfig) RemovePoolAt(offset int) bool
func (*ResourceConfig) SetMonitor ¶
func (rc *ResourceConfig) SetMonitor(pool *Pool, monitor Monitor) bool
func (*ResourceConfig) SetPolicy ¶
func (rc *ResourceConfig) SetPolicy(policy Policy)
func (*ResourceConfig) SortMonitors ¶
func (rc *ResourceConfig) SortMonitors()
func (*ResourceConfig) UnmergeRule ¶
func (rc *ResourceConfig) UnmergeRule(ruleName string, mergedRulesMap map[string]map[string]MergedRuleEntry) bool
type ResourceConfigMap ¶
type ResourceConfigMap map[string]*ResourceConfig
Key is resource name, value is pointer to config. May be shared.
type ResourceConfigs ¶
type ResourceConfigs []*ResourceConfig
type ResourceEnumFunc ¶
type ResourceEnumFunc func(key ServiceKey, cfg *ResourceConfig)
callback type for ForEach()
type ResourceInterface ¶
type ResourceInterface interface { Init() Assign(key ServiceKey, name string, cfg *ResourceConfig) PoolCount() int VirtualCount() int CountOf(key ServiceKey) int Get(key ServiceKey, name string) (*ResourceConfig, bool) GetAll(key ServiceKey) ResourceConfigs GetAllWithName(name string) (ResourceConfigs, []ServiceKey) GetAllResources() ResourceConfigs Delete(key ServiceKey, name string) bool ForEach(f ResourceEnumFunc) DependencyDiff(key ObjectDependency, newDeps ObjectDependencies) ([]ObjectDependency, []ObjectDependency) }
type ResourceRequest ¶
type ResourceRequest struct { PoolMembers map[Member]struct{} Resources *AgentResources Profs map[SecretKey]CustomProfile IrulesMap IRulesMap IntDgMap InternalDataGroupMap IntF5Res InternalF5ResourcesGroup AgentCfgmaps []*AgentCfgMap }
type ResourceResponse ¶
type ResourceResponse struct {
IsResponseSuccessful bool
}
type Resources ¶
type Resources struct { sync.Mutex RsMap ResourceConfigMap // contains filtered or unexported fields }
Map of Resource configs
func (*Resources) Assign ¶
func (rs *Resources) Assign(svcKey ServiceKey, name string, cfg *ResourceConfig)
Add or update a Resource config, identified by key.
func (*Resources) CountOf ¶
func (rs *Resources) CountOf(svcKey ServiceKey) int
Count of all configurations for a specific backend.
func (*Resources) Delete ¶
func (rs *Resources) Delete(svcKey ServiceKey, name string) bool
Remove a specific resource configuration.
func (*Resources) DeleteKeyRef ¶
func (rs *Resources) DeleteKeyRef(sKey ServiceKey, name string) bool
Remove a svcKey's reference to a config (pool was removed)
func (*Resources) DeleteKeyRefLocked ¶
func (rs *Resources) DeleteKeyRefLocked(sKey ServiceKey, name string) bool
Remove a svcKey's reference to a config (pool was removed)
func (*Resources) ForEach ¶
func (rs *Resources) ForEach(f ResourceEnumFunc)
Iterate over all configurations, calling the supplied callback with each.
func (*Resources) Get ¶
func (rs *Resources) Get(svcKey ServiceKey, name string) (*ResourceConfig, bool)
Get a specific Resource cfg
func (*Resources) GetAll ¶
func (rs *Resources) GetAll(svcKey ServiceKey) ResourceConfigs
Get all configurations for a specific backend
func (*Resources) GetAllResources ¶
func (rs *Resources) GetAllResources() ResourceConfigs
func (*Resources) GetAllWithName ¶
func (rs *Resources) GetAllWithName(name string) (ResourceConfigs, []ServiceKey)
Get all configurations with a specific name, spanning multiple backends This is for multi-service ingress
func (*Resources) GetByName ¶
func (rs *Resources) GetByName(name string) (*ResourceConfig, bool)
Get a specific Resource cfg
func (*Resources) RemoveDependency ¶
func (rs *Resources) RemoveDependency( key ObjectDependency, )
RemoveDependency will remove the object dependencies from the rs.objDeps map for given route
func (*Resources) UpdateDependencies ¶
func (rs *Resources) UpdateDependencies( newKey ObjectDependency, newDeps ObjectDependencies, svcDepKey ObjectDependency, lookupFunc func(key ObjectDependency) bool, ) ([]ObjectDependency, []ObjectDependency)
UpdateDependencies will keep the rs.objDeps map updated, and return two arrays identifying what has changed - added for dependencies that were added, and removed for dependencies that were removed.
func (*Resources) UpdatePolicy ¶
UpdatePolicy will keep the rs.RsMap map updated and remove the unwanted rules from policy,
func (*Resources) VirtualCount ¶
Count of all virtuals currently stored.
type RouteService ¶
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
func CreateRule ¶
func ProcessURLRewrite ¶
type RuleData ¶
type RuleData struct { SvcName string SvcPort int32 HealthMon AnnotationHealthMonitor Assigned bool }
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,omitempty"` SpanningEnabled bool `json:"spanningEnabled,omitempty"` }
type ServiceKey ¶
Virtual Server Key - unique server is Name + Port
type SourceAddrTranslation ¶
Virtual Server Source Address Translation
func SetSourceAddrTranslation ¶
func SetSourceAddrTranslation(snatPoolName string) SourceAddrTranslation
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"` IRules []string `json:"rules,omitempty"` Profiles ProfileRefs `json:"profiles,omitempty"` Description string `json:"description,omitempty"` VirtualAddress *VirtualAddress `json:"-"` }
Virtual server config
func (*Virtual) AddOrUpdateProfile ¶
func (v *Virtual) AddOrUpdateProfile(prof ProfileRef) bool
func (*Virtual) GetProfileCountByContext ¶
func (*Virtual) ReferencesProfile ¶
func (v *Virtual) ReferencesProfile(profile CustomProfile) bool
func (*Virtual) RemoveIRule ¶
Removes an IRule reference from a Virtual object
func (*Virtual) RemoveProfile ¶
func (v *Virtual) RemoveProfile(prof ProfileRef) bool
func (*Virtual) SetVirtualAddress ¶
type VirtualAddress ¶
type VirtualAddress struct { BindAddr string `json:"bindAddr,omitempty"` Port int32 `json:"port,omitempty"` }
frontend bindaddr and port