infrastructure

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

View Source
const (

	// LatestTag the default name for latest image tag
	LatestTag = "latest"

	//RuntimeTypeKey Env key to switch between the runtime
	RuntimeTypeKey = "RUNTIME_TYPE"
)
View Source
const (

	// InfinispanSecretUsernameKey is the secret username key set in the linked secret
	InfinispanSecretUsernameKey = "username"
	// InfinispanSecretPasswordKey is the secret password key set in the linked secret
	InfinispanSecretPasswordKey = "password"

	// InfinispanIdentityFileName is the name of YAML file containing list of Infinispan credentials
	InfinispanIdentityFileName = "identities.yaml"

	// InfinispanKind CRD Kind for Infinispan server (as defined by Infinispan Operator)
	InfinispanKind = "Infinispan"

	// InfinispanInstanceName is the default name for Infinispan managed by KogitoInfra
	InfinispanInstanceName = "kogito-infinispan"
)
View Source
const (

	// KafkaKind refers to Kafka Kind as defined by Strimzi
	KafkaKind = "Kafka"

	// KafkaInstanceName is the default name for the Kafka cluster managed by KogitoInfra
	KafkaInstanceName = "kogito-kafka"
)
View Source
const (
	// MongoDBOperatorName is the MongoDB Operator default name
	MongoDBOperatorName = "mongodb-kubernetes-operator"

	// DefaultMongoDBAuthDatabase is the default authentication database in MongoDB
	DefaultMongoDBAuthDatabase = "admin"
	// DefaultMongoDBPasswordSecretRef is the default key for the secret reference in MongoDB
	DefaultMongoDBPasswordSecretRef = "password"

	// MongoDBKind refers to MongoDB Kind
	MongoDBKind = "MongoDB"

	// MongoDBAppSecretAuthDatabaseKey is the secret authentication database key set in the linked secret for an application
	MongoDBAppSecretAuthDatabaseKey = "auth-database"
	// MongoDBAppSecretDatabaseKey is the secret database key set in the linked secret for an application
	MongoDBAppSecretDatabaseKey = "database"
	// MongoDBAppSecretUsernameKey is the secret username key set in the linked secret for an application
	MongoDBAppSecretUsernameKey = "username"
	// MongoDBAppSecretPasswordKey is the secret password key set in the linked secret for an application
	MongoDBAppSecretPasswordKey = "password"
)
View Source
const (
	// KeycloakKind refers to Keycloak Kind
	KeycloakKind = "Keycloak"
)
View Source
const (
	// KnativeEventingBrokerKind is the Kind description for Knative Eventing Brokers
	KnativeEventingBrokerKind = "Broker"
)
View Source
const (
	// RuntimeServiceAccountName ...
	RuntimeServiceAccountName = "kogito-service-viewer"
)

Variables

View Source
var (
	// InfinispanAPIVersion CRD API group version for Infinispan server (as defined by Infinispan Operator)
	InfinispanAPIVersion = ispn.SchemeGroupVersion.String()
)
View Source
var (
	// KafkaAPIVersion refers to kafka APIVersion
	KafkaAPIVersion = v1beta2.SchemeGroupVersion.String()
)
View Source
var (
	// KeycloakAPIVersion refers to kafka APIVersion
	KeycloakAPIVersion = v1alpha1.SchemeGroupVersion.String()
)
View Source
var (
	// KnativeEventingAPIVersion API Group version as defined by Knative Eventing operator
	KnativeEventingAPIVersion = eventingv1.SchemeGroupVersion.String()
)
View Source
var (
	// MongoDBAPIVersion refers to MongoDB APIVersion
	MongoDBAPIVersion = mongodb.SchemeGroupVersion.String()
)

Functions

func GetDefaultImageNamespace

func GetDefaultImageNamespace() string

GetDefaultImageNamespace ...

func GetDefaultImageRegistry

func GetDefaultImageRegistry() string

GetDefaultImageRegistry ...

func GetKogitoImageVersion

func GetKogitoImageVersion() string

GetKogitoImageVersion gets the Kogito Runtime latest micro version based on the Operator current version E.g. Operator version is 0.9.0, the latest image version is 0.9.x-latest

func IsKafkaResource

func IsKafkaResource(apiVersion, kind string) bool

IsKafkaResource checks if provided KogitoInfra instance is for kafka resource

func IsKnativeEventingResource

func IsKnativeEventingResource(apiVersion, kind string) bool

IsKnativeEventingResource checks if provided KogitoInfra instance is for Knative eventing resource

Types

type ConfigMapHandler

type ConfigMapHandler interface {
	TakeConfigMapOwnership(key types.NamespacedName, owner resource.KubernetesResource) (updated bool, err error)
}

ConfigMapHandler ...

func NewConfigMapHandler

func NewConfigMapHandler(context *operator.Context, recorder record.EventRecorder) ConfigMapHandler

NewConfigMapHandler ...

type DeploymentHandler

type DeploymentHandler interface {
	FetchDeployment(key types.NamespacedName) (*appsv1.Deployment, error)
	FetchDeploymentList(namespace string) (*appsv1.DeploymentList, error)
	MustFetchDeployment(key types.NamespacedName) (*appsv1.Deployment, error)
	IsDeploymentAvailable(key types.NamespacedName) (bool, error)
	FetchReadyReplicas(key types.NamespacedName) (int32, error)
}

DeploymentHandler ...

func NewDeploymentHandler

func NewDeploymentHandler(context *operator.Context) DeploymentHandler

NewDeploymentHandler ...

type ImageHandler

type ImageHandler interface {
	ResolveImage() (string, error)
	ResolveImageNameTag() string
	ResolveImageStreamTriggerAnnotation(containerName string) (key, value string)
	CreateImageStreamIfNotExists() (*imgv1.ImageStream, error)
}

ImageHandler describes the handler structure to handle Kogito Services Images

func NewImageHandler

func NewImageHandler(context *operator.Context, image *api.Image, defaultImageName, imageStreamName, namespace string, addFromReference, insecureImageRegistry bool) ImageHandler

NewImageHandler ...

type ImageStreamHandler

type ImageStreamHandler interface {
	FetchImageStream(key types.NamespacedName) (*imgv1.ImageStream, error)
	MustFetchImageStream(key types.NamespacedName) (*imgv1.ImageStream, error)
	CreateImageStream(name, namespace, imageName, tag string, addFromReference, insecureImageRegistry bool) *imgv1.ImageStream
}

ImageStreamHandler ...

func NewImageStreamHandler

func NewImageStreamHandler(context *operator.Context) ImageStreamHandler

NewImageStreamHandler ...

type InfinispanCredential

type InfinispanCredential struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

InfinispanCredential holds the information to authenticate into an infinispan server

type InfinispanHandler

type InfinispanHandler interface {
	FetchInfinispanInstance(key types.NamespacedName) (*ispn.Infinispan, error)
	IsInfinispanAvailable() bool
	FetchInfinispanInstanceURI(key types.NamespacedName) (string, error)
	GetInfinispanCredential(infinispanInstance *ispn.Infinispan) (*InfinispanCredential, error)
}

InfinispanHandler ...

func NewInfinispanHandler

func NewInfinispanHandler(context *operator.Context) InfinispanHandler

NewInfinispanHandler ...

type InfinispanIdentity

type InfinispanIdentity struct {
	Credentials []InfinispanCredential `yaml:"credentials"`
}

InfinispanIdentity is the struct for the secret holding the credential for the Infinispan server

type KafkaHandler

type KafkaHandler interface {
	IsStrimziAvailable() bool
	FetchKafkaInstance(key types.NamespacedName) (*v1beta2.Kafka, error)
	FetchKafkaTopic(key types.NamespacedName) (*v1beta2.KafkaTopic, error)
	CreateKafkaTopic(topicName, kafkaName, kafkaNamespace string) (*v1beta2.KafkaTopic, error)
	ResolveKafkaServerURI(kafka *v1beta2.Kafka) (string, error)
}

KafkaHandler ...

func NewKafkaHandler

func NewKafkaHandler(context *operator.Context) KafkaHandler

NewKafkaHandler ...

type KeycloakHandler

type KeycloakHandler interface {
	IsKeycloakAvailable() bool
}

KeycloakHandler ...

func NewKeycloakHandler

func NewKeycloakHandler(context *operator.Context) KeycloakHandler

NewKeycloakHandler ...

type KnativeHandler

type KnativeHandler interface {
	IsKnativeEventingAvailable() bool
	FetchBroker(key types.NamespacedName) (*eventingv1.Broker, error)
}

KnativeHandler ...

func NewKnativeHandler

func NewKnativeHandler(context *operator.Context) KnativeHandler

NewKnativeHandler ...

type MongoDBHandler

type MongoDBHandler interface {
	IsMongoDBAvailable() bool
	IsMongoDBOperatorAvailable(namespace string) (bool, error)
}

MongoDBHandler ...

func NewMongoDBHandler

func NewMongoDBHandler(context *operator.Context) MongoDBHandler

NewMongoDBHandler ...

type RBACHandler

type RBACHandler interface {
	SetupRBAC(namespace string) (err error)
}

RBACHandler ...

func NewRBACHandler

func NewRBACHandler(context *operator.Context) RBACHandler

NewRBACHandler ...

type RouteHandler

type RouteHandler interface {
	FetchRoute(key types.NamespacedName) (*routev1.Route, error)
	GetHostFromRoute(routeKey types.NamespacedName) (string, error)
	CreateRoute(service *corev1.Service) (route *routev1.Route)
}

RouteHandler ...

func NewRouteHandler

func NewRouteHandler(context *operator.Context) RouteHandler

NewRouteHandler ...

type ServiceHandler

type ServiceHandler interface {
	CreateService(instance api.KogitoService, deployment *appsv1.Deployment) *corev1.Service
}

ServiceHandler ...

func NewServiceHandler

func NewServiceHandler(context *operator.Context) ServiceHandler

NewServiceHandler ...

Directories

Path Synopsis
Package kafka contains kafka API versions.
Package kafka contains kafka API versions.
v1beta2
Package v1beta2 contains API Schema definitions for the kafka v1beta2 API group +k8s:deepcopy-gen=package,register +groupName=kafka.strimzi.io +kubebuilder:skip Package v1beta2 contains API Schema definitions for the kafka v1beta2 API group +k8s:deepcopy-gen=package,register +groupName=kafka.strimzi.io
Package v1beta2 contains API Schema definitions for the kafka v1beta2 API group +k8s:deepcopy-gen=package,register +groupName=kafka.strimzi.io +kubebuilder:skip Package v1beta2 contains API Schema definitions for the kafka v1beta2 API group +k8s:deepcopy-gen=package,register +groupName=kafka.strimzi.io

Jump to

Keyboard shortcuts

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