Documentation ¶
Index ¶
- func GetESURL(esHost string, useSSL *bool) string
- func TemplateImagePullSecrets(ips []myspec.ImagePullSecrets) []v1.LocalObjectReference
- type K8sutil
- func (k *K8sutil) CertsSecretExists(namespace, clusterName string) bool
- func (k *K8sutil) ConfigmapExists(namespace, name string) bool
- func (k *K8sutil) CreateCerebroConfiguration(esHost string, useSSL *bool) map[string]string
- func (k *K8sutil) CreateCerebroDeployment(baseImage, clusterName, namespace, cert string, ...) error
- func (k *K8sutil) CreateCertsSecret(namespace, clusterName, certsDir string) error
- func (k *K8sutil) CreateClientDeployment(baseImage string, replicas *int32, javaOptions, clientJavaOptions string, ...) error
- func (k *K8sutil) CreateClientService(clusterName, namespace string, nodePort int32) error
- func (k *K8sutil) CreateConfigMap(namespace string, name string, data map[string]string) error
- func (k *K8sutil) CreateDataNodeDeployment(deploymentType string, replicas *int32, baseImage, storageClass string, ...) error
- func (k *K8sutil) CreateDataService(clusterName, namespace string) error
- func (k *K8sutil) CreateDiscoveryService(clusterName, namespace string) error
- func (k *K8sutil) CreateKibanaDeployment(baseImage, clusterName, namespace string, ...) error
- func (k *K8sutil) CreateKubernetesCustomResourceDefinition() error
- func (k *K8sutil) CreateMgmtService(service string, clusterName, namespace string) error
- func (k *K8sutil) CreateNodeInitDaemonset() error
- func (k *K8sutil) CreateStorageClass(zone, storageClassProvisioner, storageType string, clusterName string, ...) error
- func (k *K8sutil) DeleteCertsSecret(namespace, clusterName string) error
- func (k *K8sutil) DeleteDeployment(clusterName, namespace, deploymentType string) error
- func (k *K8sutil) DeleteServices(clusterName, namespace string) error
- func (k *K8sutil) DeleteStatefulSet(deploymentType, clusterName, namespace string) error
- func (k *K8sutil) DeleteStorageClasses(clusterName string) error
- func (k *K8sutil) GenerateCerts(configDir, certsDir, namespace, clusterName string) error
- func (k *K8sutil) GetClientServiceName(clusterName string) string
- func (k *K8sutil) GetClientServiceNameFullDNS(clusterName, namespace string) string
- func (k *K8sutil) GetMasterNodes(namespace string, name string) (*v1.PodList, error)
- func (k *K8sutil) MonitorDataPods(stopchan chan struct{}) (<-chan *v1.Pod, <-chan error)
- func (k *K8sutil) MonitorElasticSearchEvents(stopchan chan struct{}) (<-chan *myspec.ElasticsearchCluster, <-chan error)
- func (k *K8sutil) UpdateConfigMap(namespace string, name string, data map[string]string) error
- func (k *K8sutil) UpdateVolumeReclaimPolicy(policy, namespace string, name string)
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 CrdClient genclient.Interface Kclient kubernetes.Interface KubeExt apiextensionsclient.Interface K8sVersion []int MasterHost string EnableInitDaemonset bool InitDaemonsetNamespace string BusyboxImage string }
K8sutil defines the kube object
func New ¶
func New(kubeCfgFile, masterHost string, enableInitDaemonset bool, initDaemonsetNamespace, busyboxImage string) (*K8sutil, error)
New creates a new instance of k8sutil
func (*K8sutil) CertsSecretExists ¶
CertsSecretExists returms true if secret exists
func (*K8sutil) ConfigmapExists ¶
ConfigmapExists returns true if configmap exists
func (*K8sutil) CreateCerebroConfiguration ¶
CreateCerebroConfiguration creates Cerebro configuration
func (*K8sutil) CreateCerebroDeployment ¶
func (k *K8sutil) CreateCerebroDeployment(baseImage, clusterName, namespace, cert string, imagePullSecrets []myspec.ImagePullSecrets, imagePullPolicy string, serviceAccountName string, useSSL *bool) error
CreateCerebroDeployment creates a deployment of Cerebro
func (*K8sutil) CreateCertsSecret ¶
CreateCertsSecret creates the certs secrets
func (*K8sutil) CreateClientDeployment ¶
func (k *K8sutil) CreateClientDeployment(baseImage string, replicas *int32, javaOptions, clientJavaOptions string, resources myspec.Resources, imagePullSecrets []myspec.ImagePullSecrets, imagePullPolicy, serviceAccountName, clusterName, statsdEndpoint, networkHost, namespace string, useSSL *bool, affinity v1.Affinity) error
CreateClientDeployment creates the client deployment
func (*K8sutil) CreateClientService ¶
CreateClientService creates the client service
func (*K8sutil) CreateConfigMap ¶
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, imagePullPolicy, serviceAccountName, clusterName, statsdEndpoint, networkHost, namespace, javaOptions, masterJavaOptions, dataJavaOptions string, useSSL *bool, esUrl string, nodeSelector map[string]string, tolerations []v1.Toleration) error
CreateDataNodeDeployment creates the data node deployment
func (*K8sutil) CreateDataService ¶
CreateDataService creates the data service
func (*K8sutil) CreateDiscoveryService ¶
CreateDiscoveryService creates the discovery service
func (*K8sutil) CreateKibanaDeployment ¶
func (k *K8sutil) CreateKibanaDeployment(baseImage, clusterName, namespace string, imagePullSecrets []myspec.ImagePullSecrets, imagePullPolicy string, serviceAccountName string, useSSL *bool) error
CreateKibanaDeployment creates a deployment of Kibana
func (*K8sutil) CreateKubernetesCustomResourceDefinition ¶
CreateKubernetesCustomResourceDefinition checks if ElasticSearch CRD exists. If not, create
func (*K8sutil) CreateMgmtService ¶
CreateMgmtServices creates service for kibana or cerebro
func (*K8sutil) CreateNodeInitDaemonset ¶
CreateNodeInitDaemonset creates the node init daemonset
func (*K8sutil) CreateStorageClass ¶
func (k *K8sutil) CreateStorageClass(zone, storageClassProvisioner, storageType string, clusterName string, useEncryption string) error
CreateStorageClass creates a storage class NOTE: Right now only creating AWS EBS volumes type gp2
func (*K8sutil) DeleteCertsSecret ¶
DeleteCertsSecret deletes the certs secret
func (*K8sutil) DeleteDeployment ¶
TODO just mount the secret needed by each deployment DeleteDeployment deletes a deployment
func (*K8sutil) DeleteServices ¶
DeleteServices creates the discovery service
func (*K8sutil) DeleteStatefulSet ¶
DeleteStatefulSet deletes the data statefulset
func (*K8sutil) DeleteStorageClasses ¶
DeleteStorageClasses removes storage classes tied to the operator
func (*K8sutil) GenerateCerts ¶
GenerateCerts creates certs
func (*K8sutil) GetClientServiceName ¶
GetClientServiceName return the name of the client service
func (*K8sutil) GetClientServiceNameFullDNS ¶
GetClientServiceNameFullDNS return the full DNS name of the client service
func (*K8sutil) GetMasterNodes ¶
GetMasterNodes returns all master node pods
func (*K8sutil) MonitorDataPods ¶
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 ¶
UpdateConfigMap update a existent configmap
func (*K8sutil) UpdateVolumeReclaimPolicy ¶
UpdateVolumeReclaimPolicy updates the policy of the volume after it's created: See: https://github.com/kubernetes/kubernetes/issues/38192