cluster

package
v0.51.7-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Cluster package provides way to work with RHOAS and Service binding operators Package will ofer integration with various RHOAS services

Structure:

v1alpha - end user API kubeclient - provides kubernetes clients service - individual service implementations

Usage:

cliProperties := v1alpha.CommandEnvironment{
    IO:         opts.IO,
    Logger:     opts.Logger,
    Localizer:  opts.localizer,
    Config:     opts.Config,
    Connection: conn,
}

kubeClients, err := kubeclient.NewKubernetesClusterClients(&cliProperties, opts.kubeconfigLocation)

if err != nil {
    return err
}

clusterAPI := cluster.KubernetesClusterAPIImpl{
    KubernetesClients:  kubeClients,
    CommandEnvironment: &cliProperties,
}

err = clusterAPI.ExecuteServiceBinding(&v1alpha.BindOperationOptions{
    ServiceName:             opts.serviceName,
    Namespace:               opts.namespace,
    AppName:                 opts.appName,
    ForceCreationWithoutAsk: opts.forceCreationWithoutAsk,
    BindingName:             opts.bindingName,
    BindAsFiles:             !opts.bindAsEnv,
    DeploymentConfigEnabled: opts.deploymentConfigEnabled,
})

Adding new service in "4 Simple Steps" ™

1. Review services/defitinions.go and create definitions for your own service 2. Add new file with Structure that represent your own service CRD. For example see services/resources/KafkaConnection.go 3. Copy ./services/kafka.go and implement it for your own service. 4. Add reference to the latest resource in status.go to check if operator is up to date

After service is created you need to review `createServiceInstance` method that assings specific instance of service depending of string provided by user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesClusterAPIImpl

type KubernetesClusterAPIImpl struct {
	KubernetesClients  *kubeclient.KubernetesClients
	CommandEnvironment *v1alpha.CommandEnvironment
}

KubernetesClusterAPIImpl implements KubernetesClusterAPI

func (*KubernetesClusterAPIImpl) ExecuteClean

ExecuteClean - removes resources created by commands

func (*KubernetesClusterAPIImpl) ExecuteConnect

func (api *KubernetesClusterAPIImpl) ExecuteConnect(connectOpts *v1alpha.ConnectOperationOptions) error

Connect connects a remote Kafka instance to the Kubernetes cluster

func (*KubernetesClusterAPIImpl) ExecuteServiceBinding

func (c *KubernetesClusterAPIImpl) ExecuteServiceBinding(options *v1alpha.BindOperationOptions) error

func (*KubernetesClusterAPIImpl) ExecuteStatus

func (api *KubernetesClusterAPIImpl) ExecuteStatus() (*v1alpha.OperatorStatus, error)

ExecuteStatus executes status command by checking availability of operators and resources When unexpected error happens (non 404 error) function returns only error to the user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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