cluster

package
v0.24.4-alpha4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

*

  • Handles specific operations for Kafka Connection resource

Index

Constants

This section is empty.

Variables

View Source
var AKCGroup = "rhoas.redhat.com"
View Source
var AKCRMeta = metav1.TypeMeta{
	Kind:       "KafkaConnection",
	APIVersion: AKCGroup + "/" + AKCVersion,
}
View Source
var AKCResource = schema.GroupVersionResource{
	Group:    AKCGroup,
	Version:  AKCVersion,
	Resource: "kafkaconnections",
}
View Source
var AKCVersion = "v1alpha1"

Functions

func CheckIfConnectionsExist

func CheckIfConnectionsExist(ctx context.Context, c *KubernetesCluster, namespace string, k *kafkamgmtv1.KafkaRequest) error

func ExecuteServiceBinding

func ExecuteServiceBinding(logger logging.Logger, localizer localize.Localizer, options *ServiceBindingOptions) error

func IsKCInstalledOnCluster

func IsKCInstalledOnCluster(ctx context.Context, c *KubernetesCluster) (bool, error)

checks the cluster to see if a KafkaConnection CRD is installed

Types

type BootstrapServerSpec

type BootstrapServerSpec struct {
	// Host full host to  Kafka Service including port
	Host string `json:"host,omitempty"`
}

BootstrapServerSpec contains server host information that can be used to connecto the Kafka

type Cluster

type Cluster interface {
	Connect(ctx context.Context, opts *ConnectArguments) error
	IsRhoasOperatorAvailableOnCluster(ctx context.Context) (bool, error)
	CurrentNamespace() (string, error)
}

Cluster defines methods used to interact with a cluster

func NewKubernetesClusterConnection

func NewKubernetesClusterConnection(connection connection.Connection,
	config config.IConfig,
	logger logging.Logger,
	kubeconfig string,
	io *iostreams.IOStreams, localizer localize.Localizer) (Cluster, error)

NewKubernetesClusterConnection configures and connects to a Kubernetes cluster

type ConnectArguments

type ConnectArguments struct {
	OfflineAccessToken      string
	ForceCreationWithoutAsk bool
	IgnoreContext           bool
	SelectedKafka           string
	Namespace               string
}

type CredentialsSpec

type CredentialsSpec struct {
	// Reference to secret name that needs to be fetched
	SecretName string `json:"serviceAccountSecretName,omitempty"`
}

CredentialsSpec specification containing various formats of credentials

type KafkaConnection

type KafkaConnection struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   KafkaConnectionSpec   `json:"spec,omitempty"`
	Status KafkaConnectionStatus `json:"status,omitempty"`
}

KafkaConnection schema

type KafkaConnectionList

type KafkaConnectionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []KafkaConnection `json:"items"`
}

KafkaConnectionList contains a list of KafkaConnection

type KafkaConnectionSpec

type KafkaConnectionSpec struct {
	AccessTokenSecretName string          `json:"accessTokenSecretName,omitempty"`
	KafkaID               string          `json:"kafkaId,omitempty"`
	Credentials           CredentialsSpec `json:"credentials"`
}

KafkaConnectionSpec contains credentials and connection parameters to Kafka

type KafkaConnectionStatus

type KafkaConnectionStatus struct {
	CreatedBy       string              `json:"createdBy,omitempty"`
	Message         string              `json:"message,omitempty"`
	Updated         string              `json:"updated,omitempty"`
	BootstrapServer BootstrapServerSpec `json:"bootstrapServer"`
	// Reference to secret name that needs to be fetched
	SecretName string `json:"serviceAccountSecretName,omitempty"`
}

KafkaConnectionStatus defines the observed state of KafkaConnection

type KubernetesClients

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

type KubernetesCluster

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

KubernetesCluster is a type which represents a Kubernetes cluster

func (*KubernetesCluster) Connect

func (c *KubernetesCluster) Connect(ctx context.Context, cmdOptions *ConnectArguments) error

Connect connects a remote Kafka instance to the Kubernetes cluster

func (*KubernetesCluster) CurrentNamespace

func (c *KubernetesCluster) CurrentNamespace() (string, error)

CurrentNamespace returns the currently set namespace

func (*KubernetesCluster) IsRhoasOperatorAvailableOnCluster

func (c *KubernetesCluster) IsRhoasOperatorAvailableOnCluster(ctx context.Context) (bool, error)

IsRhoasOperatorAvailableOnCluster checks the cluster to see if a KafkaConnection CRD is installed

type ServiceBindingOptions

type ServiceBindingOptions struct {
	ServiceName             string
	Namespace               string
	AppName                 string
	ForceCreationWithoutAsk bool
	ForceUseOperator        bool
	ForceUseSDK             bool
	BindingName             string
	BindAsFiles             bool
}

Jump to

Keyboard shortcuts

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