common

package
v1.0.0-20220602-0850 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (

	// OpConfigDefaultHostname a DNS name to be used for hostname generation.
	OpConfigDefaultHostname = "defaultHostname"

	// OpConfigCMCADuration default duration for cert-manager issued CA
	OpConfigCMCADuration = "certManagerCACertDuration"

	// OpConfigCMCADuration default duration for cert-manager issued service certificate
	OpConfigCMCertDuration = "certManagerCertDuration"
)
View Source
const (
	StatusReferenceCertSecretName    = "svcCertSecretName"
	StatusReferencePullSecretName    = "saPullSecretName"
	StatusReferenceSAResourceVersion = "saResourceVersion"
)
View Source
const (
	// Status Condition Types
	StatusConditionTypeReconciled     StatusConditionType = "Reconciled"
	StatusConditionTypeResourcesReady StatusConditionType = "ResourcesReady"
	StatusConditionTypeReady          StatusConditionType = "Ready"

	// Status Endpoint Scopes
	StatusEndpointScopeExternal StatusEndpointScope = "External"
	StatusEndpointScopeInternal StatusEndpointScope = "Internal"
)

Variables

View Source
var Config = OpConfig{}

Config stores operator configuration

Functions

func GetComponentNameLabel

func GetComponentNameLabel(ba BaseComponent) string

GetComponentNameLabel returns the component's name label.

func GetDefaultMicroProfileLivenessProbe

func GetDefaultMicroProfileLivenessProbe(ba BaseComponent) *corev1.Probe

GetDefaultMicroProfileLivenessProbe returns the default values for MicroProfile Health-based liveness probe.

func GetDefaultMicroProfileReadinessProbe

func GetDefaultMicroProfileReadinessProbe(ba BaseComponent) *corev1.Probe

GetDefaultMicroProfileReadinessProbe returns the default values for MicroProfile Health-based readiness probe.

func GetDefaultMicroProfileStartupProbe

func GetDefaultMicroProfileStartupProbe(ba BaseComponent) *corev1.Probe

GetDefaultMicroProfileStartupProbe returns the default values for MicroProfile Health-based startup probe.

Types

type BaseComponent

type BaseComponent interface {
	GetApplicationImage() string
	GetPullPolicy() *corev1.PullPolicy
	GetPullSecret() *string
	GetServiceAccountName() *string
	GetReplicas() *int32
	GetProbes() BaseComponentProbes
	GetVolumes() []corev1.Volume
	GetVolumeMounts() []corev1.VolumeMount
	GetResourceConstraints() *corev1.ResourceRequirements
	GetExpose() *bool
	GetEnv() []corev1.EnvVar
	GetEnvFrom() []corev1.EnvFromSource
	GetCreateKnativeService() *bool
	GetAutoscaling() BaseComponentAutoscaling
	GetService() BaseComponentService
	GetNetworkPolicy() BaseComponentNetworkPolicy
	GetDeployment() BaseComponentDeployment
	GetStatefulSet() BaseComponentStatefulSet
	GetApplicationVersion() string
	GetApplicationName() string
	GetMonitoring() BaseComponentMonitoring
	GetLabels() map[string]string
	GetAnnotations() map[string]string
	GetStatus() BaseComponentStatus
	GetInitContainers() []corev1.Container
	GetSidecarContainers() []corev1.Container
	GetGroupName() string
	GetRoute() BaseComponentRoute
	GetAffinity() BaseComponentAffinity
	GetSecurityContext() *corev1.SecurityContext
	GetManageTLS() *bool
}

BaseComponent represents basic kubernetes application

type BaseComponentAffinity

type BaseComponentAffinity interface {
	GetNodeAffinity() *corev1.NodeAffinity
	GetPodAffinity() *corev1.PodAffinity
	GetPodAntiAffinity() *corev1.PodAntiAffinity
	GetArchitecture() []string
	GetNodeAffinityLabels() map[string]string
}

BaseComponentAffinity describes deployment and pod affinity

type BaseComponentAutoscaling

type BaseComponentAutoscaling interface {
	GetMinReplicas() *int32
	GetMaxReplicas() int32
	GetTargetCPUUtilizationPercentage() *int32
}

BaseComponentAutoscaling represents basic HPA configuration

type BaseComponentDeployment

type BaseComponentDeployment interface {
	GetDeploymentUpdateStrategy() *appsv1.DeploymentStrategy
	GetAnnotations() map[string]string
}

BaseComponentDeployment describes deployment

type BaseComponentMonitoring

type BaseComponentMonitoring interface {
	GetLabels() map[string]string
	GetEndpoints() []prometheusv1.Endpoint
}

BaseComponentMonitoring represents basic service monitoring configuration

type BaseComponentNetworkPolicy

type BaseComponentNetworkPolicy interface {
	GetNamespaceLabels() map[string]string
	GetFromLabels() map[string]string
}

BaseComponentNetworkPolicy represents a basic network policy configuration

type BaseComponentProbes

type BaseComponentProbes interface {
	GetLivenessProbe() *corev1.Probe
	GetReadinessProbe() *corev1.Probe
	GetStartupProbe() *corev1.Probe

	GetDefaultLivenessProbe(ba BaseComponent) *corev1.Probe
	GetDefaultReadinessProbe(ba BaseComponent) *corev1.Probe
	GetDefaultStartupProbe(ba BaseComponent) *corev1.Probe
}

BaseComponentProbes describes the probes for application container

type BaseComponentRoute

type BaseComponentRoute interface {
	GetTermination() *routev1.TLSTerminationType
	GetInsecureEdgeTerminationPolicy() *routev1.InsecureEdgeTerminationPolicyType
	GetAnnotations() map[string]string
	GetHost() string
	GetPath() string
	GetPathType() networkingv1.PathType
	GetCertificateSecretRef() *string
}

BaseComponentRoute represents route configuration

type BaseComponentService

type BaseComponentService interface {
	GetPort() int32
	GetTargetPort() *int32
	GetPortName() string
	GetType() *corev1.ServiceType
	GetNodePort() *int32
	GetPorts() []corev1.ServicePort
	GetAnnotations() map[string]string
	GetCertificateSecretRef() *string
	GetBindable() *bool
}

BaseComponentService represents basic service configuration

type BaseComponentStatefulSet

type BaseComponentStatefulSet interface {
	GetStatefulSetUpdateStrategy() *appsv1.StatefulSetUpdateStrategy
	GetStorage() BaseComponentStorage
	GetAnnotations() map[string]string
}

BaseComponentStatefulSet describes deployment

type BaseComponentStatus

type BaseComponentStatus interface {
	GetConditions() []StatusCondition
	GetCondition(StatusConditionType) StatusCondition
	SetCondition(StatusCondition)
	NewCondition(StatusConditionType) StatusCondition

	GetStatusEndpoint(string) StatusEndpoint
	SetStatusEndpoint(StatusEndpoint)
	NewStatusEndpoint(string) StatusEndpoint
	RemoveStatusEndpoint(string)

	GetImageReference() string
	SetImageReference(string)

	GetBinding() *corev1.LocalObjectReference
	SetBinding(*corev1.LocalObjectReference)

	GetReferences() StatusReferences
	SetReferences(StatusReferences)
	SetReference(string, string)
}

BaseComponentStatus returns base appplication status

type BaseComponentStorage

type BaseComponentStorage interface {
	GetSize() string
	GetClassName() string
	GetMountPath() string
	GetVolumeClaimTemplate() *corev1.PersistentVolumeClaim
}

BaseComponentStorage represents basic PVC configuration

type OpConfig

type OpConfig map[string]string

OpConfig stored operator configuration

func DefaultOpConfig

func DefaultOpConfig() OpConfig

DefaultOpConfig returns default configuration

func (OpConfig) LoadFromConfigMap

func (oc OpConfig) LoadFromConfigMap(cm *corev1.ConfigMap)

LoadFromConfigMap creates a config out of kubernetes config map

type StatusCondition

type StatusCondition interface {
	GetLastTransitionTime() *metav1.Time
	SetLastTransitionTime(*metav1.Time)

	GetReason() string
	SetReason(string)

	GetMessage() string
	SetMessage(string)

	GetStatus() corev1.ConditionStatus
	SetStatus(corev1.ConditionStatus)

	GetType() StatusConditionType
	SetType(StatusConditionType)

	SetConditionFields(string, string, corev1.ConditionStatus) StatusCondition
}

StatusCondition ...

type StatusConditionType

type StatusConditionType string

StatusConditionType ...

type StatusEndpoint

type StatusEndpoint interface {
	GetEndpointName() string
	SetEndpointName(string)

	GetEndpointScope() StatusEndpointScope
	SetEndpointScope(StatusEndpointScope)

	GetEndpointType() string
	SetEndpointType(string)

	GetEndpointUri() string
	SetEndpointUri(string)

	SetStatusEndpointFields(StatusEndpointScope, string, string) StatusEndpoint
}

StatusEndpoint ...

type StatusEndpointScope

type StatusEndpointScope string

StatusEndpointScope ...

type StatusReferences

type StatusReferences map[string]string

Jump to

Keyboard shortcuts

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