common

package
v0.8.2-20230423-1545 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// OpConfigPropDefaultIssuer issuer to use for cert-manager certificate
	OpConfigPropDefaultIssuer = "defaultIssuer"

	// OpConfigPropUseClusterIssuer whether to use ClusterIssuer for cert-manager certificate
	OpConfigPropUseClusterIssuer = "useClusterIssuer"

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

Variables

View Source
var Config = OpConfig{}

Config stores operator configuration

Functions

This section is empty.

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
	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
}

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 BaseComponentProbes

type BaseComponentProbes interface {
	GetLivenessProbe() *corev1.Probe
	GetReadinessProbe() *corev1.Probe
	GetStartupProbe() *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() StatusCondition
	GetImageReference() string
	SetImageReference(string)
	GetBinding() *corev1.LocalObjectReference
	SetBinding(*corev1.LocalObjectReference)
}

BaseComponentStatus returns base appplication status

type BaseComponentStorage

type BaseComponentStorage interface {
	GetSize() 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)
}

StatusCondition ...

type StatusConditionType

type StatusConditionType string

StatusConditionType ...

const (
	// StatusConditionTypeReconciled ...
	StatusConditionTypeReconciled StatusConditionType = "Reconciled"
)

Jump to

Keyboard shortcuts

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