k8sutil

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 24 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TemplateImagePullSecrets

func TemplateImagePullSecrets(ips []myspec.ImagePullSecrets) []v1.LocalObjectReference

Types

type K8sutil

type K8sutil struct {
	Config     *rest.Config
	TprClient  *rest.RESTClient
	Kclient    KubeInterface
	MasterHost string
}

K8sutil defines the kube object

func New

func New(kubeCfgFile, masterHost string) (*K8sutil, error)

New creates a new instance of k8sutil

func (*K8sutil) CreateClientMasterDeployment

func (k *K8sutil) CreateClientMasterDeployment(deploymentType, baseImage string, replicas *int32, javaOptions string,
	resources myspec.Resources, imagePullSecrets []myspec.ImagePullSecrets, clusterName, statsdEndpoint string) error

CreateClientMasterDeployment creates the client or master deployment

func (*K8sutil) CreateClientService

func (k *K8sutil) CreateClientService(clusterName string, nodePort int32) error

CreateClientService creates the client service

func (*K8sutil) CreateDataNodeDeployment

func (k *K8sutil) CreateDataNodeDeployment(replicas *int32, baseImage, storageClass string, dataDiskSize string, resources myspec.Resources,
	imagePullSecrets []myspec.ImagePullSecrets, clusterName, statsdEndpoint string) error

CreateDataNodeDeployment creates the data node deployment

func (*K8sutil) CreateDataService

func (k *K8sutil) CreateDataService(clusterName string) error

CreateDataService creates the data service

func (*K8sutil) CreateDiscoveryService

func (k *K8sutil) CreateDiscoveryService(clusterName string) error

CreateDiscoveryService creates the discovery service

func (*K8sutil) CreateKubernetesThirdPartyResource

func (k *K8sutil) CreateKubernetesThirdPartyResource() error

CreateKubernetesThirdPartyResource checks if ElasticSearch TPR exists. If not, create

func (*K8sutil) CreateStorageClass

func (k *K8sutil) CreateStorageClass(zone, storageClassProvisioner, storageType string, clusterName string) error

CreateStorageClass creates a storage class NOTE: Right now only creating AWS EBS volumes type gp2

func (*K8sutil) DeleteClientMasterDeployment

func (k *K8sutil) DeleteClientMasterDeployment(deploymentType string, clusterName string) error

DeleteClientMasterDeployment deletes the client or master deployment

func (*K8sutil) DeleteServices

func (k *K8sutil) DeleteServices(clusterName string)

DeleteServices creates the discovery service

func (*K8sutil) DeleteStatefulSet

func (k *K8sutil) DeleteStatefulSet(clusterName string) error

DeleteStatefulSet deletes the data statefulset

func (*K8sutil) DeleteStorageClasses

func (k *K8sutil) DeleteStorageClasses(clusterName string) error

DeleteStorageClasses removes storage classes tied to the operator

func (*K8sutil) GetElasticSearchClusters

func (k *K8sutil) GetElasticSearchClusters() ([]myspec.ElasticsearchCluster, error)

GetElasticSearchClusters returns a list of custom clusters defined

func (*K8sutil) MonitorElasticSearchEvents

func (k *K8sutil) MonitorElasticSearchEvents(stopchan chan struct{}) (<-chan *myspec.ElasticsearchCluster, <-chan error)

MonitorElasticSearchEvents watches for new or removed clusters

type KubeInterface

type KubeInterface interface {
	Services(namespace string) coreType.ServiceInterface
	ThirdPartyResources() extensionsType.ThirdPartyResourceInterface
	Deployments(namespace string) extensionsType.DeploymentInterface
	StatefulSets(namespace string) appsType.StatefulSetInterface
	StorageClasses() storageType.StorageClassInterface
	ReplicaSets(namespace string) extensionsType.ReplicaSetInterface
}

KubeInterface abstracts the kubernetes client

Jump to

Keyboard shortcuts

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