k8sutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: BSD-3-Clause Imports: 30 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetESURL added in v0.0.12

func GetESURL(esHost string, useSSL *bool) string

GetESURL Returns Elasticsearch URL

func TemplateImagePullSecrets

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

Types

type K8sutil

type K8sutil struct {
	Config     *rest.Config
	CrdClient  genclient.Interface
	Kclient    kubernetes.Interface
	KubeExt    apiextensionsclient.Interface
	K8sVersion []int
	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) CertsSecretExists added in v0.0.5

func (k *K8sutil) CertsSecretExists(namespace, clusterName string) bool

CertsSecretExists returms true if secret exists

func (*K8sutil) ConfigmapExists added in v0.0.9

func (k *K8sutil) ConfigmapExists(namespace, name string) bool

ConfigmapExists returns true if configmap exists

func (*K8sutil) CreateCerebroConfiguration added in v0.0.9

func (k *K8sutil) CreateCerebroConfiguration(esHost string, useSSL *bool) map[string]string

CreateCerebroConfiguration creates Cerebro configuration

func (*K8sutil) CreateCerebroDeployment added in v0.0.9

func (k *K8sutil) CreateCerebroDeployment(baseImage, clusterName, namespace, cert string, imagePullSecrets []myspec.ImagePullSecrets, useSSL *bool) error

CreateCerebroDeployment creates a deployment of Cerebro

func (*K8sutil) CreateCertsSecret added in v0.0.5

func (k *K8sutil) CreateCertsSecret(namespace, clusterName, certsDir string) error

CreateCertsSecret creates the certs secrets

func (*K8sutil) CreateClientDeployment added in v0.0.7

func (k *K8sutil) CreateClientDeployment(baseImage string, replicas *int32, javaOptions string,
	resources myspec.Resources, imagePullSecrets []myspec.ImagePullSecrets, clusterName, statsdEndpoint, networkHost, namespace string, useSSL *bool) error

CreateClientDeployment creates the client deployment

func (*K8sutil) CreateClientService

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

CreateClientService creates the client service

func (*K8sutil) CreateConfigMap added in v0.0.9

func (k *K8sutil) CreateConfigMap(namespace string, name string, data map[string]string) error

CreateConfigMap creates a new configMap

func (*K8sutil) CreateDataNodeDeployment

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

CreateDataNodeDeployment creates the data node deployment

func (*K8sutil) CreateDataService

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

CreateDataService creates the data service

func (*K8sutil) CreateDiscoveryService

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

CreateDiscoveryService creates the discovery service

func (*K8sutil) CreateKibanaDeployment added in v0.0.7

func (k *K8sutil) CreateKibanaDeployment(baseImage, clusterName, namespace string, imagePullSecrets []myspec.ImagePullSecrets, useSSL *bool) error

CreateKibanaDeployment creates a deployment of Kibana

func (*K8sutil) CreateKubernetesCustomResourceDefinition added in v0.0.8

func (k *K8sutil) CreateKubernetesCustomResourceDefinition() error

CreateKubernetesCustomResourceDefinition checks if ElasticSearch CRD exists. If not, create

func (*K8sutil) CreateMgmtService added in v0.2.0

func (k *K8sutil) CreateMgmtService(service string, clusterName, namespace string) error

CreateMgmtServices creates service for kibana or cerebro

func (*K8sutil) CreateNodeInitDaemonset added in v0.0.11

func (k *K8sutil) CreateNodeInitDaemonset(namespace string) error

CreateNodeInitDaemonset creates the node init daemonset

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) DeleteCertsSecret added in v0.0.5

func (k *K8sutil) DeleteCertsSecret(namespace, clusterName string) error

DeleteCertsSecret deletes the certs secret

func (*K8sutil) DeleteDeployment added in v0.0.7

func (k *K8sutil) DeleteDeployment(clusterName, namespace, deploymentType string) error

TODO just mount the secret needed by each deployment DeleteDeployment deletes a deployment

func (*K8sutil) DeleteServices

func (k *K8sutil) DeleteServices(clusterName, namespace string) error

DeleteServices creates the discovery service

func (*K8sutil) DeleteStatefulSet

func (k *K8sutil) DeleteStatefulSet(deploymentType, clusterName, namespace 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) GenerateCerts added in v0.0.5

func (k *K8sutil) GenerateCerts(configDir, certsDir, namespace, clusterName string) error

GenerateCerts creates certs

func (*K8sutil) GetClientServiceName added in v0.0.5

func (k *K8sutil) GetClientServiceName(clusterName string) string

GetClientServiceName return the name of the client service

func (*K8sutil) GetClientServiceNameFullDNS added in v0.0.5

func (k *K8sutil) GetClientServiceNameFullDNS(clusterName, namespace string) string

GetClientServiceNameFullDNS return the full DNS name of the client service

func (*K8sutil) MonitorDataPods added in v0.0.5

func (k *K8sutil) MonitorDataPods(stopchan chan struct{}) (<-chan *v1.Pod, <-chan error)

MonitorDataPods watches for new or changed data node pods

func (*K8sutil) MonitorElasticSearchEvents

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

MonitorElasticSearchEvents watches for new or removed clusters

func (*K8sutil) UpdateConfigMap added in v0.0.9

func (k *K8sutil) UpdateConfigMap(namespace string, name string, data map[string]string) error

UpdateConfigMap update a existent configmap

func (*K8sutil) UpdateVolumeReclaimPolicy added in v0.0.5

func (k *K8sutil) UpdateVolumeReclaimPolicy(policy, namespace string, name string)

UpdateVolumeReclaimPolicy updates the policy of the volume after it's created: See: https://github.com/kubernetes/kubernetes/issues/38192

Jump to

Keyboard shortcuts

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