Documentation ¶
Index ¶
- Constants
- func CreateChiServiceFQDN(chi *chop.ClickHouseInstallation) string
- func CreateChiServiceName(chi *chop.ClickHouseInstallation) string
- func CreateClusterServiceName(cluster *chop.ChiCluster) string
- func CreateConfigMapCommonName(chi *chop.ClickHouseInstallation) string
- func CreateConfigMapCommonUsersName(chi *chop.ClickHouseInstallation) string
- func CreateConfigMapPodName(host *chop.ChiHost) string
- func CreatePVCName(template *chop.ChiVolumeClaimTemplate, host *chop.ChiHost) string
- func CreatePodFQDN(host *chop.ChiHost) string
- func CreatePodFQDNsOfChi(chi *chop.ClickHouseInstallation) []string
- func CreatePodFQDNsOfCluster(cluster *chop.ChiCluster) []string
- func CreatePodFQDNsOfShard(shard *chop.ChiShard) []string
- func CreatePodHostname(host *chop.ChiHost) string
- func CreatePodName(obj interface{}) string
- func CreateShardServiceName(shard *chop.ChiShard) string
- func CreateStatefulSetName(host *chop.ChiHost) string
- func CreateStatefulSetServiceName(host *chop.ChiHost) string
- func GetChiNameFromObjectMeta(meta *meta.ObjectMeta) (string, error)
- func GetClusterNameFromObjectMeta(meta *meta.ObjectMeta) (string, error)
- func GetSelectorHostFromObjectMeta(obj *meta.ObjectMeta) (kublabels.Set, error)
- func HostCanDeletePVC(host *chiv1.ChiHost, pvcName string) bool
- func IsChopGeneratedObject(objectMeta *meta.ObjectMeta) bool
- func NewConfigSections(chConfigGenerator *ClickHouseConfigGenerator, chopConfig *chi.Config) *configSections
- type ClickHouseConfigGenerator
- func (c *ClickHouseConfigGenerator) GetFiles() map[string]string
- func (c *ClickHouseConfigGenerator) GetHostMacros(host *chiv1.ChiHost) string
- func (c *ClickHouseConfigGenerator) GetProfiles() string
- func (c *ClickHouseConfigGenerator) GetQuotas() string
- func (c *ClickHouseConfigGenerator) GetRemoteServers() string
- func (c *ClickHouseConfigGenerator) GetSettings() string
- func (c *ClickHouseConfigGenerator) GetUsers() string
- func (c *ClickHouseConfigGenerator) GetZookeeper() string
- type Creator
- func (c *Creator) CreateConfigMapChiCommon() *corev1.ConfigMap
- func (c *Creator) CreateConfigMapChiCommonUsers() *corev1.ConfigMap
- func (c *Creator) CreateConfigMapHost(host *chiv1.ChiHost) *corev1.ConfigMap
- func (c *Creator) CreateServiceChi() *corev1.Service
- func (c *Creator) CreateServiceCluster(cluster *chiv1.ChiCluster) *corev1.Service
- func (c *Creator) CreateServiceHost(host *chiv1.ChiHost) *corev1.Service
- func (c *Creator) CreateServiceShard(shard *chiv1.ChiShard) *corev1.Service
- func (c *Creator) CreateStatefulSet(host *chiv1.ChiHost) *apps.StatefulSet
- type Labeler
- type Normalizer
- type Schemer
- func (s *Schemer) ChiApplySQLs(chi *chop.ClickHouseInstallation, sqls []string, retry bool) error
- func (s *Schemer) ChiDropDnsCache(chi *chop.ClickHouseInstallation) error
- func (s *Schemer) ClusterApplySQLs(cluster *chop.ChiCluster, sqls []string, retry bool) error
- func (s *Schemer) ClusterGetCreateDatabases(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster) ([]string, []string, error)
- func (s *Schemer) ClusterGetCreateDistributedObjects(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster) ([]string, []string, error)
- func (s *Schemer) ClusterGetCreateTables(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster) ([]string, []string, error)
- func (s *Schemer) GetCreateReplicatedObjects(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster, host *chop.ChiHost) ([]string, []string, error)
- func (s *Schemer) HostApplySQLs(host *chop.ChiHost, sqls []string, retry bool) error
- func (s *Schemer) HostGetDropTables(host *chop.ChiHost) ([]string, []string, error)
- func (s *Schemer) ShardApplySQLs(shard *chop.ChiShard, sqls []string, retry bool) error
Constants ¶
const ( // Kubernetes labels LabelApp = clickhousealtinitycom.GroupName + "/app" LabelAppValue = "chop" LabelChop = clickhousealtinitycom.GroupName + "/chop" LabelChi = clickhousealtinitycom.GroupName + "/chi" LabelCluster = clickhousealtinitycom.GroupName + "/cluster" LabelShard = clickhousealtinitycom.GroupName + "/shard" LabelReplica = clickhousealtinitycom.GroupName + "/replica" // Supplementary service labels - used to cooperate with k8s LabelZookeeperConfigVersion = clickhousealtinitycom.GroupName + "/zookeeper-version" LabelSettingsConfigVersion = clickhousealtinitycom.GroupName + "/settings-version" )
const ( // Name of container within Pod with ClickHouse instance. Pod may have other containers included, such as monitoring ClickHouseContainerName = "clickhouse" ClickHouseLogContainerName = "clickhouse-log" )
Variables ¶
This section is empty.
Functions ¶
func CreateChiServiceFQDN ¶
func CreateChiServiceFQDN(chi *chop.ClickHouseInstallation) string
CreateChiServiceName creates a name of a Installation Service resource
func CreateChiServiceName ¶
func CreateChiServiceName(chi *chop.ClickHouseInstallation) string
CreateChiServiceName creates a name of a Installation Service resource
func CreateClusterServiceName ¶
func CreateClusterServiceName(cluster *chop.ChiCluster) string
CreateClusterServiceName returns a name of a cluster's Service
func CreateConfigMapCommonName ¶
func CreateConfigMapCommonName(chi *chop.ClickHouseInstallation) string
CreateConfigMapCommonName returns a name for a ConfigMap for replica's common chopConfig
func CreateConfigMapCommonUsersName ¶
func CreateConfigMapCommonUsersName(chi *chop.ClickHouseInstallation) string
CreateConfigMapCommonUsersName returns a name for a ConfigMap for replica's common chopConfig
func CreateConfigMapPodName ¶
CreateConfigMapPodName returns a name for a ConfigMap for ClickHouse pod
func CreatePVCName ¶
func CreatePVCName(template *chop.ChiVolumeClaimTemplate, host *chop.ChiHost) string
CreatePVCName create PVC name from PVC Template and host, to which PVC belongs to
func CreatePodFQDN ¶
CreatePodFQDN creates a fully qualified domain name of a pod ss-1eb454-2-0.my-dev-domain.svc.cluster.local
func CreatePodFQDNsOfChi ¶
func CreatePodFQDNsOfChi(chi *chop.ClickHouseInstallation) []string
CreatePodFQDNsOfChi creates fully qualified domain names of all pods in a CHI
func CreatePodFQDNsOfCluster ¶
func CreatePodFQDNsOfCluster(cluster *chop.ChiCluster) []string
CreatePodFQDNsOfCluster creates fully qualified domain names of all pods in a cluster
func CreatePodFQDNsOfShard ¶
CreatePodFQDNsOfShards creates fully qualified domain names of all pods in a shard
func CreatePodHostname ¶
CreatePodHostname returns a name of a Pod of a ClickHouse instance
func CreatePodName ¶
func CreatePodName(obj interface{}) string
CreatePodName create Pod name based on specified StatefulSet or Replica
func CreateShardServiceName ¶
CreateShardServiceName returns a name of a shard's Service
func CreateStatefulSetName ¶
CreateStatefulSetName creates a name of a StatefulSet for ClickHouse instance
func CreateStatefulSetServiceName ¶
CreateStatefulSetServiceName returns a name of a StatefulSet-related Service for ClickHouse instance
func GetChiNameFromObjectMeta ¶
func GetChiNameFromObjectMeta(meta *meta.ObjectMeta) (string, error)
func GetClusterNameFromObjectMeta ¶
func GetClusterNameFromObjectMeta(meta *meta.ObjectMeta) (string, error)
func GetSelectorHostFromObjectMeta ¶
func GetSelectorHostFromObjectMeta(obj *meta.ObjectMeta) (kublabels.Set, error)
func IsChopGeneratedObject ¶
func IsChopGeneratedObject(objectMeta *meta.ObjectMeta) bool
IsChopGeneratedObject check whether object is generated by an operator. Check is label-based
func NewConfigSections ¶
func NewConfigSections(chConfigGenerator *ClickHouseConfigGenerator, chopConfig *chi.Config) *configSections
Types ¶
type ClickHouseConfigGenerator ¶
type ClickHouseConfigGenerator struct {
// contains filtered or unexported fields
}
func NewClickHouseConfigGenerator ¶
func NewClickHouseConfigGenerator(chi *chiv1.ClickHouseInstallation) *ClickHouseConfigGenerator
NewClickHouseConfigGenerator returns new ClickHouseConfigGenerator struct
func (*ClickHouseConfigGenerator) GetFiles ¶
func (c *ClickHouseConfigGenerator) GetFiles() map[string]string
GetFiles creates data for custom common config files specified by user in .spec.configuration.files section
func (*ClickHouseConfigGenerator) GetHostMacros ¶
func (c *ClickHouseConfigGenerator) GetHostMacros(host *chiv1.ChiHost) string
GetHostMacros creates "macros.xml" content
func (*ClickHouseConfigGenerator) GetProfiles ¶
func (c *ClickHouseConfigGenerator) GetProfiles() string
GetProfiles creates data for "profiles.xml"
func (*ClickHouseConfigGenerator) GetQuotas ¶
func (c *ClickHouseConfigGenerator) GetQuotas() string
GetQuotas creates data for "quotas.xml"
func (*ClickHouseConfigGenerator) GetRemoteServers ¶
func (c *ClickHouseConfigGenerator) GetRemoteServers() string
GetRemoteServers creates "remote_servers.xml" content and calculates data generation parameters for other sections
func (*ClickHouseConfigGenerator) GetSettings ¶
func (c *ClickHouseConfigGenerator) GetSettings() string
GetSettings creates data for "settings.xml"
func (*ClickHouseConfigGenerator) GetUsers ¶
func (c *ClickHouseConfigGenerator) GetUsers() string
GetUsers creates data for "users.xml"
func (*ClickHouseConfigGenerator) GetZookeeper ¶
func (c *ClickHouseConfigGenerator) GetZookeeper() string
GetZookeeper creates data for "zookeeper.xml"
type Creator ¶
type Creator struct {
// contains filtered or unexported fields
}
func NewCreator ¶
func (*Creator) CreateConfigMapChiCommon ¶
createConfigMapChiCommon creates new corev1.ConfigMap
func (*Creator) CreateConfigMapChiCommonUsers ¶
createConfigMapChiCommonUsers creates new corev1.ConfigMap
func (*Creator) CreateConfigMapHost ¶
createConfigMapHost creates new corev1.ConfigMap
func (*Creator) CreateServiceChi ¶
createServiceChi creates new corev1.Service for specified CHI
func (*Creator) CreateServiceCluster ¶
func (c *Creator) CreateServiceCluster(cluster *chiv1.ChiCluster) *corev1.Service
createServiceCluster creates new corev1.Service for specified Cluster
func (*Creator) CreateServiceHost ¶
createServiceHost creates new corev1.Service for specified host
func (*Creator) CreateServiceShard ¶
createServiceShard creates new corev1.Service for specified Shard
func (*Creator) CreateStatefulSet ¶
func (c *Creator) CreateStatefulSet(host *chiv1.ChiHost) *apps.StatefulSet
createStatefulSet creates new apps.StatefulSet
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
func NewLabeler ¶
func NewLabeler(version string, chi *chi.ClickHouseInstallation) *Labeler
type Normalizer ¶
type Normalizer struct {
// contains filtered or unexported fields
}
func NewNormalizer ¶
func NewNormalizer(config *chiv1.Config) *Normalizer
func (*Normalizer) CreateTemplatedChi ¶
func (n *Normalizer) CreateTemplatedChi(chi *chiv1.ClickHouseInstallation, withDefaultCluster bool) (*chiv1.ClickHouseInstallation, error)
CreateTemplatedChi produces ready-to-use CHI object
func (*Normalizer) DoChi ¶
func (n *Normalizer) DoChi(chi *chiv1.ClickHouseInstallation) (*chiv1.ClickHouseInstallation, error)
DoChi normalizes CHI. Returns normalized CHI
type Schemer ¶
func NewSchemer ¶
func (*Schemer) ChiApplySQLs ¶
ChiApplySQLs runs set of SQL queries over the whole CHI
func (*Schemer) ChiDropDnsCache ¶
func (s *Schemer) ChiDropDnsCache(chi *chop.ClickHouseInstallation) error
ChiDropDnsCache runs 'DROP DNS CACHE' over the whole CHI
func (*Schemer) ClusterApplySQLs ¶
ClusterApplySQLs runs set of SQL queries over the cluster
func (*Schemer) ClusterGetCreateDatabases ¶
func (s *Schemer) ClusterGetCreateDatabases(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster) ([]string, []string, error)
ClusterGetCreateDatabases returns list of DB names and list of 'CREATE DATABASE ...' SQLs for these DBs
func (*Schemer) ClusterGetCreateDistributedObjects ¶
func (s *Schemer) ClusterGetCreateDistributedObjects(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster) ([]string, []string, error)
GetCreateDistributedObjects returns a list of objects that needs to be created on a shard in a cluster That incldues all Distributed tables, corresponding local tables, and databases, if necessary
func (*Schemer) ClusterGetCreateTables ¶
func (s *Schemer) ClusterGetCreateTables(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster) ([]string, []string, error)
ClusterGetCreateTables returns list of table names and list of 'CREATE TABLE ...' SQLs for these tables
func (*Schemer) GetCreateReplicatedObjects ¶
func (s *Schemer) GetCreateReplicatedObjects( chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster, host *chop.ChiHost, ) ([]string, []string, error)
GetCreateReplicatedObjects returns a list of objects that needs to be created on a host in a cluster
func (*Schemer) HostApplySQLs ¶
ReplicaApplySQLs runs set of SQL queries over the replica
func (*Schemer) HostGetDropTables ¶
ReplicaGetDropTables returns set of 'DROP TABLE ...' SQLs