util

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: UPL-1.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IngressClassLoadBalancerIdAnnotation = "oci-native-ingress.oraclecloud.com/id"
	IngressClassIsDefault                = "ingressclass.kubernetes.io/is-default-class"

	PodReadinessConditionPrefix = "podreadiness.ingress.oraclecloud.com"

	IngressControllerFinalizer = "oci.oraclecloud.com/ingress-controller-protection"

	IngressListenerTlsCertificateAnnotation = "oci-native-ingress.oraclecloud.com/certificate-ocid"
	IngressBackendTlsEnabledAnnotation      = "oci-native-ingress.oraclecloud.com/backend-tls-enabled"

	// IngressProtocolAnntoation - HTTP only for now
	// HTTP, HTTP2 - accepted.
	IngressProtocolAnnotation = "oci-native-ingress.oraclecloud.com/protocol"

	IngressPolicyAnnotation          = "oci-native-ingress.oraclecloud.com/policy"
	IngressClassWafPolicyAnnotation  = "oci-native-ingress.oraclecloud.com/waf-policy-ocid"
	IngressClassFireWallIdAnnotation = "oci-native-ingress.oraclecloud.com/firewall-id"

	IngressHealthCheckProtocolAnnotation             = "oci-native-ingress.oraclecloud.com/healthcheck-protocol"
	IngressHealthCheckPortAnnotation                 = "oci-native-ingress.oraclecloud.com/healthcheck-port"
	IngressHealthCheckPathAnnotation                 = "oci-native-ingress.oraclecloud.com/healthcheck-path"
	IngressHealthCheckIntervalMillisecondsAnnotation = "oci-native-ingress.oraclecloud.com/healthcheck-interval-milliseconds"
	IngressHealthCheckTimeoutMillisecondsAnnotation  = "oci-native-ingress.oraclecloud.com/healthcheck-timeout-milliseconds"
	IngressHealthCheckRetriesAnnotation              = "oci-native-ingress.oraclecloud.com/healthcheck-retries"
	IngressHealthCheckReturnCodeAnnotation           = "oci-native-ingress.oraclecloud.com/healthcheck-return-code"
	IngressHealthCheckResponseBodyRegexAnnotation    = "oci-native-ingress.oraclecloud.com/healthcheck-response-regex"
	IngressHealthCheckForcePlainTextAnnotation       = "oci-native-ingress.oraclecloud.com/healthcheck-force-plaintext"

	ProtocolTCP                            = "TCP"
	ProtocolHTTP                           = "HTTP"
	ProtocolHTTP2                          = "HTTP2"
	ProtocolHTTP2DefaultCipherSuite        = "oci-default-http2-ssl-cipher-suite-v1"
	DefaultHealthCheckProtocol             = ProtocolTCP
	DefaultHealthCheckPort                 = 0
	DefaultHealthCheckTimeOutMilliSeconds  = 3000
	DefaultHealthCheckIntervalMilliSeconds = 10000
	DefaultHealthCheckRetries              = 3
	DefaultHealthCheckReturnCode           = 200
	DefaultBackendSetRoutingPolicy         = "LEAST_CONNECTIONS"

	CertificateCacheMaxAgeInMinutes = 10
	LBCacheMaxAgeInMinutes          = 1
	WAFCacheMaxAgeInMinutes         = 5
)

Variables

View Source
var ErrIngressClassNotReady = errors.New("ingress class not ready")

Functions

func GenerateBackendSetName

func GenerateBackendSetName(namespace string, serviceName string, port int32) string

func GenerateListenerName

func GenerateListenerName(servicePort int32) string

func GetBackendTlsEnabled added in v1.3.3

func GetBackendTlsEnabled(i *networkingv1.Ingress) bool

func GetCurrentTimeInUnixMillis added in v0.0.3

func GetCurrentTimeInUnixMillis() int64

func GetDefaultHeathChecker

func GetDefaultHeathChecker() *ociloadbalancer.HealthCheckerDetails

func GetEndpoints added in v1.3.0

func GetEndpoints(lister corelisters.EndpointsLister, namespace string, service string) ([]corev1.EndpointAddress, error)

func GetIngressClass

func GetIngressClass(ingress *networkingv1.Ingress, ingressClassLister networkinglisters.IngressClassLister) (*networkingv1.IngressClass, error)

func GetIngressClassCompartmentId

func GetIngressClassCompartmentId(p *v1beta1.IngressClassParameters, defaultCompartment string) string

func GetIngressClassFireWallId added in v1.1.0

func GetIngressClassFireWallId(ic *networkingv1.IngressClass) string

func GetIngressClassLoadBalancerId

func GetIngressClassLoadBalancerId(ic *networkingv1.IngressClass) string

func GetIngressClassSubnetId

func GetIngressClassSubnetId(p *v1beta1.IngressClassParameters, defaultSubnet string) string

func GetIngressClassWafPolicy added in v1.1.0

func GetIngressClassWafPolicy(ic *networkingv1.IngressClass) string

func GetIngressHealthCheckForcePlainText

func GetIngressHealthCheckForcePlainText(i *networkingv1.Ingress) bool

func GetIngressHealthCheckIntervalMilliseconds

func GetIngressHealthCheckIntervalMilliseconds(i *networkingv1.Ingress) (int, error)

func GetIngressHealthCheckPath

func GetIngressHealthCheckPath(i *networkingv1.Ingress) string

func GetIngressHealthCheckPort

func GetIngressHealthCheckPort(i *networkingv1.Ingress) (int, error)

func GetIngressHealthCheckProtocol

func GetIngressHealthCheckProtocol(i *networkingv1.Ingress) string

func GetIngressHealthCheckResponseBodyRegex

func GetIngressHealthCheckResponseBodyRegex(i *networkingv1.Ingress) string

func GetIngressHealthCheckRetries

func GetIngressHealthCheckRetries(i *networkingv1.Ingress) (int, error)

func GetIngressHealthCheckReturnCode

func GetIngressHealthCheckReturnCode(i *networkingv1.Ingress) (int, error)

func GetIngressHealthCheckTimeoutMilliseconds

func GetIngressHealthCheckTimeoutMilliseconds(i *networkingv1.Ingress) (int, error)

func GetIngressPolicy

func GetIngressPolicy(i *networkingv1.Ingress) string

func GetIngressProtocol

func GetIngressProtocol(i *networkingv1.Ingress) string

func GetIngressesForClass added in v1.3.0

func GetIngressesForClass(lister networkinglisters.IngressLister, ingressClass *networkingv1.IngressClass) ([]*networkingv1.Ingress, error)

func GetListenerTlsCertificateOcid

func GetListenerTlsCertificateOcid(i *networkingv1.Ingress) *string

func GetPodReadinessCondition

func GetPodReadinessCondition(ingressName string, host string, path networkingv1.HTTPIngressPath) corev1.PodConditionType

func GetTargetPortForService added in v1.3.0

func GetTargetPortForService(lister corelisters.ServiceLister, namespace string, name string, port int32, portName string) (int32, int32, *corev1.Service, error)

func GetTimeDifferenceInSeconds added in v0.0.3

func GetTimeDifferenceInSeconds(startTime, endTime int64) float64

GetTimeDifferenceInSeconds returns time difference in seconds of two timestamp values passed in Milliseconds

func HandleErr added in v1.3.0

func HandleErr(queue workqueue.RateLimitingInterface, err error, message string, key interface{})

HandleErr checks if an error happened and makes sure we will retry later.

func IsIngressDeleting

func IsIngressDeleting(i *networkingv1.Ingress) bool

func NewBackend added in v1.3.0

func NewBackend(ip string, port int32) ociloadbalancer.BackendDetails

func PatchIngressClassWithAnnotation added in v1.1.0

func PatchIngressClassWithAnnotation(client kubernetes.Interface, ic *networkingv1.IngressClass, annotationName string, annotationValue string) (error, bool)

func PathToRoutePolicyName

func PathToRoutePolicyName(ingressName string, host string, path networkingv1.HTTPIngressPath) string

func PathToServiceAndPort

func PathToServiceAndPort(ingressNamespace string, path networkingv1.HTTPIngressPath, serviceLister corelisters.ServiceLister) (string, int32, error)

func PathToServiceAndTargetPort added in v1.3.0

func PathToServiceAndTargetPort(lister corelisters.ServiceLister, ingressNamespace string, path networkingv1.HTTPIngressPath) (string, int32, int32, *corev1.Service, error)

func PrettyPrint

func PrettyPrint(i interface{}) string

func RetrievePods added in v1.3.0

func RetrievePods(endpointLister corelisters.EndpointsLister, podLister corelisters.PodLister, namespace string, svcName string) ([]*corev1.Pod, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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