controllers

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCPLivenessPort = 8161

	OrdinalPrefix        = "broker-"
	OrdinalPrefixSep     = "."
	BrokerPropertiesName = "broker.properties"
	JaasConfigKey        = "login.config"
	LoggingConfigKey     = "logging.properties"
	PodNameLabelKey      = "statefulset.kubernetes.io/pod-name"
	ServiceTypePostfix   = "svc"
	RouteTypePostfix     = "rte"
	IngressTypePostfix   = "ing"
)
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 EqualCRStatus added in v1.0.16

func EqualCRStatus(s1, s2 *brokerv1beta1.ActiveMQArtemisStatus) bool

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, log logr.Logger) (string, int, map[string]string)

func MakeEnvVarArrayForCR

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

func MakeNamers

func MakeNamers(customResource *brokerv1beta1.ActiveMQArtemis) *common.Namers

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

Types

type ActiveMQArtemisAddressReconciler

type ActiveMQArtemisAddressReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

ActiveMQArtemisAddressReconciler reconciles a ActiveMQArtemisAddress object

func NewActiveMQArtemisAddressReconciler added in v1.0.16

func NewActiveMQArtemisAddressReconciler(client client.Client, scheme *runtime.Scheme, logger logr.Logger) *ActiveMQArtemisAddressReconciler

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 NewActiveMQArtemisReconciler added in v1.0.16

func NewActiveMQArtemisReconciler(client rtclient.Client, scheme *runtime.Scheme, logger logr.Logger) *ActiveMQArtemisReconciler

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) UpdateCRStatus added in v1.0.16

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

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 NewActiveMQArtemisReconcilerImpl added in v1.0.16

func NewActiveMQArtemisReconcilerImpl(customResource *brokerv1beta1.ActiveMQArtemis, logger logr.Logger) *ActiveMQArtemisReconcilerImpl

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) MakeVolumeMounts added in v1.0.16

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

func (*ActiveMQArtemisReconcilerImpl) MakeVolumes added in v1.0.16

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

func (*ActiveMQArtemisReconcilerImpl) NewPersistentVolumeClaimArrayForCR added in v1.0.16

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

func (*ActiveMQArtemisReconcilerImpl) NewPodTemplateSpecForCR

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

func (*ActiveMQArtemisReconcilerImpl) NewStatefulSetForCR

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

func (*ActiveMQArtemisReconcilerImpl) Process

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

func (*ActiveMQArtemisReconcilerImpl) ProcessAcceptorsAndConnectors

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

func (*ActiveMQArtemisReconcilerImpl) ProcessConsole

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

func (*ActiveMQArtemisReconcilerImpl) ProcessCredentials

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

func (*ActiveMQArtemisReconcilerImpl) ProcessDeploymentPlan

func (reconciler *ActiveMQArtemisReconcilerImpl) ProcessDeploymentPlan(customResource *brokerv1beta1.ActiveMQArtemis, namer common.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 common.Namers, client rtclient.Client) (*appsv1.StatefulSet, error)

func (*ActiveMQArtemisReconcilerImpl) ServiceDefinitionForCR added in v1.0.16

func (reconciler *ActiveMQArtemisReconcilerImpl) ServiceDefinitionForCR(serviceName types.NamespacedName, client rtclient.Client, nameSuffix string, portNumber int32, selectorLabels map[string]string, labels map[string]string) *corev1.Service

type ActiveMQArtemisScaledownReconciler

type ActiveMQArtemisScaledownReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Config *rest.Config
	// contains filtered or unexported fields
}

ActiveMQArtemisScaledownReconciler reconciles a ActiveMQArtemisScaledown object

func NewActiveMQArtemisScaledownReconciler added in v1.0.16

func NewActiveMQArtemisScaledownReconciler(client client.Client, scheme *runtime.Scheme, config *rest.Config, logger logr.Logger) *ActiveMQArtemisScaledownReconciler

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
	// contains filtered or unexported fields
}

ActiveMQArtemisSecurityReconciler reconciles a ActiveMQArtemisSecurity object

func NewActiveMQArtemisSecurityReconciler added in v1.0.16

func NewActiveMQArtemisSecurityReconciler(client client.Client, scheme *runtime.Scheme, brokerReconciler *ActiveMQArtemisReconciler, logger logr.Logger) *ActiveMQArtemisSecurityReconciler

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,
	logger logr.Logger) *AddressObserver

func (*AddressObserver) Run

type AddressRetry

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

func NewAddressRetry added in v1.0.16

func NewAddressRetry(addr string, a []*mgmt.Artemis, logger logr.Logger) *AddressRetry

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