Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteActiveNLBMetrics(ic *operatorv1.IngressController)
- func DeleteIngressControllerConditionsMetric(ic *operatorv1.IngressController)
- func DetermineReplicas(ingressConfig *configv1.Ingress, infraConfig *configv1.Infrastructure) int32
- func GetMIMETypes(mimeTypes []operatorv1.CompressionMIMEType) []string
- func HTTP2IsEnabled(ic *operatorv1.IngressController, ingressConfig *configv1.Ingress) bool
- func HTTP2IsEnabledByAnnotation(m map[string]string) (bool, bool)
- func HardStopAfterIsEnabled(ic *operatorv1.IngressController, ingressConfig *configv1.Ingress) (bool, string)
- func HardStopAfterIsEnabledByAnnotation(m map[string]string) (bool, string)
- func IngressStatusesEqual(a, b operatorv1.IngressControllerStatus) bool
- func IsProxyProtocolNeeded(ic *operatorv1.IngressController, platform *configv1.PlatformStatus) (bool, error)
- func IsServiceInternal(service *corev1.Service) bool
- func IsStatusDomainSet(ingress *operatorv1.IngressController) bool
- func JoinAWSEIPAllocations(eipAllocations []operatorv1.EIPAllocation, sep string) string
- func JoinAWSSubnets(subnets *operatorv1.AWSSubnets, sep string) string
- func MergeConditions(conditions []operatorv1.OperatorCondition, ...) []operatorv1.OperatorCondition
- func New(mgr manager.Manager, config Config) (controller.Controller, error)
- func PruneConditions(conditions []operatorv1.OperatorCondition) []operatorv1.OperatorCondition
- func RegisterMetrics() error
- func SetIngressControllerConditionsMetric(ic *operatorv1.IngressController)
- func SetIngressControllerNLBMetric(ci *operatorv1.IngressController)
- type Config
Constants ¶
const ( IngressControllerAdmittedConditionType = "Admitted" IngressControllerDeploymentAvailableConditionType = "DeploymentAvailable" IngressControllerDeploymentReplicasMinAvailableConditionType = "DeploymentReplicasMinAvailable" IngressControllerDeploymentReplicasAllAvailableConditionType = "DeploymentReplicasAllAvailable" IngressControllerDeploymentRollingOutConditionType = "DeploymentRollingOut" IngressControllerLoadBalancerProgressingConditionType = "LoadBalancerProgressing" IngressControllerCanaryCheckSuccessConditionType = "CanaryChecksSucceeding" IngressControllerEvaluationConditionsDetectedConditionType = "EvaluationConditionsDetected" )
TODO: consider moving these to openshift/api
const ( WildcardRouteAdmissionPolicy = "ROUTER_ALLOW_WILDCARD_ROUTES" RouterForwardedHeadersPolicy = "ROUTER_SET_FORWARDED_HEADERS" RouterUniqueHeaderName = "ROUTER_UNIQUE_ID_HEADER_NAME" RouterUniqueHeaderFormat = "ROUTER_UNIQUE_ID_FORMAT" RouterHTTPHeaderNameCaseAdjustments = "ROUTER_H1_CASE_ADJUST" RouterLogLevelEnvName = "ROUTER_LOG_LEVEL" RouterLogMaxLengthEnvName = "ROUTER_LOG_MAX_LENGTH" RouterSyslogAddressEnvName = "ROUTER_SYSLOG_ADDRESS" RouterSyslogFormatEnvName = "ROUTER_SYSLOG_FORMAT" RouterSyslogFacilityEnvName = "ROUTER_LOG_FACILITY" RouterCaptureHTTPRequestHeaders = "ROUTER_CAPTURE_HTTP_REQUEST_HEADERS" RouterCaptureHTTPResponseHeaders = "ROUTER_CAPTURE_HTTP_RESPONSE_HEADERS" RouterCaptureHTTPCookies = "ROUTER_CAPTURE_HTTP_COOKIE" RouterHTTPResponseHeaders = "ROUTER_HTTP_RESPONSE_HEADERS" RouterHTTPRequestHeaders = "ROUTER_HTTP_REQUEST_HEADERS" RouterHeaderBufferSize = "ROUTER_BUF_SIZE" RouterHeaderBufferMaxRewriteSize = "ROUTER_MAX_REWRITE_SIZE" RouterLoadBalancingAlgorithmEnvName = "ROUTER_LOAD_BALANCE_ALGORITHM" RouterTCPLoadBalancingAlgorithmEnvName = "ROUTER_TCP_BALANCE_SCHEME" RouterMaxConnectionsEnvName = "ROUTER_MAX_CONNECTIONS" RouterReloadIntervalEnvName = "RELOAD_INTERVAL" RouterDontLogNull = "ROUTER_DONT_LOG_NULL" RouterHTTPIgnoreProbes = "ROUTER_HTTP_IGNORE_PROBES" RouterDisableHTTP2EnvName = "ROUTER_DISABLE_HTTP2" RouterDefaultEnableHTTP2Annotation = "ingress.operator.openshift.io/default-enable-http2" RouterHardStopAfterEnvName = "ROUTER_HARD_STOP_AFTER" RouterHardStopAfterAnnotation = "ingress.operator.openshift.io/hard-stop-after" LivenessGracePeriodSecondsAnnotation = "unsupported.do-not-use.openshift.io/override-liveness-grace-period-seconds" RouterHAProxyConfigManager = "ROUTER_HAPROXY_CONFIG_MANAGER" RouterHAProxyMaxDynamicServers = "ROUTER_MAX_DYNAMIC_SERVERS" RouterHAProxyMaxDynamicServersDefaultValue = 1 RouterHAProxyBlueprintRoutePoolSize = "ROUTER_BLUEPRINT_ROUTE_POOL_SIZE" RouterHAProxyContstats = "ROUTER_HAPROXY_CONTSTATS" RouterHAProxyThreadsEnvName = "ROUTER_THREADS" RouterHAProxyThreadsDefaultValue = 4 WorkloadPartitioningManagement = "target.workload.openshift.io/management" RouterClientAuthPolicy = "ROUTER_MUTUAL_TLS_AUTH" RouterClientAuthCA = "ROUTER_MUTUAL_TLS_AUTH_CA" RouterClientAuthFilter = "ROUTER_MUTUAL_TLS_AUTH_FILTER" RouterEnableCompression = "ROUTER_ENABLE_COMPRESSION" RouterCompressionMIMETypes = "ROUTER_COMPRESSION_MIME" RouterBackendCheckInterval = "ROUTER_BACKEND_CHECK_INTERVAL" RouterServiceHTTPPort = "ROUTER_SERVICE_HTTP_PORT" RouterServiceHTTPSPort = "ROUTER_SERVICE_HTTPS_PORT" StatsPort = "STATS_PORT" HTTPPortName = "http" HTTPSPortName = "https" StatsPortName = "metrics" )
const ( // AWSLBTypeAnnotation is a Service annotation used to specify an AWS load // balancer type. See the following for additional details: // // https://kubernetes.io/docs/concepts/services-networking/service/#aws-nlb-support AWSLBTypeAnnotation = "service.beta.kubernetes.io/aws-load-balancer-type" // AWSNLBAnnotation is the annotation value of an AWS Network Load Balancer (NLB). AWSNLBAnnotation = "nlb" // GCPGlobalAccessAnnotation is the annotation used on an internal load balancer service // to enable the GCP Global Access feature. GCPGlobalAccessAnnotation = "networking.gke.io/internal-load-balancer-allow-global-access" )
const ( // Annotation used to inform the certificate generation service to // generate a cluster-signed certificate and populate the secret. ServingCertSecretAnnotation = "service.alpha.openshift.io/serving-cert-secret-name" )
Variables ¶
var ( // InternalLBAnnotations maps platform to the annotation name and value // that tell the cloud provider that is associated with the platform // that the load balancer is internal. // // https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer InternalLBAnnotations = map[configv1.PlatformType]map[string]string{ configv1.AWSPlatformType: { // contains filtered or unexported fields }, configv1.AzurePlatformType: { // contains filtered or unexported fields }, configv1.BareMetalPlatformType: nil, configv1.GCPPlatformType: { // contains filtered or unexported fields }, configv1.LibvirtPlatformType: nil, configv1.OpenStackPlatformType: { // contains filtered or unexported fields }, configv1.NonePlatformType: nil, configv1.ExternalPlatformType: nil, configv1.VSpherePlatformType: nil, configv1.IBMCloudPlatformType: { // contains filtered or unexported fields }, configv1.PowerVSPlatformType: { // contains filtered or unexported fields }, configv1.NutanixPlatformType: nil, } )
Functions ¶
func DeleteActiveNLBMetrics ¶
func DeleteActiveNLBMetrics(ic *operatorv1.IngressController)
func DeleteIngressControllerConditionsMetric ¶
func DeleteIngressControllerConditionsMetric(ic *operatorv1.IngressController)
DeleteIngressControllerConditionsMetric deletes ingress_controller_conditions metrics which belong to the given ingresscontroller
func DetermineReplicas ¶
func DetermineReplicas(ingressConfig *configv1.Ingress, infraConfig *configv1.Infrastructure) int32
DetermineReplicas implements the replicas choice algorithm as described in the documentation for the IngressController replicas parameter. Used both in determining the number of replicas for the default IngressController and in determining the number of replicas in the Deployments corresponding to IngressController resources in which the number of replicas is unset
func GetMIMETypes ¶
func GetMIMETypes(mimeTypes []operatorv1.CompressionMIMEType) []string
GetMIMETypes returns a slice of strings from an array of operatorv1.CompressionMIMETypes. MIME strings that contain spaces must be quoted, as HAProxy requires a space-delimited MIME type list. Also quote/escape any characters that are special to HAProxy (\,', and "). See http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#2.2
func HTTP2IsEnabled ¶
func HTTP2IsEnabled(ic *operatorv1.IngressController, ingressConfig *configv1.Ingress) bool
HTTP2IsEnabled returns true if the ingress controller enables http/2, or if the ingress config enables http/2. It will return false for the case where the ingress config has been enabled but the ingress controller explicitly overrides that by having the annotation present (even if its value is "false").
func HTTP2IsEnabledByAnnotation ¶
HTTP2IsEnabledByAnnotation returns true if the map m has the key RouterDisableHTTP2Annotation present and true|false depending on the annotation's value that is parsed by strconv.ParseBool.
func HardStopAfterIsEnabled ¶
func HardStopAfterIsEnabled(ic *operatorv1.IngressController, ingressConfig *configv1.Ingress) (bool, string)
HardStopAfterIsEnabled returns true if either the ingress controller or the ingress config has the "hard-stop-after" annotation. The presence of the annotation on the ingress controller, irrespective of its value, always overrides any setting on the ingress config.
func HardStopAfterIsEnabledByAnnotation ¶
HardStopAfterIsEnabledByAnnotation returns true if the map m has the key RouterHardStopAfterEnvName and its value is a valid HAProxy time duration.
func IngressStatusesEqual ¶
func IngressStatusesEqual(a, b operatorv1.IngressControllerStatus) bool
IngressStatusesEqual compares two IngressControllerStatus values. Returns true if the provided values should be considered equal for the purpose of determining whether an update is necessary, false otherwise.
func IsProxyProtocolNeeded ¶
func IsProxyProtocolNeeded(ic *operatorv1.IngressController, platform *configv1.PlatformStatus) (bool, error)
IsProxyProtocolNeeded checks whether proxy protocol is needed based upon the given ic and platform.
func IsServiceInternal ¶
IsServiceInternal returns a Boolean indicating whether the provided service is annotated to request an internal load balancer.
func IsStatusDomainSet ¶
func IsStatusDomainSet(ingress *operatorv1.IngressController) bool
IsStatusDomainSet checks whether status.domain of ingress is set.
func JoinAWSEIPAllocations ¶
func JoinAWSEIPAllocations(eipAllocations []operatorv1.EIPAllocation, sep string) string
JoinAWSEIPAllocations joins an AWS EIPAllocations object into a string seperated by sep.
func JoinAWSSubnets ¶
func JoinAWSSubnets(subnets *operatorv1.AWSSubnets, sep string) string
JoinAWSSubnets joins an AWS Subnets object into a string seperated by sep.
func MergeConditions ¶
func MergeConditions(conditions []operatorv1.OperatorCondition, updates ...operatorv1.OperatorCondition) []operatorv1.OperatorCondition
MergeConditions adds or updates matching conditions, and updates the transition time if the status of a condition changed. Returns the updated condition array.
func New ¶
func New(mgr manager.Manager, config Config) (controller.Controller, error)
New creates the ingress controller from configuration. This is the controller that handles all the logic for implementing ingress based on IngressController resources.
The controller will be pre-configured to watch for IngressController resources in the manager namespace.
func PruneConditions ¶
func PruneConditions(conditions []operatorv1.OperatorCondition) []operatorv1.OperatorCondition
PruneConditions removes any conditions that are not currently supported. Returns the updated condition array.
func RegisterMetrics ¶
func RegisterMetrics() error
RegisterMetrics calls prometheus.Register on each metric in metricsList, and returns on errors.
func SetIngressControllerConditionsMetric ¶
func SetIngressControllerConditionsMetric(ic *operatorv1.IngressController)
SetIngressControllerConditionsMetric updates the ingress_controller_conditions metric values for the given IngressController.
func SetIngressControllerNLBMetric ¶
func SetIngressControllerNLBMetric(ci *operatorv1.IngressController)
Types ¶
type Config ¶
type Config struct { Namespace string IngressControllerImage string RouteExternalCertificateEnabled bool IngressControllerLBSubnetsAWSEnabled bool IngressControllerEIPAllocationsAWSEnabled bool IngressControllerDCMEnabled bool }
Config holds all the things necessary for the controller to run.