controllers

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageNamePrefix = "RELATED_IMAGE_ActiveMQ_Artemis_Broker_"
	BrokerImageKey  = "Kubernetes"
	InitImageKey    = "Init"

	TCPLivenessPort = 8161

	OrdinalPrefix         = "broker-"
	OrdinalPrefixSep      = "."
	BrokerPropertiesName  = "broker.properties"
	JaasConfigKey         = "login.config"
	LoggingConfigKey      = "logging.properties"
	DefaultDeploymentSize = int32(1)
)
View Source
const AnnotationDrainerPodTemplate = "statefulsets.kubernetes.io/drainer-pod-template"
View Source
const AnnotationStatefulSet = "statefulsets.kubernetes.io/drainer-pod-owner"

Variables

View Source
var StopCh chan struct{}

Functions

func AssertConfigMapContainsKey added in v1.0.8

func AssertConfigMapContainsKey(configMap corev1.ConfigMap, key string, contextMessage string) *metav1.Condition

func AssertInstanceCounts added in v1.0.8

func AssertInstanceCounts(instanceCounts map[string]int) *metav1.Condition

func AssertSecretContainsKey added in v1.0.8

func AssertSecretContainsKey(secret corev1.Secret, key string, contextMessage string) *metav1.Condition

func AssertSecretContainsOneOf added in v1.0.11

func AssertSecretContainsOneOf(secret corev1.Secret, keys []string, contextMessage string) *metav1.Condition

func AssertSyntaxOkOnLoginConfigData added in v1.0.9

func AssertSyntaxOkOnLoginConfigData(SecretContentForLoginConfigKey []byte, name string, contextMessage string) *metav1.Condition

func GetBrokerConfigHandler

func GetBrokerConfigHandler(brokerNamespacedName types.NamespacedName) (handler common.ActiveMQArtemisConfigHandler)

func GetDefaultLabels

func GetDefaultLabels(cr *brokerv1beta1.ActiveMQArtemis) map[string]string

func GetQueueConfig

func GetQueueConfig(addressRes *brokerv1beta1.ActiveMQArtemisAddress) (string, bool, error)

convert QueueConfiguration to json string

func GetStatefulSetNameForPod

func GetStatefulSetNameForPod(client client.Client, pod *types.NamespacedName) (string, int, map[string]string)

func MakeEnvVarArrayForCR

func MakeEnvVarArrayForCR(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers) []corev1.EnvVar

func MakeVolumeMounts

func MakeVolumeMounts(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers) []corev1.VolumeMount

func MakeVolumes

func MakeVolumes(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers) []corev1.Volume

func MatchBytesAgainsLoginConfigRegexp added in v1.0.9

func MatchBytesAgainsLoginConfigRegexp(buffer []byte) bool

func NewInSyncWithError added in v1.0.8

func NewInSyncWithError(pod string) *inSyncApplyError

func NewJolokiaClientsNotFoundError added in v1.0.7

func NewJolokiaClientsNotFoundError(err error) jolokiaClientNotFoundError

func NewPersistentVolumeClaimArrayForCR

func NewPersistentVolumeClaimArrayForCR(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, arrayLength int) *[]corev1.PersistentVolumeClaim

func NewStatusOutOfSyncError added in v1.0.8

func NewStatusOutOfSyncError(err error) statusOutOfSyncError

func NewStatusOutOfSyncMissingKeyError added in v1.0.8

func NewStatusOutOfSyncMissingKeyError(err error) statusOutOfSyncMissingKeyError

func NewUnknownJolokiaError added in v1.0.7

func NewUnknownJolokiaError(err error) unknownJolokiaError

func ProcessBrokerStatus added in v1.0.14

func ProcessBrokerStatus(cr *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme) (retry bool)

func ProcessStatus added in v1.0.14

func ProcessStatus(cr *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, namespacedName types.NamespacedName, namer Namers, reconcileError error)

func ReleaseController

func ReleaseController(brokerCRName string)

func UpdateCRStatus added in v1.0.6

func UpdateCRStatus(desired *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, namespacedName types.NamespacedName) error

Types

type ActiveMQArtemisAddressReconciler

type ActiveMQArtemisAddressReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ActiveMQArtemisAddressReconciler reconciles a ActiveMQArtemisAddress object

func (*ActiveMQArtemisAddressReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ActiveMQArtemisAddress object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*ActiveMQArtemisAddressReconciler) SetupWithManager

func (r *ActiveMQArtemisAddressReconciler) SetupWithManager(mgr ctrl.Manager, ctx context.Context) error

SetupWithManager sets up the controller with the Manager.

type ActiveMQArtemisIReconciler

type ActiveMQArtemisIReconciler interface {
	Process(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme, firstTime bool) uint32
	ProcessStatefulSet(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, log logr.Logger, firstTime bool) (*appsv1.StatefulSet, bool)
	ProcessCredentials(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint32
	ProcessDeploymentPlan(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet, firstTime bool) uint32
	ProcessAcceptorsAndConnectors(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint32
	ProcessConsole(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet)
	ProcessResources(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint8
}

type ActiveMQArtemisQueueConfiguration

type ActiveMQArtemisQueueConfiguration struct {
	Name                        *string `json:"name,omitempty"`
	Address                     *string `json:"address,omitempty"`
	RoutingType                 *string `json:"routing-type,omitempty"`
	FilterString                *string `json:"filter-string,omitempty"`
	Durable                     *bool   `json:"durable,omitempty"`
	User                        *string `json:"user,omitempty"`
	MaxConsumers                *int32  `json:"max-consumers,omitempty"`
	Exclusive                   *bool   `json:"exclusive,omitempty"`
	GroupRebalance              *bool   `json:"group-rebalance,omitempty"`
	GroupRebalancePauseDispatch *bool   `json:"group-rebalance-pause-dispatch,omitempty"`
	GroupBuckets                *int32  `json:"group-buckets,omitempty"`
	GroupFirstKey               *string `json:"group-first-key,omitempty"`
	LastValue                   *bool   `json:"last-value,omitempty"`
	LastValueKey                *string `json:"last-value-key,omitempty"`
	NonDestructive              *bool   `json:"non-destructive,omitempty"`
	PurgeOnNoConsumers          *bool   `json:"purge-on-no-consumers,omitempty"`
	Enabled                     *bool   `json:"enabled,omitempty"`
	ConsumersBeforeDispatch     *int32  `json:"consumers-before-dispatch,omitempty"`
	DelayBeforeDispatch         *int64  `json:"delay-before-dispatch,omitempty"`
	ConsumerPriority            *int32  `json:"consumer-priority,omitempty"`
	AutoDelete                  *bool   `json:"auto-delete,omitempty"`
	AutoDeleteDelay             *int64  `json:"auto-delete-delay,omitempty"`
	AutoDeleteMessageCount      *int64  `json:"auto-delete-message-count,omitempty"`
	RingSize                    *int64  `json:"ring-size,omitempty"`
	ConfigurationManaged        *bool   `json:"configuration-managed,omitempty"`
	Temporary                   *bool   `json:"temporary,omitempty"`
	AutoCreateAddress           *bool   `json:"auto-create-address,omitempty"`
	Transient                   *bool   `json:"transient,omitempty"`
	Internal                    *bool   `json:"internal,omitempty"`
	Id                          *int64  `json:"id,omitempty"`
}

type ActiveMQArtemisReconciler

type ActiveMQArtemisReconciler struct {
	rtclient.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

ActiveMQArtemisReconciler reconciles a ActiveMQArtemis object

func NewReconcileActiveMQArtemis

func NewReconcileActiveMQArtemis(c rtclient.Client, s *runtime.Scheme) ActiveMQArtemisReconciler

only test uses this

func (*ActiveMQArtemisReconciler) AddBrokerConfigHandler

func (r *ActiveMQArtemisReconciler) AddBrokerConfigHandler(namespacedName types.NamespacedName, handler common.ActiveMQArtemisConfigHandler, toReconcile bool) error

func (*ActiveMQArtemisReconciler) Reconcile

func (r *ActiveMQArtemisReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ActiveMQArtemis object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*ActiveMQArtemisReconciler) RemoveBrokerConfigHandler

func (r *ActiveMQArtemisReconciler) RemoveBrokerConfigHandler(namespacedName types.NamespacedName)

func (*ActiveMQArtemisReconciler) SetupWithManager

func (r *ActiveMQArtemisReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*ActiveMQArtemisReconciler) UpdatePodForSecurity

func (r *ActiveMQArtemisReconciler) UpdatePodForSecurity(securityHandlerNamespacedName types.NamespacedName, handler common.ActiveMQArtemisConfigHandler) error

type ActiveMQArtemisReconcilerImpl

type ActiveMQArtemisReconcilerImpl struct {
	// contains filtered or unexported fields
}

func (*ActiveMQArtemisReconcilerImpl) CurrentDeployedResources

func (reconciler *ActiveMQArtemisReconcilerImpl) CurrentDeployedResources(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client)

func (*ActiveMQArtemisReconcilerImpl) ExposureDefinitionForCR

func (reconciler *ActiveMQArtemisReconcilerImpl) ExposureDefinitionForCR(customResource *brokerv1beta1.ActiveMQArtemis, namespacedName types.NamespacedName, labels map[string]string, passthroughTLS bool, ingressHost string, ordinalString string, itemName string) rtclient.Object

func (*ActiveMQArtemisReconcilerImpl) NewPodTemplateSpecForCR

func (reconciler *ActiveMQArtemisReconcilerImpl) NewPodTemplateSpecForCR(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, current *corev1.PodTemplateSpec, client rtclient.Client) (*corev1.PodTemplateSpec, error)

func (*ActiveMQArtemisReconcilerImpl) NewStatefulSetForCR

func (reconciler *ActiveMQArtemisReconcilerImpl) NewStatefulSetForCR(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, currentStateFullSet *appsv1.StatefulSet, client rtclient.Client) (*appsv1.StatefulSet, error)

func (*ActiveMQArtemisReconcilerImpl) Process

func (reconciler *ActiveMQArtemisReconcilerImpl) Process(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, client rtclient.Client, scheme *runtime.Scheme) error

func (*ActiveMQArtemisReconcilerImpl) ProcessAcceptorsAndConnectors

func (reconciler *ActiveMQArtemisReconcilerImpl) ProcessAcceptorsAndConnectors(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet)

func (*ActiveMQArtemisReconcilerImpl) ProcessConsole

func (reconciler *ActiveMQArtemisReconcilerImpl) ProcessConsole(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet)

func (*ActiveMQArtemisReconcilerImpl) ProcessCredentials

func (reconciler *ActiveMQArtemisReconcilerImpl) ProcessCredentials(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet)

func (*ActiveMQArtemisReconcilerImpl) ProcessDeploymentPlan

func (reconciler *ActiveMQArtemisReconcilerImpl) ProcessDeploymentPlan(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, client rtclient.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet)

func (*ActiveMQArtemisReconcilerImpl) ProcessResources

func (reconciler *ActiveMQArtemisReconcilerImpl) ProcessResources(customResource *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme) error

func (*ActiveMQArtemisReconcilerImpl) ProcessStatefulSet

func (reconciler *ActiveMQArtemisReconcilerImpl) ProcessStatefulSet(customResource *brokerv1beta1.ActiveMQArtemis, namer Namers, client rtclient.Client, log logr.Logger) (*appsv1.StatefulSet, error)

type ActiveMQArtemisScaledownReconciler

type ActiveMQArtemisScaledownReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Config *rest.Config
}

ActiveMQArtemisScaledownReconciler reconciles a ActiveMQArtemisScaledown object

func (*ActiveMQArtemisScaledownReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ActiveMQArtemisScaledown object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*ActiveMQArtemisScaledownReconciler) SetupWithManager

func (r *ActiveMQArtemisScaledownReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ActiveMQArtemisSecurityConfigHandler

type ActiveMQArtemisSecurityConfigHandler struct {
	SecurityCR     *brokerv1beta1.ActiveMQArtemisSecurity
	NamespacedName types.NamespacedName
	// contains filtered or unexported fields
}

func (*ActiveMQArtemisSecurityConfigHandler) Config

func (r *ActiveMQArtemisSecurityConfigHandler) Config(initContainers []corev1.Container, outputDirRoot string, yacfgProfileVersion string, yacfgProfileName string) (value []string)

func (*ActiveMQArtemisSecurityConfigHandler) GetCRName added in v1.0.14

func (*ActiveMQArtemisSecurityConfigHandler) GetDefaultLabels

func (r *ActiveMQArtemisSecurityConfigHandler) GetDefaultLabels() map[string]string

func (*ActiveMQArtemisSecurityConfigHandler) IsApplicableFor

func (r *ActiveMQArtemisSecurityConfigHandler) IsApplicableFor(brokerNamespacedName types.NamespacedName) bool

type ActiveMQArtemisSecurityReconciler

type ActiveMQArtemisSecurityReconciler struct {
	client.Client
	Scheme           *runtime.Scheme
	BrokerReconciler *ActiveMQArtemisReconciler
}

ActiveMQArtemisSecurityReconciler reconciles a ActiveMQArtemisSecurity object

func (*ActiveMQArtemisSecurityReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ActiveMQArtemisSecurity object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*ActiveMQArtemisSecurityReconciler) SetupWithManager

func (r *ActiveMQArtemisSecurityReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type AddressDeployment

type AddressDeployment struct {
	AddressResource brokerv1beta1.ActiveMQArtemisAddress
	//a 0-len array means all statefulsets
	SsTargetNameBuilders []SSInfoData
}

type AddressObserver

type AddressObserver struct {
	// contains filtered or unexported fields
}

func NewAddressObserver

func NewAddressObserver(
	kubeclientset kubernetes.Interface,
	client client.Client,
	scheme *runtime.Scheme) *AddressObserver

func (*AddressObserver) Run

type AddressRetry

type AddressRetry struct {
	// contains filtered or unexported fields
}

type ArtemisError added in v1.0.7

type ArtemisError interface {
	Error() string
	Requeue() bool
}

func AssertBrokerPropertiesStatus added in v1.0.7

func AssertBrokerPropertiesStatus(cr *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme) ArtemisError

func AssertBrokersAvailable added in v1.0.8

func AssertBrokersAvailable(cr *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme) ArtemisError

func AssertJaasPropertiesStatus added in v1.0.8

func AssertJaasPropertiesStatus(cr *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, scheme *runtime.Scheme) ArtemisError

type Namers

type Namers struct {
	SsGlobalName                  string
	SsNameBuilder                 namer.NamerData
	SvcHeadlessNameBuilder        namer.NamerData
	SvcPingNameBuilder            namer.NamerData
	PodsNameBuilder               namer.NamerData
	SecretsCredentialsNameBuilder namer.NamerData
	SecretsConsoleNameBuilder     namer.NamerData
	SecretsNettyNameBuilder       namer.NamerData
	LabelBuilder                  selectors.LabelerData
	GLOBAL_DATA_PATH              string
}

func MakeNamers

func MakeNamers(customResource *brokerv1beta1.ActiveMQArtemis) *Namers

type SSInfoData

type SSInfoData struct {
	NameBuilder namer.NamerData
	Labels      map[string]string
}

type ValueInfo

type ValueInfo struct {
	Value    string
	AutoGen  bool
	Internal bool //if true put this value to the internal secret
}

Jump to

Keyboard shortcuts

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