v1

package
v0.0.1-0...-ce92ebd Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package v1 defines version 1 of the API used with ClickHouse Installation Custom Resources.

Package v1 defines version 1 of the API used with ClickHouse Installation Custom Resources.

Package v1 defines version 1 of the API used with ClickHouse Installation Custom Resources.

Index

Constants

View Source
const (
	StatusInProgress  = "InProgress"
	StatusCompleted   = "Completed"
	StatusTerminating = "Terminating"
)

Possible CHI statuses

View Source
const (
	ClickHouseInstallationCRDResourceKind         = "ClickHouseInstallation"
	ClickHouseInstallationTemplateCRDResourceKind = "ClickHouseInstallationTemplate"
	ClickHouseOperatorCRDResourceKind             = "ClickHouseOperator"
)

Possible kinds of CRDs

View Source
const (
	// What to do in case StatefulSet can't reach new Generation - abort CHI reconcile
	OnStatefulSetCreateFailureActionAbort = "abort"

	// What to do in case StatefulSet can't reach new Generation - delete newly created problematic StatefulSet
	OnStatefulSetCreateFailureActionDelete = "delete"

	// What to do in case StatefulSet can't reach new Generation - do nothing, keep StatefulSet broken and move to the next
	OnStatefulSetCreateFailureActionIgnore = "ignore"
)

used in type OperatorConfig struct

View Source
const (
	// What to do in case StatefulSet can't reach new Generation - abort CHI reconcile
	OnStatefulSetUpdateFailureActionAbort = "abort"

	// What to do in case StatefulSet can't reach new Generation - delete Pod and rollback StatefulSet to previous Generation
	// Pod would be recreated by StatefulSet based on rollback-ed configuration
	OnStatefulSetUpdateFailureActionRollback = "rollback"

	// What to do in case StatefulSet can't reach new Generation - do nothing, keep StatefulSet broken and move to the next
	OnStatefulSetUpdateFailureActionIgnore = "ignore"
)

used in type OperatorConfig struct

View Source
const (
	PodDistributionUnspecified = "Unspecified"
	// AntiAffinity section
	PodDistributionClickHouseAntiAffinity                    = "ClickHouseAntiAffinity"
	PodDistributionShardAntiAffinity                         = "ShardAntiAffinity"
	PodDistributionReplicaAntiAffinity                       = "ReplicaAntiAffinity"
	PodDistributionAnotherNamespaceAntiAffinity              = "AnotherNamespaceAntiAffinity"
	PodDistributionAnotherClickHouseInstallationAntiAffinity = "AnotherClickHouseInstallationAntiAffinity"
	PodDistributionAnotherClusterAntiAffinity                = "AnotherClusterAntiAffinity"
	// Affinity section
	PodDistributionNamespaceAffinity              = "NamespaceAffinity"
	PodDistributionClickHouseInstallationAffinity = "ClickHouseInstallationAffinity"
	PodDistributionClusterAffinity                = "ClusterAffinity"
	PodDistributionShardAffinity                  = "ShardAffinity"
	PodDistributionReplicaAffinity                = "ReplicaAffinity"
	PodDistributionPreviousTailAffinity           = "PreviousTailAffinity"
	// Misc section
	PodDistributionMaxNumberPerNode                    = "MaxNumberPerNode"
	PodDistributionMaxNumberPerNodeEqualsReplicasCount = 2000000000
	// Shortcuts section
	PodDistributionCircularReplication = "CircularReplication"

	PodDistributionScopeUnspecified = "Unspecified"
	// Pods from different ClickHouseInstallation.Cluster.Shard can co-exist on one node
	PodDistributionScopeShard = "Shard"
	// Pods from different ClickHouseInstallation.Cluster.Replica can co-exist on one node
	PodDistributionScopeReplica = "Replica"
	// Pods from different ClickHouseInstallation.Cluster can co-exist on one node
	PodDistributionScopeCluster = "Cluster"
	// Pods from different ClickHouseInstallations can co-exist on one node
	PodDistributionScopeClickHouseInstallation = "ClickHouseInstallation"
	// Pods from different Namespaces can co-exist on one node
	PodDistributionScopeNamespace = "Namespace"
	// No Pods can co-exist on one node
	PodDistributionScopeGlobal = "Global"

	// Deprecated value
	PodDistributionOnePerHost = "OnePerHost"
)

Possible pod distributions

View Source
const (
	PortDistributionUnspecified       = "Unspecified"
	PortDistributionClusterScopeIndex = "ClusterScopeIndex"
)

Possible port distributions

View Source
const (
	UsernameReplacer = "***"
	PasswordReplacer = "***"
)

Username/password replacers

View Source
const (
	// OPERATOR_POD_NODE_NAME name from spec.nodeName: ip-172-20-52-62.ec2.internal
	OPERATOR_POD_NODE_NAME = "OPERATOR_POD_NODE_NAME"
	// OPERATOR_POD_NAME name from metadata.name: clickhouse-operator-6f87589dbb-ftcsf
	OPERATOR_POD_NAME = "OPERATOR_POD_NAME"
	// OPERATOR_POD_NAMESPACE name from metadata.namespace: kube-system
	OPERATOR_POD_NAMESPACE = "OPERATOR_POD_NAMESPACE"
	// OPERATOR_POD_IP ip from status.podIP: 100.96.3.2
	OPERATOR_POD_IP = "OPERATOR_POD_IP"
	// OPERATOR_POD_SERVICE_ACCOUNT service account
	// spec.serviceAccount: clickhouse-operator
	// spec.serviceAccountName: clickhouse-operator
	OPERATOR_POD_SERVICE_ACCOUNT = "OPERATOR_POD_SERVICE_ACCOUNT"

	// OPERATOR_CONTAINER_CPU_REQUEST from .containers.resources.requests.cpu
	OPERATOR_CONTAINER_CPU_REQUEST = "OPERATOR_CONTAINER_CPU_REQUEST"
	// OPERATOR_CONTAINER_CPU_LIMIT from .containers.resources.limits.cpu
	OPERATOR_CONTAINER_CPU_LIMIT = "OPERATOR_CONTAINER_CPU_LIMIT"
	// OPERATOR_CONTAINER_MEM_REQUEST from .containers.resources.requests.memory
	OPERATOR_CONTAINER_MEM_REQUEST = "OPERATOR_CONTAINER_MEM_REQUEST"
	// OPERATOR_CONTAINER_MEM_LIMIT from .containers.resources.limits.memory
	OPERATOR_CONTAINER_MEM_LIMIT = "OPERATOR_CONTAINER_MEM_LIMIT"

	// WATCH_NAMESPACE and WATCH_NAMESPACES specifies what namespaces to watch
	WATCH_NAMESPACE = "WATCH_NAMESPACE"
	// WATCH_NAMESPACES and WATCH_NAMESPACE specifies what namespaces to watch
	WATCH_NAMESPACES = "WATCH_NAMESPACES"

	// CHOP_CONFIG clickhouse operator configuration
	CHOP_CONFIG = "CHOP_CONFIG"
)
View Source
const (
	TemplatingPolicyManual = "manual"
	TemplatingPolicyAuto   = "auto"
)

Possible templating policies

View Source
const (
	RestartAll = "Restart"
	// RestartRollingUpdate requires to roll over all hosts in the cluster and shutdown and reconcile each of it.
	// This restart policy means that all hosts in the cluster would pass through shutdown/reconcile cycle.
	RestartRollingUpdate = "RollingUpdate"
)

Restart const presents possible values for .spec.restart

View Source
const (
	// CommonConfigDir specifies folder's name, where generated common XML files for ClickHouse would be placed
	CommonConfigDir = "config.d"

	// UsersConfigDir specifies folder's name, where generated users XML files for ClickHouse would be placed
	UsersConfigDir = "users.d"

	// HostConfigDir specifies folder's name, where generated host XML files for ClickHouse would be placed
	HostConfigDir = "conf.d"

	// TemplatesDir specifies folder's name where ClickHouseInstallationTemplates are located
	TemplatesDir = "templates.d"
)
View Source
const (

	// DefaultReconcileThreadsWarmup specifies default reconcile threads warmup time
	DefaultReconcileThreadsWarmup = 10 * time.Second

	// DefaultReconcileSystemThreadsNumber specifies default number of system controller threads running concurrently.
	// Used in case no other specified in config
	DefaultReconcileSystemThreadsNumber = 1
)
View Source
const (
	ObjectsCleanupUnspecified = "Unspecified"
	ObjectsCleanupRetain      = "Retain"
	ObjectsCleanupDelete      = "Delete"
)

Possible objects cleanup options

View Source
const (
	ReconcilingPolicyUnspecified = "unspecified"
	ReconcilingPolicyWait        = "wait"
	ReconcilingPolicyNoWait      = "nowait"
)

Possible reconcile policy values

Variables

View Source
var (
	// SchemeBuilder collects scheme builder functions
	SchemeBuilder runtime.SchemeBuilder
	// AddToScheme applies SchemeBuilder functions to the specified scheme
	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   clickhousealtinitycom.GroupName,
	Version: "v1",
}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource returns schema.GroupResource

Types

type ChiCleanup

type ChiCleanup struct {
	// UnknownObjects specifies cleanup of unknown objects
	UnknownObjects *ChiObjectsCleanup `json:"unknownObjects,omitempty" yaml:"unknownObjects,omitempty"`
	// ReconcileFailedObjects specifies cleanup of failed objects
	ReconcileFailedObjects *ChiObjectsCleanup `json:"reconcileFailedObjects,omitempty" yaml:"reconcileFailedObjects,omitempty"`
}

ChiCleanup defines cleanup

func NewChiCleanup

func NewChiCleanup() *ChiCleanup

NewChiCleanup creates new cleanup

func (*ChiCleanup) DeepCopy

func (in *ChiCleanup) DeepCopy() *ChiCleanup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiCleanup.

func (*ChiCleanup) DeepCopyInto

func (in *ChiCleanup) DeepCopyInto(out *ChiCleanup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiCleanup) DefaultReconcileFailedObjects

func (t *ChiCleanup) DefaultReconcileFailedObjects() *ChiObjectsCleanup

DefaultReconcileFailedObjects makes default cleanup for failed objects

func (*ChiCleanup) DefaultUnknownObjects

func (t *ChiCleanup) DefaultUnknownObjects() *ChiObjectsCleanup

DefaultUnknownObjects makes default cleanup for known objects

func (*ChiCleanup) GetReconcileFailedObjects

func (t *ChiCleanup) GetReconcileFailedObjects() *ChiObjectsCleanup

GetReconcileFailedObjects gets failed objects cleanup

func (*ChiCleanup) GetUnknownObjects

func (t *ChiCleanup) GetUnknownObjects() *ChiObjectsCleanup

GetUnknownObjects gets unknown objects cleanup

func (*ChiCleanup) MergeFrom

func (t *ChiCleanup) MergeFrom(from *ChiCleanup, _type MergeType) *ChiCleanup

MergeFrom merges from specified cleanup

func (*ChiCleanup) SetDefaults

func (t *ChiCleanup) SetDefaults() *ChiCleanup

SetDefaults set defaults for cleanup

type ChiCluster

type ChiCluster struct {
	Name      string              `json:"name,omitempty"      yaml:"name,omitempty"`
	Zookeeper *ChiZookeeperConfig `json:"zookeeper,omitempty" yaml:"zookeeper,omitempty"`
	Settings  *Settings           `json:"settings,omitempty"  yaml:"settings,omitempty"`
	Files     *Settings           `json:"files,omitempty"     yaml:"files,omitempty"`
	Templates *ChiTemplateNames   `json:"templates,omitempty" yaml:"templates,omitempty"`
	Layout    *ChiClusterLayout   `json:"layout,omitempty"    yaml:"layout,omitempty"`

	// Internal data
	Address ChiClusterAddress       `json:"-" yaml:"-"`
	CHI     *ClickHouseInstallation `json:"-" yaml:"-" testdiff:"ignore"`
}

ChiCluster defines item of a clusters section of .configuration

func (*ChiCluster) DeepCopy

func (in *ChiCluster) DeepCopy() *ChiCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiCluster.

func (*ChiCluster) DeepCopyInto

func (in *ChiCluster) DeepCopyInto(out *ChiCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiCluster) FillShardReplicaSpecified

func (cluster *ChiCluster) FillShardReplicaSpecified()

FillShardReplicaSpecified fills whether shard or replicas are explicitly specified

func (*ChiCluster) FindHost

func (cluster *ChiCluster) FindHost(needle interface{}) *ChiHost

FindHost finds host in the cluster

func (*ChiCluster) FindShard

func (cluster *ChiCluster) FindShard(needle interface{}) *ChiShard

FindShard finds shard by either name or index

func (*ChiCluster) FirstHost

func (cluster *ChiCluster) FirstHost() *ChiHost

FirstHost finds first host in the cluster

func (*ChiCluster) GetCHI

func (cluster *ChiCluster) GetCHI() *ClickHouseInstallation

GetCHI gets parent CHI

func (*ChiCluster) GetOrCreateHost

func (cluster *ChiCluster) GetOrCreateHost(shard, replica int) *ChiHost

GetOrCreateHost gets or creates host on specified coordinates

func (*ChiCluster) GetReplica

func (cluster *ChiCluster) GetReplica(replica int) *ChiReplica

GetReplica gets replica with specified index

func (*ChiCluster) GetServiceTemplate

func (cluster *ChiCluster) GetServiceTemplate() (*ChiServiceTemplate, bool)

GetServiceTemplate returns service template, if exists

func (*ChiCluster) GetShard

func (cluster *ChiCluster) GetShard(shard int) *ChiShard

GetShard gets shard with specified index

func (*ChiCluster) HostsCount

func (cluster *ChiCluster) HostsCount() int

HostsCount counts hosts

func (*ChiCluster) InheritFilesFrom

func (cluster *ChiCluster) InheritFilesFrom(chi *ClickHouseInstallation)

InheritFilesFrom inherits files from CHI

func (*ChiCluster) InheritTemplatesFrom

func (cluster *ChiCluster) InheritTemplatesFrom(chi *ClickHouseInstallation)

InheritTemplatesFrom inherits templates from CHI

func (*ChiCluster) InheritZookeeperFrom

func (cluster *ChiCluster) InheritZookeeperFrom(chi *ClickHouseInstallation)

InheritZookeeperFrom inherits zookeeper config from CHI

func (*ChiCluster) IsShardSpecified

func (cluster *ChiCluster) IsShardSpecified() bool

IsShardSpecified checks whether shard is explicitly specified

func (*ChiCluster) WalkHosts

func (cluster *ChiCluster) WalkHosts(f func(host *ChiHost) error) []error

WalkHosts walks hosts

func (*ChiCluster) WalkHostsByReplicas

func (cluster *ChiCluster) WalkHostsByReplicas(f func(shard, replica int, host *ChiHost) error) []error

WalkHostsByReplicas walks hosts by replicas

func (*ChiCluster) WalkHostsByShards

func (cluster *ChiCluster) WalkHostsByShards(f func(shard, replica int, host *ChiHost) error) []error

WalkHostsByShards walks hosts by shards

func (*ChiCluster) WalkReplicas

func (cluster *ChiCluster) WalkReplicas(f func(index int, replica *ChiReplica) error) []error

WalkReplicas walks replicas

func (*ChiCluster) WalkShards

func (cluster *ChiCluster) WalkShards(
	f func(index int, shard *ChiShard) error,
) []error

WalkShards walks shards

type ChiClusterAddress

type ChiClusterAddress struct {
	Namespace    string `json:"namespace,omitempty"    yaml:"namespace,omitempty"`
	CHIName      string `json:"chiName,omitempty"      yaml:"chiName,omitempty"`
	ClusterName  string `json:"clusterName,omitempty"  yaml:"clusterName,omitempty"`
	ClusterIndex int    `json:"clusterIndex,omitempty" yaml:"clusterIndex,omitempty"`
}

ChiClusterAddress defines address of a cluster within ClickHouseInstallation

func (*ChiClusterAddress) DeepCopy

func (in *ChiClusterAddress) DeepCopy() *ChiClusterAddress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiClusterAddress.

func (*ChiClusterAddress) DeepCopyInto

func (in *ChiClusterAddress) DeepCopyInto(out *ChiClusterAddress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiClusterLayout

type ChiClusterLayout struct {
	// DEPRECATED - to be removed soon
	Type          string `json:"type,omitempty"          yaml:"type,omitempty"`
	ShardsCount   int    `json:"shardsCount,omitempty"   yaml:"shardsCount,omitempty"`
	ReplicasCount int    `json:"replicasCount,omitempty" yaml:"replicasCount,omitempty"`
	// TODO refactor into map[string]ChiShard
	Shards   []ChiShard   `json:"shards,omitempty"   yaml:"shards,omitempty"`
	Replicas []ChiReplica `json:"replicas,omitempty" yaml:"replicas,omitempty"`

	// Internal data
	// Whether shards or replicas are explicitly specified as Shards []ChiShard or Replicas []ChiReplica
	ShardsSpecified   bool        `json:"-" yaml:"-" testdiff:"ignore"`
	ReplicasSpecified bool        `json:"-" yaml:"-" testdiff:"ignore"`
	HostsField        *HostsField `json:"-" yaml:"-" testdiff:"ignore"`
}

ChiClusterLayout defines layout section of .spec.configuration.clusters

func NewChiClusterLayout

func NewChiClusterLayout() *ChiClusterLayout

NewChiClusterLayout creates new cluster layout

func (*ChiClusterLayout) DeepCopy

func (in *ChiClusterLayout) DeepCopy() *ChiClusterLayout

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiClusterLayout.

func (*ChiClusterLayout) DeepCopyInto

func (in *ChiClusterLayout) DeepCopyInto(out *ChiClusterLayout)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiDefaults

type ChiDefaults struct {
	ReplicasUseFQDN string             `json:"replicasUseFQDN,omitempty" yaml:"replicasUseFQDN,omitempty"`
	DistributedDDL  *ChiDistributedDDL `json:"distributedDDL,omitempty"  yaml:"distributedDDL,omitempty"`
	Templates       *ChiTemplateNames  `json:"templates,omitempty"       yaml:"templates,omitempty"`
}

ChiDefaults defines defaults section of .spec

func NewChiDefaults

func NewChiDefaults() *ChiDefaults

NewChiDefaults creates new ChiDefaults object

func (*ChiDefaults) DeepCopy

func (in *ChiDefaults) DeepCopy() *ChiDefaults

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiDefaults.

func (*ChiDefaults) DeepCopyInto

func (in *ChiDefaults) DeepCopyInto(out *ChiDefaults)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiDefaults) MergeFrom

func (defaults *ChiDefaults) MergeFrom(from *ChiDefaults, _type MergeType) *ChiDefaults

MergeFrom merges from specified object

type ChiDistributedDDL

type ChiDistributedDDL struct {
	Profile string `json:"profile,omitempty" yaml:"profile"`
}

ChiDistributedDDL defines distributedDDL section of .spec.defaults

func NewChiDistributedDDL

func NewChiDistributedDDL() *ChiDistributedDDL

NewChiDistributedDDL creates new ChiDistributedDDL

func (*ChiDistributedDDL) DeepCopy

func (in *ChiDistributedDDL) DeepCopy() *ChiDistributedDDL

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiDistributedDDL.

func (*ChiDistributedDDL) DeepCopyInto

func (in *ChiDistributedDDL) DeepCopyInto(out *ChiDistributedDDL)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiDistributedDDL) GetProfile

func (d *ChiDistributedDDL) GetProfile() string

GetProfile gets profile

func (*ChiDistributedDDL) HasProfile

func (d *ChiDistributedDDL) HasProfile() bool

HasProfile checks whether profile is present

func (*ChiDistributedDDL) MergeFrom

func (d *ChiDistributedDDL) MergeFrom(from *ChiDistributedDDL, _type MergeType) *ChiDistributedDDL

MergeFrom merges from specified source

type ChiHost

type ChiHost struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// DEPRECATED - to be removed soon
	Port                int32             `json:"port,omitempty"                yaml:"port,omitempty"`
	TCPPort             int32             `json:"tcpPort,omitempty"             yaml:"tcpPort,omitempty"`
	HTTPPort            int32             `json:"httpPort,omitempty"            yaml:"httpPort,omitempty"`
	InterserverHTTPPort int32             `json:"interserverHTTPPort,omitempty" yaml:"interserverHTTPPort,omitempty"`
	Settings            *Settings         `json:"settings,omitempty"            yaml:"settings,omitempty"`
	Files               *Settings         `json:"files,omitempty"               yaml:"files,omitempty"`
	Templates           *ChiTemplateNames `json:"templates,omitempty"           yaml:"templates,omitempty"`

	// Internal data
	Address             ChiHostAddress             `json:"-" yaml:"-"`
	Config              ChiHostConfig              `json:"-" yaml:"-"`
	ReconcileAttributes ChiHostReconcileAttributes `json:"-" yaml:"-" testdiff:"ignore"`
	StatefulSet         *appsv1.StatefulSet        `json:"-" yaml:"-" testdiff:"ignore"`
	CurStatefulSet      *appsv1.StatefulSet        `json:"-" yaml:"-" testdiff:"ignore"`
	DesiredStatefulSet  *appsv1.StatefulSet        `json:"-" yaml:"-" testdiff:"ignore"`
	CHI                 *ClickHouseInstallation    `json:"-" yaml:"-" testdiff:"ignore"`
}

ChiHost defines host (a data replica within a shard) of .spec.configuration.clusters[n].shards[m]

func (*ChiHost) CanDeleteAllPVCs

func (host *ChiHost) CanDeleteAllPVCs() bool

CanDeleteAllPVCs checks whether all PVCs can be deleted

func (*ChiHost) DeepCopy

func (in *ChiHost) DeepCopy() *ChiHost

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiHost.

func (*ChiHost) DeepCopyInto

func (in *ChiHost) DeepCopyInto(out *ChiHost)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiHost) GetCHI

func (host *ChiHost) GetCHI() *ClickHouseInstallation

GetCHI gets CHI

func (*ChiHost) GetCluster

func (host *ChiHost) GetCluster() *ChiCluster

GetCluster gets cluster

func (*ChiHost) GetHostTemplate

func (host *ChiHost) GetHostTemplate() (*ChiHostTemplate, bool)

GetHostTemplate gets host template

func (*ChiHost) GetName

func (host *ChiHost) GetName() string

GetName gets name

func (*ChiHost) GetPodTemplate

func (host *ChiHost) GetPodTemplate() (*ChiPodTemplate, bool)

GetPodTemplate gets pod template

func (*ChiHost) GetServiceTemplate

func (host *ChiHost) GetServiceTemplate() (*ChiServiceTemplate, bool)

GetServiceTemplate gets service template

func (*ChiHost) GetSettings

func (host *ChiHost) GetSettings() *Settings

GetSettings gets settings

func (*ChiHost) GetShard

func (host *ChiHost) GetShard() *ChiShard

GetShard gets shard

func (*ChiHost) GetStatefulSetReplicasNum

func (host *ChiHost) GetStatefulSetReplicasNum(shutdown bool) *int32

GetStatefulSetReplicasNum gets stateful set replica num

func (*ChiHost) GetZookeeper

func (host *ChiHost) GetZookeeper() *ChiZookeeperConfig

GetZookeeper gets zookeeper

func (*ChiHost) InheritFilesFrom

func (host *ChiHost) InheritFilesFrom(shard *ChiShard, replica *ChiReplica)

InheritFilesFrom inherits files from specified shard and replica

func (*ChiHost) InheritSettingsFrom

func (host *ChiHost) InheritSettingsFrom(shard *ChiShard, replica *ChiReplica)

InheritSettingsFrom inherits settings from specified shard and replica

func (*ChiHost) InheritTemplatesFrom

func (host *ChiHost) InheritTemplatesFrom(shard *ChiShard, replica *ChiReplica, template *ChiHostTemplate)

InheritTemplatesFrom inherits templates from specified shard and replica

func (*ChiHost) MergeFrom

func (host *ChiHost) MergeFrom(from *ChiHost)

MergeFrom merges from specified host

func (*ChiHost) WalkVolumeClaimTemplates

func (host *ChiHost) WalkVolumeClaimTemplates(f func(template *ChiVolumeClaimTemplate))

WalkVolumeClaimTemplates walks VolumeClaimTemplate(s)

func (*ChiHost) WalkVolumeMounts

func (host *ChiHost) WalkVolumeMounts(f func(volumeMount *corev1.VolumeMount))

WalkVolumeMounts walks VolumeMount(s)

type ChiHostAddress

type ChiHostAddress struct {
	Namespace               string `json:"namespace"               yaml:"namespace"`
	StatefulSet             string `json:"statefulSet"             yaml:"statefulSet"`
	CHIName                 string `json:"chiName"                 yaml:"chiName"`
	ClusterName             string `json:"clusterName"             yaml:"clusterName"`
	ClusterIndex            int    `json:"clusterIndex"            yaml:"clusterIndex"`
	ShardName               string `json:"shardName"               yaml:"shardName"`
	ShardIndex              int    `json:"shardIndex"              yaml:"shardIndex"`
	ShardScopeIndex         int    `json:"shardScopeIndex"         yaml:"shardScopeIndex"`
	ReplicaName             string `json:"replicaName"             yaml:"replicaName"`
	ReplicaIndex            int    `json:"replicaIndex"            yaml:"replicaIndex"`
	ReplicaScopeIndex       int    `json:"replicaScopeIndex"       yaml:"replicaScopeIndex"`
	HostName                string `json:"hostName"                yaml:"hostName"`
	CHIScopeIndex           int    `json:"chiScopeIndex"           yaml:"chiScopeIndex"`
	CHIScopeCycleSize       int    `json:"chiScopeCycleSize"       yaml:"chiScopeCycleSize"`
	CHIScopeCycleIndex      int    `json:"chiScopeCycleIndex"      yaml:"chiScopeCycleIndex"`
	CHIScopeCycleOffset     int    `json:"chiScopeCycleOffset"     yaml:"chiScopeCycleOffset"`
	ClusterScopeIndex       int    `json:"clusterScopeIndex"       yaml:"clusterScopeIndex"`
	ClusterScopeCycleSize   int    `json:"clusterScopeCycleSize"   yaml:"clusterScopeCycleSize"`
	ClusterScopeCycleIndex  int    `json:"clusterScopeCycleIndex"  yaml:"clusterScopeCycleIndex"`
	ClusterScopeCycleOffset int    `json:"clusterScopeCycleOffset" yaml:"clusterScopeCycleOffset"`
}

ChiHostAddress defines address of a host within ClickHouseInstallation

func (ChiHostAddress) ClusterNameString

func (a ChiHostAddress) ClusterNameString() string

ClusterNameString creates cluster+host pair

func (ChiHostAddress) CompactString

func (a ChiHostAddress) CompactString() string

CompactString creates compact string representation

func (*ChiHostAddress) DeepCopy

func (in *ChiHostAddress) DeepCopy() *ChiHostAddress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiHostAddress.

func (*ChiHostAddress) DeepCopyInto

func (in *ChiHostAddress) DeepCopyInto(out *ChiHostAddress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ChiHostAddress) NamespaceCHINameString

func (a ChiHostAddress) NamespaceCHINameString() string

NamespaceCHINameString creates namespace+CHI pair

func (ChiHostAddress) NamespaceNameString

func (a ChiHostAddress) NamespaceNameString() string

NamespaceNameString creates namespace+name pair

type ChiHostConfig

type ChiHostConfig struct {
	ZookeeperFingerprint string `json:"zookeeperfingerprint" yaml:"zookeeperfingerprint"`
	SettingsFingerprint  string `json:"settingsfingerprint"  yaml:"settingsfingerprint"`
	FilesFingerprint     string `json:"filesfingerprint"     yaml:"filesfingerprint"`
}

ChiHostConfig defines additional data related to a host

func (*ChiHostConfig) DeepCopy

func (in *ChiHostConfig) DeepCopy() *ChiHostConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiHostConfig.

func (*ChiHostConfig) DeepCopyInto

func (in *ChiHostConfig) DeepCopyInto(out *ChiHostConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiHostReconcileAttributes

type ChiHostReconcileAttributes struct {
	// contains filtered or unexported fields
}

ChiHostReconcileAttributes defines host reconcile status

func NewChiHostReconcileAttributes

func NewChiHostReconcileAttributes() *ChiHostReconcileAttributes

NewChiHostReconcileAttributes creates new reconcile attributes

func (*ChiHostReconcileAttributes) Any

Any checks whether any of the attributes is set

func (*ChiHostReconcileAttributes) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiHostReconcileAttributes.

func (*ChiHostReconcileAttributes) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiHostReconcileAttributes) Equal

Equal checks whether reconcile attributes are equal

func (*ChiHostReconcileAttributes) GetStatus

GetStatus gets status

func (*ChiHostReconcileAttributes) IsAdd

func (s *ChiHostReconcileAttributes) IsAdd() bool

IsAdd checks whether 'add' attribute is set

func (*ChiHostReconcileAttributes) IsModify

func (s *ChiHostReconcileAttributes) IsModify() bool

IsModify checks whether 'modify' attribute is set

func (*ChiHostReconcileAttributes) IsRemove

func (s *ChiHostReconcileAttributes) IsRemove() bool

IsRemove checks whether 'remove' attribute is set

func (*ChiHostReconcileAttributes) IsUnclear

func (s *ChiHostReconcileAttributes) IsUnclear() bool

IsUnclear checks whether 'unclear' attribute is set

func (*ChiHostReconcileAttributes) SetAdd

SetAdd sets 'add' attribute

func (*ChiHostReconcileAttributes) SetModify

SetModify sets 'modify' attribute

func (*ChiHostReconcileAttributes) SetRemove

SetRemove sets 'remove' attribute

func (*ChiHostReconcileAttributes) SetStatus

SetStatus sets status

func (*ChiHostReconcileAttributes) SetUnclear

SetUnclear sets 'unclear' attribute

func (*ChiHostReconcileAttributes) UnsetAdd

UnsetAdd unsets 'add' attribute

type ChiHostTemplate

type ChiHostTemplate struct {
	Name             string                `json:"name,omitempty"             yaml:"name,omitempty"`
	PortDistribution []ChiPortDistribution `json:"portDistribution,omitempty" yaml:"portDistribution,omitempty"`
	Spec             ChiHost               `json:"spec,omitempty"             yaml:"spec,omitempty"`
}

ChiHostTemplate defines full Host Template

func (*ChiHostTemplate) DeepCopy

func (in *ChiHostTemplate) DeepCopy() *ChiHostTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiHostTemplate.

func (*ChiHostTemplate) DeepCopyInto

func (in *ChiHostTemplate) DeepCopyInto(out *ChiHostTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiObjectsCleanup

type ChiObjectsCleanup struct {
	StatefulSet string `json:"statefulSet,omitempty" yaml:"statefulSet,omitempty"`
	PVC         string `json:"pvc,omitempty"         yaml:"pvc,omitempty"`
	ConfigMap   string `json:"configMap,omitempty"   yaml:"configMap,omitempty"`
	Service     string `json:"service,omitempty"     yaml:"service,omitempty"`
}

ChiObjectsCleanup specifies object cleanup struct

func NewChiObjectsCleanup

func NewChiObjectsCleanup() *ChiObjectsCleanup

NewChiObjectsCleanup creates new object cleanup

func (*ChiObjectsCleanup) DeepCopy

func (in *ChiObjectsCleanup) DeepCopy() *ChiObjectsCleanup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiObjectsCleanup.

func (*ChiObjectsCleanup) DeepCopyInto

func (in *ChiObjectsCleanup) DeepCopyInto(out *ChiObjectsCleanup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiObjectsCleanup) GetConfigMap

func (c *ChiObjectsCleanup) GetConfigMap() string

GetConfigMap gets config map

func (*ChiObjectsCleanup) GetPVC

func (c *ChiObjectsCleanup) GetPVC() string

GetPVC gets PVC

func (*ChiObjectsCleanup) GetService

func (c *ChiObjectsCleanup) GetService() string

GetService gets service

func (*ChiObjectsCleanup) GetStatefulSet

func (c *ChiObjectsCleanup) GetStatefulSet() string

GetStatefulSet gets stateful set

func (*ChiObjectsCleanup) MergeFrom

func (c *ChiObjectsCleanup) MergeFrom(from *ChiObjectsCleanup, _type MergeType) *ChiObjectsCleanup

MergeFrom merges from specified cleanup

func (*ChiObjectsCleanup) SetConfigMap

func (c *ChiObjectsCleanup) SetConfigMap(v string) *ChiObjectsCleanup

SetConfigMap sets config map

func (*ChiObjectsCleanup) SetPVC

SetPVC sets PVC

func (*ChiObjectsCleanup) SetService

func (c *ChiObjectsCleanup) SetService(v string) *ChiObjectsCleanup

SetService sets service

func (*ChiObjectsCleanup) SetStatefulSet

func (c *ChiObjectsCleanup) SetStatefulSet(v string) *ChiObjectsCleanup

SetStatefulSet sets stateful set

type ChiPodDistribution

type ChiPodDistribution struct {
	Type        string `json:"type,omitempty"        yaml:"type,omitempty"`
	Scope       string `json:"scope,omitempty"       yaml:"scope,omitempty"`
	Number      int    `json:"number,omitempty"      yaml:"number,omitempty"`
	TopologyKey string `json:"topologyKey,omitempty" yaml:"topologyKey,omitempty"`
}

ChiPodDistribution defines pod distribution

func (*ChiPodDistribution) DeepCopy

func (in *ChiPodDistribution) DeepCopy() *ChiPodDistribution

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiPodDistribution.

func (*ChiPodDistribution) DeepCopyInto

func (in *ChiPodDistribution) DeepCopyInto(out *ChiPodDistribution)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiPodTemplate

type ChiPodTemplate struct {
	Name            string               `json:"name"                      yaml:"name"`
	GenerateName    string               `json:"generateName,omitempty"    yaml:"generateName,omitempty"`
	Zone            ChiPodTemplateZone   `json:"zone,omitempty"            yaml:"zone,omitempty"`
	PodDistribution []ChiPodDistribution `json:"podDistribution,omitempty" yaml:"podDistribution,omitempty"`
	ObjectMeta      metav1.ObjectMeta    `json:"metadata,omitempty"        yaml:"metadata,omitempty"`
	Spec            corev1.PodSpec       `json:"spec,omitempty"            yaml:"spec,omitempty"`
}

ChiPodTemplate defines full Pod Template, directly used by StatefulSet

func (*ChiPodTemplate) DeepCopy

func (in *ChiPodTemplate) DeepCopy() *ChiPodTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiPodTemplate.

func (*ChiPodTemplate) DeepCopyInto

func (in *ChiPodTemplate) DeepCopyInto(out *ChiPodTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiPodTemplateZone

type ChiPodTemplateZone struct {
	Key    string   `json:"key,omitempty"    yaml:"key,omitempty"`
	Values []string `json:"values,omitempty" yaml:"values,omitempty"`
}

ChiPodTemplateZone defines pod template zone

func (*ChiPodTemplateZone) DeepCopy

func (in *ChiPodTemplateZone) DeepCopy() *ChiPodTemplateZone

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiPodTemplateZone.

func (*ChiPodTemplateZone) DeepCopyInto

func (in *ChiPodTemplateZone) DeepCopyInto(out *ChiPodTemplateZone)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiPortDistribution

type ChiPortDistribution struct {
	Type string `json:"type,omitempty"   yaml:"type,omitempty"`
}

ChiPortDistribution defines port distribution

func (*ChiPortDistribution) DeepCopy

func (in *ChiPortDistribution) DeepCopy() *ChiPortDistribution

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiPortDistribution.

func (*ChiPortDistribution) DeepCopyInto

func (in *ChiPortDistribution) DeepCopyInto(out *ChiPortDistribution)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiReconciling

type ChiReconciling struct {
	// About to be DEPRECATED
	Policy string `json:"policy,omitempty" yaml:"policy,omitempty"`
	// ConfigMapPropagationTimeout specifies timeout for ConfigMap to propagate
	ConfigMapPropagationTimeout int `json:"configMapPropagationTimeout,omitempty" yaml:"configMapPropagationTimeout,omitempty"`
	// Cleanup specifies cleanup behavior
	Cleanup *ChiCleanup `json:"cleanup,omitempty" yaml:"cleanup,omitempty"`
}

ChiReconciling defines CHI reconciling struct

func NewChiReconciling

func NewChiReconciling() *ChiReconciling

NewChiReconciling creates new reconciling

func (*ChiReconciling) DeepCopy

func (in *ChiReconciling) DeepCopy() *ChiReconciling

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiReconciling.

func (*ChiReconciling) DeepCopyInto

func (in *ChiReconciling) DeepCopyInto(out *ChiReconciling)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiReconciling) GetCleanup

func (t *ChiReconciling) GetCleanup() *ChiCleanup

GetCleanup gets cleanup

func (*ChiReconciling) GetConfigMapPropagationTimeout

func (t *ChiReconciling) GetConfigMapPropagationTimeout() int

GetConfigMapPropagationTimeout gets config map propagation timeout

func (*ChiReconciling) GetConfigMapPropagationTimeoutDuration

func (t *ChiReconciling) GetConfigMapPropagationTimeoutDuration() time.Duration

GetConfigMapPropagationTimeoutDuration gets config map propagation timeout duration

func (*ChiReconciling) GetPolicy

func (t *ChiReconciling) GetPolicy() string

GetPolicy gets policy

func (*ChiReconciling) IsReconcilingPolicyNoWait

func (t *ChiReconciling) IsReconcilingPolicyNoWait() bool

IsReconcilingPolicyNoWait checks whether reconcile policy is "no wait"

func (*ChiReconciling) IsReconcilingPolicyWait

func (t *ChiReconciling) IsReconcilingPolicyWait() bool

IsReconcilingPolicyWait checks whether reconcile policy is "wait"

func (*ChiReconciling) MergeFrom

func (t *ChiReconciling) MergeFrom(from *ChiReconciling, _type MergeType) *ChiReconciling

MergeFrom merges from specified reconciling

func (*ChiReconciling) SetConfigMapPropagationTimeout

func (t *ChiReconciling) SetConfigMapPropagationTimeout(timeout int)

SetConfigMapPropagationTimeout sets config map propagation timeout

func (*ChiReconciling) SetDefaults

func (t *ChiReconciling) SetDefaults() *ChiReconciling

SetDefaults set default values for reconciling

func (*ChiReconciling) SetPolicy

func (t *ChiReconciling) SetPolicy(p string)

SetPolicy sets policy

type ChiReplica

type ChiReplica struct {
	Name        string            `json:"name,omitempty"        yaml:"name,omitempty"`
	Settings    *Settings         `json:"settings,omitempty"    yaml:"settings,omitempty"`
	Files       *Settings         `json:"files,omitempty"       yaml:"files,omitempty"`
	Templates   *ChiTemplateNames `json:"templates,omitempty"   yaml:"templates,omitempty"`
	ShardsCount int               `json:"shardsCount,omitempty" yaml:"shardsCount,omitempty"`
	// TODO refactor into map[string]ChiHost
	Hosts []*ChiHost `json:"shards,omitempty" yaml:"shards,omitempty"`

	Address ChiReplicaAddress       `json:"-" yaml:"-"`
	CHI     *ClickHouseInstallation `json:"-" yaml:"-" testdiff:"ignore"`
}

ChiReplica defines item of a replica section of .spec.configuration.clusters[n].replicas TODO unify with ChiShard based on HostsSet

func (*ChiReplica) DeepCopy

func (in *ChiReplica) DeepCopy() *ChiReplica

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiReplica.

func (*ChiReplica) DeepCopyInto

func (in *ChiReplica) DeepCopyInto(out *ChiReplica)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiReplica) GetServiceTemplate

func (replica *ChiReplica) GetServiceTemplate() (*ChiServiceTemplate, bool)

GetServiceTemplate gets service template

func (*ChiReplica) HostsCount

func (replica *ChiReplica) HostsCount() int

HostsCount returns number of hosts

func (*ChiReplica) InheritFilesFrom

func (replica *ChiReplica) InheritFilesFrom(cluster *ChiCluster)

InheritFilesFrom inherits files from specified cluster

func (*ChiReplica) InheritSettingsFrom

func (replica *ChiReplica) InheritSettingsFrom(cluster *ChiCluster)

InheritSettingsFrom inherits settings from specified cluster

func (*ChiReplica) InheritTemplatesFrom

func (replica *ChiReplica) InheritTemplatesFrom(cluster *ChiCluster)

InheritTemplatesFrom inherits templates from specified cluster

func (*ChiReplica) WalkHosts

func (replica *ChiReplica) WalkHosts(f func(host *ChiHost) error) []error

WalkHosts walks over hosts

type ChiReplicaAddress

type ChiReplicaAddress struct {
	Namespace    string `json:"namespace,omitempty"    yaml:"namespace,omitempty"`
	CHIName      string `json:"chiName,omitempty"      yaml:"chiName,omitempty"`
	ClusterName  string `json:"clusterName,omitempty"  yaml:"clusterName,omitempty"`
	ClusterIndex int    `json:"clusterIndex,omitempty" yaml:"clusterIndex,omitempty"`
	ReplicaName  string `json:"replicaName,omitempty"  yaml:"replicaName,omitempty"`
	ReplicaIndex int    `json:"replicaIndex,omitempty" yaml:"replicaIndex,omitempty"`
}

ChiReplicaAddress defines address of a replica within ClickHouseInstallation

func (*ChiReplicaAddress) DeepCopy

func (in *ChiReplicaAddress) DeepCopy() *ChiReplicaAddress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiReplicaAddress.

func (*ChiReplicaAddress) DeepCopyInto

func (in *ChiReplicaAddress) DeepCopyInto(out *ChiReplicaAddress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiServiceTemplate

type ChiServiceTemplate struct {
	Name         string             `json:"name"                   yaml:"name"`
	GenerateName string             `json:"generateName,omitempty" yaml:"generateName,omitempty"`
	ObjectMeta   metav1.ObjectMeta  `json:"metadata,omitempty"     yaml:"metadata,omitempty"`
	Spec         corev1.ServiceSpec `json:"spec,omitempty"         yaml:"spec,omitempty"`
}

ChiServiceTemplate defines CHI service template

func (*ChiServiceTemplate) DeepCopy

func (in *ChiServiceTemplate) DeepCopy() *ChiServiceTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiServiceTemplate.

func (*ChiServiceTemplate) DeepCopyInto

func (in *ChiServiceTemplate) DeepCopyInto(out *ChiServiceTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiShard

type ChiShard struct {
	Name                string            `json:"name,omitempty"                yaml:"name,omitempty"`
	Weight              int               `json:"weight,omitempty"              yaml:"weight,omitempty"`
	InternalReplication string            `json:"internalReplication,omitempty" yaml:"internalReplication,omitempty"`
	Settings            *Settings         `json:"settings,omitempty"            yaml:"settings,omitempty"`
	Files               *Settings         `json:"files,omitempty"               yaml:"files,omitempty"`
	Templates           *ChiTemplateNames `json:"templates,omitempty"           yaml:"templates,omitempty"`
	ReplicasCount       int               `json:"replicasCount,omitempty"       yaml:"replicasCount,omitempty"`
	// TODO refactor into map[string]ChiHost
	Hosts []*ChiHost `json:"replicas,omitempty" yaml:"replicas,omitempty"`

	Address ChiShardAddress         `json:"-" yaml:"-"`
	CHI     *ClickHouseInstallation `json:"-" yaml:"-" testdiff:"ignore"`

	// DefinitionType is DEPRECATED - to be removed soon
	DefinitionType string `json:"definitionType,omitempty" yaml:"definitionType,omitempty"`
}

ChiShard defines item of a shard section of .spec.configuration.clusters[n].shards TODO unify with ChiReplica based on HostsSet

func (*ChiShard) DeepCopy

func (in *ChiShard) DeepCopy() *ChiShard

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiShard.

func (*ChiShard) DeepCopyInto

func (in *ChiShard) DeepCopyInto(out *ChiShard)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiShard) GetCHI

func (shard *ChiShard) GetCHI() *ClickHouseInstallation

GetCHI gets CHI of the shard

func (*ChiShard) GetCluster

func (shard *ChiShard) GetCluster() *ChiCluster

GetCluster gets cluster of the shard

func (*ChiShard) GetServiceTemplate

func (shard *ChiShard) GetServiceTemplate() (*ChiServiceTemplate, bool)

GetServiceTemplate gets service template

func (*ChiShard) HostsCount

func (shard *ChiShard) HostsCount() int

HostsCount returns count of hosts in the shard

func (*ChiShard) InheritFilesFrom

func (shard *ChiShard) InheritFilesFrom(cluster *ChiCluster)

InheritFilesFrom inherits files from specified cluster

func (*ChiShard) InheritSettingsFrom

func (shard *ChiShard) InheritSettingsFrom(cluster *ChiCluster)

InheritSettingsFrom inherits settings from specified cluster

func (*ChiShard) InheritTemplatesFrom

func (shard *ChiShard) InheritTemplatesFrom(cluster *ChiCluster)

InheritTemplatesFrom inherits templates from specified cluster

func (*ChiShard) WalkHosts

func (shard *ChiShard) WalkHosts(f func(host *ChiHost) error) []error

WalkHosts runs specified function on each host

type ChiShardAddress

type ChiShardAddress struct {
	Namespace    string `json:"namespace,omitempty"    yaml:"namespace,omitempty"`
	CHIName      string `json:"chiName,omitempty"      yaml:"chiName,omitempty"`
	ClusterName  string `json:"clusterName,omitempty"  yaml:"clusterName,omitempty"`
	ClusterIndex int    `json:"clusterIndex,omitempty" yaml:"clusterIndex,omitempty"`
	ShardName    string `json:"shardName,omitempty"    yaml:"shardName,omitempty"`
	ShardIndex   int    `json:"shardIndex,omitempty"   yaml:"shardIndex,omitempty"`
}

ChiShardAddress defines address of a shard within ClickHouseInstallation

func (*ChiShardAddress) DeepCopy

func (in *ChiShardAddress) DeepCopy() *ChiShardAddress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiShardAddress.

func (*ChiShardAddress) DeepCopyInto

func (in *ChiShardAddress) DeepCopyInto(out *ChiShardAddress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiSpec

type ChiSpec struct {
	TaskID                 *string          `json:"taskID,omitempty"                 yaml:"taskID,omitempty"`
	Stop                   string           `json:"stop,omitempty"                   yaml:"stop,omitempty"`
	Restart                string           `json:"restart,omitempty"                yaml:"restart,omitempty"`
	Troubleshoot           string           `json:"troubleshoot,omitempty"           yaml:"troubleshoot,omitempty"`
	NamespaceDomainPattern string           `json:"namespaceDomainPattern,omitempty" yaml:"namespaceDomainPattern,omitempty"`
	Templating             *ChiTemplating   `json:"templating,omitempty"             yaml:"templating,omitempty"`
	Reconciling            *ChiReconciling  `json:"reconciling,omitempty"            yaml:"reconciling,omitempty"`
	Defaults               *ChiDefaults     `json:"defaults,omitempty"               yaml:"defaults,omitempty"`
	Configuration          *Configuration   `json:"configuration,omitempty"          yaml:"configuration,omitempty"`
	Templates              *ChiTemplates    `json:"templates,omitempty"              yaml:"templates,omitempty"`
	UseTemplates           []ChiUseTemplate `json:"useTemplates,omitempty"           yaml:"useTemplates,omitempty"`
}

ChiSpec defines spec section of ClickHouseInstallation resource

func (*ChiSpec) DeepCopy

func (in *ChiSpec) DeepCopy() *ChiSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiSpec.

func (*ChiSpec) DeepCopyInto

func (in *ChiSpec) DeepCopyInto(out *ChiSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiSpec) MergeFrom

func (spec *ChiSpec) MergeFrom(from *ChiSpec, _type MergeType)

MergeFrom merges from spec

type ChiStatus

type ChiStatus struct {
	CHOpVersion       string                  `json:"chop-version,omitempty"     yaml:"chop-version,omitempty"`
	CHOpCommit        string                  `json:"chop-commit,omitempty"      yaml:"chop-commit,omitempty"`
	CHOpDate          string                  `json:"chop-date,omitempty"        yaml:"chop-date,omitempty"`
	ClustersCount     int                     `json:"clusters"                   yaml:"clusters"`
	ShardsCount       int                     `json:"shards"                     yaml:"shards"`
	ReplicasCount     int                     `json:"replicas"                   yaml:"replicas"`
	HostsCount        int                     `json:"hosts"                      yaml:"hosts"`
	Status            string                  `json:"status"                     yaml:"status"`
	TaskID            string                  `json:"taskID,omitempty"           yaml:"taskID,omitempty"`
	TaskIDsStarted    []string                `json:"taskIDsStarted,omitempty"   yaml:"taskIDsStarted,omitempty"`
	TaskIDsCompleted  []string                `json:"taskIDsCompleted,omitempty" yaml:"taskIDsCompleted,omitempty"`
	Action            string                  `json:"action,omitempty"           yaml:"action,omitempty"`
	Actions           []string                `json:"actions,omitempty"          yaml:"actions,omitempty"`
	Error             string                  `json:"error,omitempty"            yaml:"error,omitempty"`
	Errors            []string                `json:"errors,omitempty"           yaml:"errors,omitempty"`
	UpdatedHostsCount int                     `json:"updated,omitempty"          yaml:"updated,omitempty"`
	AddedHostsCount   int                     `json:"added,omitempty"            yaml:"added,omitempty"`
	DeletedHostsCount int                     `json:"deleted,omitempty"          yaml:"deleted,omitempty"`
	DeleteHostsCount  int                     `json:"delete,omitempty"           yaml:"delete,omitempty"`
	Pods              []string                `json:"pods,omitempty"             yaml:"pods,omitempty"`
	FQDNs             []string                `json:"fqdns,omitempty"            yaml:"fqdns,omitempty"`
	Endpoint          string                  `json:"endpoint,omitempty"         yaml:"endpoint,omitempty"`
	Generation        int64                   `json:"generation,omitempty"       yaml:"generation,omitempty"`
	NormalizedCHI     *ClickHouseInstallation `json:"normalized,omitempty"       yaml:"normalized,omitempty"`
}

ChiStatus defines status section of ClickHouseInstallation resource

func (*ChiStatus) DeepCopy

func (in *ChiStatus) DeepCopy() *ChiStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiStatus.

func (*ChiStatus) DeepCopyInto

func (in *ChiStatus) DeepCopyInto(out *ChiStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiStatus) DeleteStart

func (s *ChiStatus) DeleteStart()

DeleteStart marks deletion start

func (*ChiStatus) PushAction

func (s *ChiStatus) PushAction(action string)

PushAction pushes action into status

func (*ChiStatus) PushTaskIDCompleted

func (s *ChiStatus) PushTaskIDCompleted()

PushTaskIDCompleted pushes task id into status

func (*ChiStatus) PushTaskIDStarted

func (s *ChiStatus) PushTaskIDStarted()

PushTaskIDStarted pushes task id into status

func (*ChiStatus) ReconcileComplete

func (s *ChiStatus) ReconcileComplete(chi *ClickHouseInstallation)

ReconcileComplete marks reconcile completion

func (*ChiStatus) ReconcileStart

func (s *ChiStatus) ReconcileStart(DeleteHostsCount int)

ReconcileStart marks reconcile start

func (*ChiStatus) SetAndPushError

func (s *ChiStatus) SetAndPushError(error string)

SetAndPushError sets and pushes error into status

type ChiTemplateNames

type ChiTemplateNames struct {
	HostTemplate            string `json:"hostTemplate,omitempty"            yaml:"hostTemplate,omitempty"`
	PodTemplate             string `json:"podTemplate,omitempty"             yaml:"podTemplate,omitempty"`
	DataVolumeClaimTemplate string `json:"dataVolumeClaimTemplate,omitempty" yaml:"dataVolumeClaimTemplate,omitempty"`
	LogVolumeClaimTemplate  string `json:"logVolumeClaimTemplate,omitempty"  yaml:"logVolumeClaimTemplate,omitempty"`
	ServiceTemplate         string `json:"serviceTemplate,omitempty"         yaml:"serviceTemplate,omitempty"`
	ClusterServiceTemplate  string `json:"clusterServiceTemplate,omitempty"  yaml:"clusterServiceTemplate,omitempty"`
	ShardServiceTemplate    string `json:"shardServiceTemplate,omitempty"    yaml:"shardServiceTemplate,omitempty"`
	ReplicaServiceTemplate  string `json:"replicaServiceTemplate,omitempty"  yaml:"replicaServiceTemplate,omitempty"`

	// VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate
	// !!! DEPRECATED !!!
	VolumeClaimTemplate string `json:"volumeClaimTemplate,omitempty"     yaml:"volumeClaimTemplate,omitempty"`
}

ChiTemplateNames defines references to .spec.templates to be used on current level of cluster

func NewChiTemplateNames

func NewChiTemplateNames() *ChiTemplateNames

NewChiTemplateNames creates new ChiTemplateNames object

func (*ChiTemplateNames) DeepCopy

func (in *ChiTemplateNames) DeepCopy() *ChiTemplateNames

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiTemplateNames.

func (*ChiTemplateNames) DeepCopyInto

func (in *ChiTemplateNames) DeepCopyInto(out *ChiTemplateNames)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiTemplateNames) GetClusterServiceTemplate

func (templateNames *ChiTemplateNames) GetClusterServiceTemplate() string

GetClusterServiceTemplate gets cluster service template

func (*ChiTemplateNames) GetDataVolumeClaimTemplate

func (templateNames *ChiTemplateNames) GetDataVolumeClaimTemplate() string

GetDataVolumeClaimTemplate gets data volume claim template

func (*ChiTemplateNames) GetHostTemplate

func (templateNames *ChiTemplateNames) GetHostTemplate() string

GetHostTemplate gets host template

func (*ChiTemplateNames) GetLogVolumeClaimTemplate

func (templateNames *ChiTemplateNames) GetLogVolumeClaimTemplate() string

GetLogVolumeClaimTemplate gets log volume claim template

func (*ChiTemplateNames) GetPodTemplate

func (templateNames *ChiTemplateNames) GetPodTemplate() string

GetPodTemplate gets pod template

func (*ChiTemplateNames) GetReplicaServiceTemplate

func (templateNames *ChiTemplateNames) GetReplicaServiceTemplate() string

GetReplicaServiceTemplate gets replica service template

func (*ChiTemplateNames) GetServiceTemplate

func (templateNames *ChiTemplateNames) GetServiceTemplate() string

GetServiceTemplate gets service template

func (*ChiTemplateNames) GetShardServiceTemplate

func (templateNames *ChiTemplateNames) GetShardServiceTemplate() string

GetShardServiceTemplate gets shard service template

func (*ChiTemplateNames) HandleDeprecatedFields

func (templateNames *ChiTemplateNames) HandleDeprecatedFields()

HandleDeprecatedFields helps to deal with deprecated fields

func (*ChiTemplateNames) HasClusterServiceTemplate

func (templateNames *ChiTemplateNames) HasClusterServiceTemplate() bool

HasClusterServiceTemplate checks whether cluster service template is specified

func (*ChiTemplateNames) HasDataVolumeClaimTemplate

func (templateNames *ChiTemplateNames) HasDataVolumeClaimTemplate() bool

HasDataVolumeClaimTemplate checks whether data volume claim template is specified

func (*ChiTemplateNames) HasHostTemplate

func (templateNames *ChiTemplateNames) HasHostTemplate() bool

HasHostTemplate checks whether host template is specified

func (*ChiTemplateNames) HasLogVolumeClaimTemplate

func (templateNames *ChiTemplateNames) HasLogVolumeClaimTemplate() bool

HasLogVolumeClaimTemplate checks whether log volume claim template is specified

func (*ChiTemplateNames) HasPodTemplate

func (templateNames *ChiTemplateNames) HasPodTemplate() bool

HasPodTemplate checks whether pod template is specified

func (*ChiTemplateNames) HasReplicaServiceTemplate

func (templateNames *ChiTemplateNames) HasReplicaServiceTemplate() bool

HasReplicaServiceTemplate checks whether replica service template is specified

func (*ChiTemplateNames) HasServiceTemplate

func (templateNames *ChiTemplateNames) HasServiceTemplate() bool

HasServiceTemplate checks whether service template is specified

func (*ChiTemplateNames) HasShardServiceTemplate

func (templateNames *ChiTemplateNames) HasShardServiceTemplate() bool

HasShardServiceTemplate checks whether shard service template is specified

func (*ChiTemplateNames) MergeFrom

func (templateNames *ChiTemplateNames) MergeFrom(from *ChiTemplateNames, _type MergeType) *ChiTemplateNames

MergeFrom merges from specified object

type ChiTemplates

type ChiTemplates struct {
	// Templates
	HostTemplates        []ChiHostTemplate        `json:"hostTemplates,omitempty"        yaml:"hostTemplates,omitempty"`
	PodTemplates         []ChiPodTemplate         `json:"podTemplates,omitempty"         yaml:"podTemplates,omitempty"`
	VolumeClaimTemplates []ChiVolumeClaimTemplate `json:"volumeClaimTemplates,omitempty" yaml:"volumeClaimTemplates,omitempty"`
	ServiceTemplates     []ChiServiceTemplate     `json:"serviceTemplates,omitempty"     yaml:"serviceTemplates,omitempty"`

	// Index maps template name to template itself
	HostTemplatesIndex        *HostTemplatesIndex        `json:",omitempty" yaml:",omitempty" testdiff:"ignore"`
	PodTemplatesIndex         *PodTemplatesIndex         `json:",omitempty" yaml:",omitempty" testdiff:"ignore"`
	VolumeClaimTemplatesIndex *VolumeClaimTemplatesIndex `json:",omitempty" yaml:",omitempty" testdiff:"ignore"`
	ServiceTemplatesIndex     *ServiceTemplatesIndex     `json:",omitempty" yaml:",omitempty" testdiff:"ignore"`
}

ChiTemplates defines templates section of .spec

func NewChiTemplates

func NewChiTemplates() *ChiTemplates

NewChiTemplates creates new ChiTemplate object

func (*ChiTemplates) DeepCopy

func (in *ChiTemplates) DeepCopy() *ChiTemplates

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiTemplates.

func (*ChiTemplates) DeepCopyInto

func (in *ChiTemplates) DeepCopyInto(out *ChiTemplates)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiTemplates) EnsureHostTemplatesIndex

func (templates *ChiTemplates) EnsureHostTemplatesIndex() *HostTemplatesIndex

EnsureHostTemplatesIndex ensures index exists

func (*ChiTemplates) EnsurePodTemplatesIndex

func (templates *ChiTemplates) EnsurePodTemplatesIndex() *PodTemplatesIndex

EnsurePodTemplatesIndex ensures index exists

func (*ChiTemplates) EnsureServiceTemplatesIndex

func (templates *ChiTemplates) EnsureServiceTemplatesIndex() *ServiceTemplatesIndex

EnsureServiceTemplatesIndex ensures index exists

func (*ChiTemplates) EnsureVolumeClaimTemplatesIndex

func (templates *ChiTemplates) EnsureVolumeClaimTemplatesIndex() *VolumeClaimTemplatesIndex

EnsureVolumeClaimTemplatesIndex ensures index exists

func (*ChiTemplates) GetHostTemplatesIndex

func (templates *ChiTemplates) GetHostTemplatesIndex() *HostTemplatesIndex

GetHostTemplatesIndex returns index of host templates

func (*ChiTemplates) GetPodTemplatesIndex

func (templates *ChiTemplates) GetPodTemplatesIndex() *PodTemplatesIndex

GetPodTemplatesIndex returns index of pod templates

func (*ChiTemplates) GetServiceTemplatesIndex

func (templates *ChiTemplates) GetServiceTemplatesIndex() *ServiceTemplatesIndex

GetServiceTemplatesIndex returns index of Service templates

func (*ChiTemplates) GetVolumeClaimTemplatesIndex

func (templates *ChiTemplates) GetVolumeClaimTemplatesIndex() *VolumeClaimTemplatesIndex

GetVolumeClaimTemplatesIndex returns index of VolumeClaim templates

func (*ChiTemplates) Len

func (templates *ChiTemplates) Len() int

Len returns accumulated len of all templates

func (*ChiTemplates) MergeFrom

func (templates *ChiTemplates) MergeFrom(from *ChiTemplates, _type MergeType) *ChiTemplates

MergeFrom merges from specified object

type ChiTemplating

type ChiTemplating struct {
	Policy string `json:"policy,omitempty" yaml:"policy,omitempty"`
}

ChiTemplating defines templating policy struct

func NewChiTemplating

func NewChiTemplating() *ChiTemplating

NewChiTemplating creates new templating

func (*ChiTemplating) DeepCopy

func (in *ChiTemplating) DeepCopy() *ChiTemplating

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiTemplating.

func (*ChiTemplating) DeepCopyInto

func (in *ChiTemplating) DeepCopyInto(out *ChiTemplating)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiTemplating) GetPolicy

func (t *ChiTemplating) GetPolicy() string

GetPolicy gets policy

func (*ChiTemplating) MergeFrom

func (t *ChiTemplating) MergeFrom(from *ChiTemplating, _type MergeType) *ChiTemplating

MergeFrom merges from specified templating

func (*ChiTemplating) SetPolicy

func (t *ChiTemplating) SetPolicy(p string)

SetPolicy sets policy

type ChiUseTemplate

type ChiUseTemplate struct {
	Name      string `json:"name,omitempty"      yaml:"name,omitempty"`
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	UseType   string `json:"useType,omitempty"   yaml:"useType,omitempty"`
}

ChiUseTemplate defines UseTemplate section of ClickHouseInstallation resource

func (*ChiUseTemplate) DeepCopy

func (in *ChiUseTemplate) DeepCopy() *ChiUseTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiUseTemplate.

func (*ChiUseTemplate) DeepCopyInto

func (in *ChiUseTemplate) DeepCopyInto(out *ChiUseTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiVolumeClaimTemplate

type ChiVolumeClaimTemplate struct {
	Name             string                           `json:"name"                    yaml:"name"`
	PVCReclaimPolicy PVCReclaimPolicy                 `json:"reclaimPolicy,omitempty" yaml:"reclaimPolicy,omitempty"`
	ObjectMeta       metav1.ObjectMeta                `json:"metadata,omitempty"      yaml:"metadata,omitempty"`
	Spec             corev1.PersistentVolumeClaimSpec `json:"spec,omitempty"          yaml:"spec,omitempty"`
}

ChiVolumeClaimTemplate defines PersistentVolumeClaim Template, directly used by StatefulSet

func (*ChiVolumeClaimTemplate) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiVolumeClaimTemplate.

func (*ChiVolumeClaimTemplate) DeepCopyInto

func (in *ChiVolumeClaimTemplate) DeepCopyInto(out *ChiVolumeClaimTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChiZookeeperConfig

type ChiZookeeperConfig struct {
	Nodes              []ChiZookeeperNode `json:"nodes,omitempty"                yaml:"nodes,omitempty"`
	SessionTimeoutMs   int                `json:"session_timeout_ms,omitempty"   yaml:"session_timeout_ms,omitempty"`
	OperationTimeoutMs int                `json:"operation_timeout_ms,omitempty" yaml:"operation_timeout_ms,omitempty"`
	Root               string             `json:"root,omitempty"                 yaml:"root,omitempty"`
	Identity           string             `json:"identity,omitempty"             yaml:"identity,omitempty"`
}

ChiZookeeperConfig defines zookeeper section of .spec.configuration Refers to https://clickhouse.yandex/docs/en/single/index.html?#server-settings_zookeeper

func NewChiZookeeperConfig

func NewChiZookeeperConfig() *ChiZookeeperConfig

NewChiZookeeperConfig creates new ChiZookeeperConfig object

func (*ChiZookeeperConfig) DeepCopy

func (in *ChiZookeeperConfig) DeepCopy() *ChiZookeeperConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiZookeeperConfig.

func (*ChiZookeeperConfig) DeepCopyInto

func (in *ChiZookeeperConfig) DeepCopyInto(out *ChiZookeeperConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiZookeeperConfig) IsEmpty

func (zkc *ChiZookeeperConfig) IsEmpty() bool

IsEmpty checks whether config is empty

func (*ChiZookeeperConfig) MergeFrom

func (zkc *ChiZookeeperConfig) MergeFrom(from *ChiZookeeperConfig, _type MergeType) *ChiZookeeperConfig

MergeFrom merges from provided object

type ChiZookeeperNode

type ChiZookeeperNode struct {
	Host string `json:"host,omitempty" yaml:"host,omitempty"`
	Port int32  `json:"port,omitempty" yaml:"port,omitempty"`
}

ChiZookeeperNode defines item of nodes section of .spec.configuration.zookeeper

func (*ChiZookeeperNode) DeepCopy

func (in *ChiZookeeperNode) DeepCopy() *ChiZookeeperNode

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiZookeeperNode.

func (*ChiZookeeperNode) DeepCopyInto

func (in *ChiZookeeperNode) DeepCopyInto(out *ChiZookeeperNode)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ChiZookeeperNode) Equal

func (zkNode *ChiZookeeperNode) Equal(to *ChiZookeeperNode) bool

Equal checks whether zookeepr node is equal to another

type ClickHouseInstallation

type ClickHouseInstallation struct {
	metav1.TypeMeta   `json:",inline"            yaml:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Spec              ChiSpec   `json:"spec"     yaml:"spec"`
	Status            ChiStatus `json:"status"   yaml:"status"`

	Attributes ComparableAttributes `json:"-" yaml:"-"`
}

ClickHouseInstallation defines the Installation of a ClickHouse Database Cluster

func (*ClickHouseInstallation) ClustersCount

func (chi *ClickHouseInstallation) ClustersCount() int

ClustersCount counts clusters

func (*ClickHouseInstallation) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClickHouseInstallation.

func (*ClickHouseInstallation) DeepCopyInto

func (in *ClickHouseInstallation) DeepCopyInto(out *ClickHouseInstallation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClickHouseInstallation) DeepCopyObject

func (in *ClickHouseInstallation) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ClickHouseInstallation) FillCHIPointer

func (chi *ClickHouseInstallation) FillCHIPointer()

FillCHIPointer fills CHI pointer

func (*ClickHouseInstallation) FillSelfCalculatedAddressInfo

func (chi *ClickHouseInstallation) FillSelfCalculatedAddressInfo()

FillSelfCalculatedAddressInfo calculates and fills address info

func (*ClickHouseInstallation) FillStatus

func (chi *ClickHouseInstallation) FillStatus(endpoint string, pods, fqdns []string, normalized bool)

FillStatus fills .Status

func (*ClickHouseInstallation) FindCluster

func (chi *ClickHouseInstallation) FindCluster(needle interface{}) *ChiCluster

FindCluster finds cluster by name or index

func (*ClickHouseInstallation) FindShard

func (chi *ClickHouseInstallation) FindShard(needleCluster interface{}, needleShard interface{}) *ChiShard

FindShard finds shard by name or index

func (*ClickHouseInstallation) GetCHIServiceTemplate

func (chi *ClickHouseInstallation) GetCHIServiceTemplate() (*ChiServiceTemplate, bool)

GetCHIServiceTemplate gets ChiServiceTemplate of a CHI

func (*ClickHouseInstallation) GetHostTemplate

func (chi *ClickHouseInstallation) GetHostTemplate(name string) (*ChiHostTemplate, bool)

GetHostTemplate gets ChiHostTemplate by name

func (*ClickHouseInstallation) GetPodTemplate

func (chi *ClickHouseInstallation) GetPodTemplate(name string) (*ChiPodTemplate, bool)

GetPodTemplate gets ChiPodTemplate by name

func (*ClickHouseInstallation) GetReconciling

func (chi *ClickHouseInstallation) GetReconciling() *ChiReconciling

GetReconciling gets reconciling spec

func (*ClickHouseInstallation) GetServiceTemplate

func (chi *ClickHouseInstallation) GetServiceTemplate(name string) (*ChiServiceTemplate, bool)

GetServiceTemplate gets ChiServiceTemplate by name

func (*ClickHouseInstallation) GetVolumeClaimTemplate

func (chi *ClickHouseInstallation) GetVolumeClaimTemplate(name string) (*ChiVolumeClaimTemplate, bool)

GetVolumeClaimTemplate gets ChiVolumeClaimTemplate by name

func (*ClickHouseInstallation) HostsCount

func (chi *ClickHouseInstallation) HostsCount() int

HostsCount counts hosts

func (*ClickHouseInstallation) HostsCountAttributes

func (chi *ClickHouseInstallation) HostsCountAttributes(a ChiHostReconcileAttributes) int

HostsCountAttributes counts hosts by attributes

func (*ClickHouseInstallation) IsAuto

func (chi *ClickHouseInstallation) IsAuto() bool

IsAuto checks whether templating policy is auto

func (*ClickHouseInstallation) IsNoRestartSpecified

func (chi *ClickHouseInstallation) IsNoRestartSpecified() bool

IsNoRestartSpecified checks whether CHI has no restart request

func (*ClickHouseInstallation) IsRollingUpdate

func (chi *ClickHouseInstallation) IsRollingUpdate() bool

IsRollingUpdate checks whether CHI should perform rolling update

func (*ClickHouseInstallation) IsStopped

func (chi *ClickHouseInstallation) IsStopped() bool

IsStopped checks whether CHI is stopped

func (*ClickHouseInstallation) IsTroubleshoot

func (chi *ClickHouseInstallation) IsTroubleshoot() bool

IsTroubleshoot checks whether CHI is in troubleshoot mode

func (*ClickHouseInstallation) MatchFullName

func (chi *ClickHouseInstallation) MatchFullName(namespace, name string) bool

MatchFullName matches full name

func (*ClickHouseInstallation) MergeFrom

func (chi *ClickHouseInstallation) MergeFrom(from *ClickHouseInstallation, _type MergeType)

MergeFrom merges from CHI

func (*ClickHouseInstallation) ShardsCount

func (chi *ClickHouseInstallation) ShardsCount() int

ShardsCount counts shards

func (*ClickHouseInstallation) WalkClusters

func (chi *ClickHouseInstallation) WalkClusters(f func(cluster *ChiCluster) error) []error

WalkClusters walks clusters

func (*ClickHouseInstallation) WalkClustersFullPath

func (chi *ClickHouseInstallation) WalkClustersFullPath(
	f func(chi *ClickHouseInstallation, clusterIndex int, cluster *ChiCluster) error,
) []error

WalkClustersFullPath walks clusters with full path

func (*ClickHouseInstallation) WalkHosts

func (chi *ClickHouseInstallation) WalkHosts(f func(host *ChiHost) error) []error

WalkHosts walks hosts

func (*ClickHouseInstallation) WalkHostsFullPath

func (chi *ClickHouseInstallation) WalkHostsFullPath(
	chiScopeCycleSize int,
	clusterScopeCycleSize int,
	f func(
		chi *ClickHouseInstallation,

		chiScopeIndex int,
		chiScopeCycleSize int,
		chiScopeCycleIndex int,
		chiScopeCycleOffset int,

		clusterScopeIndex int,
		clusterScopeCycleSize int,
		clusterScopeCycleIndex int,
		clusterScopeCycleOffset int,

		clusterIndex int,
		cluster *ChiCluster,

		shardIndex int,
		shard *ChiShard,

		replicaIndex int,
		replica *ChiReplica,

		host *ChiHost,
	) error,
) []error

WalkHostsFullPath walks hosts with full path

func (*ClickHouseInstallation) WalkHostsTillError

func (chi *ClickHouseInstallation) WalkHostsTillError(f func(host *ChiHost) error) error

WalkHostsTillError walks hosts until an error met

func (*ClickHouseInstallation) WalkPodTemplates

func (chi *ClickHouseInstallation) WalkPodTemplates(f func(template *ChiPodTemplate))

WalkPodTemplates walks over all PodTemplates

func (*ClickHouseInstallation) WalkShards

func (chi *ClickHouseInstallation) WalkShards(
	f func(
		shard *ChiShard,
	) error,
) []error

WalkShards walks shards

func (*ClickHouseInstallation) WalkShardsFullPath

func (chi *ClickHouseInstallation) WalkShardsFullPath(
	f func(
		chi *ClickHouseInstallation,
		clusterIndex int,
		cluster *ChiCluster,
		shardIndex int,
		shard *ChiShard,
	) error,
) []error

WalkShardsFullPath walks shards with full path

func (*ClickHouseInstallation) WalkTillError

func (chi *ClickHouseInstallation) WalkTillError(
	ctx context.Context,
	fCHIPreliminary func(ctx context.Context, chi *ClickHouseInstallation) error,
	fCluster func(ctx context.Context, cluster *ChiCluster) error,
	fShard func(ctx context.Context, shard *ChiShard) error,
	fHost func(ctx context.Context, host *ChiHost) error,
	fCHI func(ctx context.Context, chi *ClickHouseInstallation) error,
) error

WalkTillError walks until an error met

func (*ClickHouseInstallation) WalkVolumeClaimTemplates

func (chi *ClickHouseInstallation) WalkVolumeClaimTemplates(f func(template *ChiVolumeClaimTemplate))

WalkVolumeClaimTemplates walks over all VolumeClaimTemplates

type ClickHouseInstallationList

type ClickHouseInstallationList struct {
	metav1.TypeMeta `json:",inline"  yaml:",inline"`
	metav1.ListMeta `json:"metadata" yaml:"metadata"`
	Items           []ClickHouseInstallation `json:"items" yaml:"items"`
}

ClickHouseInstallationList defines a list of ClickHouseInstallation resources

func (*ClickHouseInstallationList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClickHouseInstallationList.

func (*ClickHouseInstallationList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClickHouseInstallationList) DeepCopyObject

func (in *ClickHouseInstallationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClickHouseInstallationTemplate

type ClickHouseInstallationTemplate ClickHouseInstallation

ClickHouseInstallationTemplate defines ClickHouseInstallation template

func (*ClickHouseInstallationTemplate) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClickHouseInstallationTemplate.

func (*ClickHouseInstallationTemplate) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClickHouseInstallationTemplate) DeepCopyObject

func (in *ClickHouseInstallationTemplate) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClickHouseInstallationTemplateList

type ClickHouseInstallationTemplateList struct {
	metav1.TypeMeta `json:",inline"  yaml:",inline"`
	metav1.ListMeta `json:"metadata" yaml:"metadata"`
	Items           []ClickHouseInstallationTemplate `json:"items" yaml:"items"`
}

ClickHouseInstallationTemplateList defines CHI template list

func (*ClickHouseInstallationTemplateList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClickHouseInstallationTemplateList.

func (*ClickHouseInstallationTemplateList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClickHouseInstallationTemplateList) DeepCopyObject

func (in *ClickHouseInstallationTemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClickHouseOperatorConfiguration

type ClickHouseOperatorConfiguration struct {
	metav1.TypeMeta   `json:",inline"               yaml:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"    yaml:"metadata,omitempty"`
	Spec              OperatorConfig `json:"spec"   yaml:"spec"`
	Status            string         `json:"status" yaml:"status"`
}

ClickHouseOperatorConfiguration defines CHOp config

func (*ClickHouseOperatorConfiguration) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClickHouseOperatorConfiguration.

func (*ClickHouseOperatorConfiguration) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClickHouseOperatorConfiguration) DeepCopyObject

func (in *ClickHouseOperatorConfiguration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClickHouseOperatorConfigurationList

type ClickHouseOperatorConfigurationList struct {
	metav1.TypeMeta `json:",inline"  yaml:",inline"`
	metav1.ListMeta `json:"metadata" yaml:"metadata"`
	Items           []ClickHouseOperatorConfiguration `json:"items" yaml:"items"`
}

ClickHouseOperatorConfigurationList defines CHI operator config list

func (*ClickHouseOperatorConfigurationList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClickHouseOperatorConfigurationList.

func (*ClickHouseOperatorConfigurationList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClickHouseOperatorConfigurationList) DeepCopyObject

func (in *ClickHouseOperatorConfigurationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ComparableAttributes

type ComparableAttributes struct {
	ExchangeEnv  []corev1.EnvVar `json:"-" yaml:"-"`
	SkipOwnerRef bool            `json:"-" yaml:"-"`
}

ComparableAttributes specifies CHI attributes that are comparable

func (*ComparableAttributes) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComparableAttributes.

func (*ComparableAttributes) DeepCopyInto

func (in *ComparableAttributes) DeepCopyInto(out *ComparableAttributes)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Configuration

type Configuration struct {
	Zookeeper *ChiZookeeperConfig `json:"zookeeper,omitempty" yaml:"zookeeper,omitempty"`
	Users     *Settings           `json:"users,omitempty"     yaml:"users,omitempty"`
	Profiles  *Settings           `json:"profiles,omitempty"  yaml:"profiles,omitempty"`
	Quotas    *Settings           `json:"quotas,omitempty"    yaml:"quotas,omitempty"`
	Settings  *Settings           `json:"settings,omitempty"  yaml:"settings,omitempty"`
	Files     *Settings           `json:"files,omitempty"     yaml:"files,omitempty"`
	// TODO refactor into map[string]ChiCluster
	Clusters []*ChiCluster `json:"clusters,omitempty"  yaml:"clusters,omitempty"`
}

Configuration defines configuration section of .spec

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration creates new Configuration objects

func (*Configuration) DeepCopy

func (in *Configuration) DeepCopy() *Configuration

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Configuration.

func (*Configuration) DeepCopyInto

func (in *Configuration) DeepCopyInto(out *Configuration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Configuration) MergeFrom

func (configuration *Configuration) MergeFrom(from *Configuration, _type MergeType) *Configuration

MergeFrom merges from specified source

type HostTemplatesIndex

type HostTemplatesIndex struct {
	// contains filtered or unexported fields
}

HostTemplatesIndex describes index of host templates

func NewHostTemplatesIndex

func NewHostTemplatesIndex() *HostTemplatesIndex

NewHostTemplatesIndex creates new HostTemplatesIndex object

func (*HostTemplatesIndex) DeepCopy

func (in *HostTemplatesIndex) DeepCopy() *HostTemplatesIndex

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostTemplatesIndex.

func (*HostTemplatesIndex) DeepCopyInto

func (in *HostTemplatesIndex) DeepCopyInto(out *HostTemplatesIndex)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HostTemplatesIndex) Get

Get returns entity `name` from the index

func (*HostTemplatesIndex) Has

func (i *HostTemplatesIndex) Has(name string) bool

Has checks whether index has entity `name`

func (*HostTemplatesIndex) Set

func (i *HostTemplatesIndex) Set(name string, entry *ChiHostTemplate)

Set sets named template into index

func (*HostTemplatesIndex) Walk

func (i *HostTemplatesIndex) Walk(f func(template *ChiHostTemplate))

Walk calls specified function over each items in the index

type HostsField

type HostsField struct {
	ShardsCount   int
	ReplicasCount int
	Field         [][]*ChiHost
}

HostsField specifies field of hosts

func NewHostsField

func NewHostsField(shards, replicas int) *HostsField

NewHostsField creates new field of hosts

func (*HostsField) DeepCopy

func (in *HostsField) DeepCopy() *HostsField

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostsField.

func (*HostsField) DeepCopyInto

func (in *HostsField) DeepCopyInto(out *HostsField)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HostsField) Get

func (hf *HostsField) Get(shard, replica int) *ChiHost

Get gets host from specified coordinates

func (*HostsField) GetOrCreate

func (hf *HostsField) GetOrCreate(shard, replica int) *ChiHost

GetOrCreate gets and creates if necessary

func (*HostsField) HostsCount

func (hf *HostsField) HostsCount() int

HostsCount returns hosts number

func (*HostsField) Set

func (hf *HostsField) Set(shard, replica int, host *ChiHost)

Set sets host on specified coordinates

func (*HostsField) WalkHosts

func (hf *HostsField) WalkHosts(f func(shard, replica int, host *ChiHost) error) []error

WalkHosts walks hosts with a function

type MergeType

type MergeType string

MergeType specifies merge types type

const (
	MergeTypeFillEmptyValues          MergeType = "fillempty"
	MergeTypeOverrideByNonEmptyValues MergeType = "override"
)

Possible merge types

type OperatorConfig

type OperatorConfig struct {
	Runtime struct {
		// Full path to the config file and folder where this OperatorConfig originates from
		ConfigFilePath   string
		ConfigFolderPath string
		// Namespace specifies namespace where operator runs
		Namespace string
	}
	Watch       OperatorConfigWatch      `json:"watch" yaml:"watch"`
	ClickHouse  OperatorConfigClickHouse `json:"clickhouse" yaml:"clickhouse"`
	Template    OperatorConfigTemplate   `json:"template" yaml:"template"`
	Reconcile   OperatorConfigReconcile  `json:"reconcile" yaml:"reconcile"`
	Annotation  OperatorConfigAnnotation `json:"annotation" yaml:"annotation"`
	Label       OperatorConfigLabel      `json:"label" yaml:"label"`
	StatefulSet struct {
		// Revision history limit
		RevisionHistoryLimit int `json:"revisionHistoryLimit" yaml:"revisionHistoryLimit"`
	} `json:"statefulSet" yaml:"statefulSet"`
	Pod struct {
		// Grace period for Pod termination.
		TerminationGracePeriod int `json:"terminationGracePeriod" yaml:"terminationGracePeriod"`
	} `json:"pod" yaml:"pod"`
	Logger struct {
		// Logger section
		LogToStderr     string `json:"logtostderr"      yaml:"logtostderr"`
		AlsoLogToStderr string `json:"alsologtostderr"  yaml:"alsologtostderr"`
		V               string `json:"v"                yaml:"v"`
		StderrThreshold string `json:"stderrthreshold"  yaml:"stderrthreshold"`
		VModule         string `json:"vmodule"          yaml:"vmodule"`
		LogBacktraceAt  string `json:"log_backtrace_at" yaml:"log_backtrace_at"`
	} `json:"logger" yaml:"logger"`

	// WatchNamespaces where operator watches for events
	WatchNamespaces []string `json:"watchNamespaces" yaml:"watchNamespaces"`
	// Paths where to look for additional ClickHouse config .xml files to be mounted into Pod
	CHCommonConfigsPath string `json:"chCommonConfigsPath" yaml:"chCommonConfigsPath"`
	CHHostConfigsPath   string `json:"chHostConfigsPath"   yaml:"chHostConfigsPath"`
	CHUsersConfigsPath  string `json:"chUsersConfigsPath"  yaml:"chUsersConfigsPath"`

	// Path where to look for ClickHouseInstallation templates .yaml files
	CHITemplatesPath string `json:"chiTemplatesPath" yaml:"chiTemplatesPath"`
	// Create/Update StatefulSet behavior - for how long to wait for StatefulSet to reach new Generation
	StatefulSetUpdateTimeout uint64 `json:"statefulSetUpdateTimeout" yaml:"statefulSetUpdateTimeout"`
	// Create/Update StatefulSet behavior - for how long to sleep while polling StatefulSet to reach new Generation
	StatefulSetUpdatePollPeriod uint64 `json:"statefulSetUpdatePollPeriod" yaml:"statefulSetUpdatePollPeriod"`

	// Rolling Create/Update behavior
	// StatefulSet create behavior - what to do in case StatefulSet can't reach new Generation
	OnStatefulSetCreateFailureAction string `json:"onStatefulSetCreateFailureAction" yaml:"onStatefulSetCreateFailureAction"`
	// StatefulSet update behavior - what to do in case StatefulSet can't reach new Generation
	OnStatefulSetUpdateFailureAction string `json:"onStatefulSetUpdateFailureAction" yaml:"onStatefulSetUpdateFailureAction"`

	// Default values for ClickHouse user configuration
	// 1. user/profile - string
	// 2. user/quota - string
	// 3. user/networks/ip - multiple strings
	// 4. user/password - string
	CHConfigUserDefaultProfile    string   `json:"chConfigUserDefaultProfile"    yaml:"chConfigUserDefaultProfile"`
	CHConfigUserDefaultQuota      string   `json:"chConfigUserDefaultQuota"      yaml:"chConfigUserDefaultQuota"`
	CHConfigUserDefaultNetworksIP []string `json:"chConfigUserDefaultNetworksIP" yaml:"chConfigUserDefaultNetworksIP"`
	CHConfigUserDefaultPassword   string   `json:"chConfigUserDefaultPassword"   yaml:"chConfigUserDefaultPassword"`

	CHConfigNetworksHostRegexpTemplate string `json:"chConfigNetworksHostRegexpTemplate" yaml:"chConfigNetworksHostRegexpTemplate"`

	// Username and Password to be used by operator to connect to ClickHouse instances
	// for
	// 1. Metrics requests
	// 2. Schema maintenance
	// User credentials can be specified in additional ClickHouse config files located in `chUsersConfigsPath` folder
	CHScheme   string `json:"chScheme" yaml:"chScheme"`
	CHUsername string `json:"chUsername" yaml:"chUsername"`
	CHPassword string `json:"chPassword" yaml:"chPassword"`
	// Location of k8s Secret with username and password to be used by operator to connect to ClickHouse instances
	// Can be used instead of explicitly specified username and password
	CHCredentialsSecretNamespace string `json:"chCredentialsSecretNamespace" yaml:"chCredentialsSecretNamespace"`
	CHCredentialsSecretName      string `json:"chCredentialsSecretName"      yaml:"chCredentialsSecretName"`

	// Port where to connect to ClickHouse instances to
	CHPort int `json:"chPort"     yaml:"chPort"`

	// Logger section
	LogToStderr     string `json:"logtostderr"      yaml:"logtostderr"`
	AlsoLogToStderr string `json:"alsologtostderr"  yaml:"alsologtostderr"`
	V               string `json:"v"                yaml:"v"`
	StderrThreshold string `json:"stderrthreshold"  yaml:"stderrthreshold"`
	VModule         string `json:"vmodule"          yaml:"vmodule"`
	LogBacktraceAt  string `json:"log_backtrace_at" yaml:"log_backtrace_at"`
	// Max number of concurrent reconciles in progress
	ReconcileThreadsNumber int  `json:"reconcileThreadsNumber" yaml:"reconcileThreadsNumber"`
	ReconcileWaitExclude   bool `json:"reconcileWaitExclude"   yaml:"reconcileWaitExclude"`
	ReconcileWaitInclude   bool `json:"reconcileWaitInclude"   yaml:"reconcileWaitInclude"`

	// When transferring annotations from the chi/chit.metadata to CHI objects, use these filters.
	IncludeIntoPropagationAnnotations []string `json:"includeIntoPropagationAnnotations" yaml:"includeIntoPropagationAnnotations"`
	ExcludeFromPropagationAnnotations []string `json:"excludeFromPropagationAnnotations" yaml:"excludeFromPropagationAnnotations"`

	// When transferring labels from the chi/chit.metadata to child objects, use these filters.
	IncludeIntoPropagationLabels []string `json:"includeIntoPropagationLabels" yaml:"includeIntoPropagationLabels"`
	ExcludeFromPropagationLabels []string `json:"excludeFromPropagationLabels" yaml:"excludeFromPropagationLabels"`

	// Whether to append *Scope* labels to StatefulSet and Pod.
	AppendScopeLabelsString string `json:"appendScopeLabels" yaml:"appendScopeLabels"`

	// Grace period for Pod termination.
	TerminationGracePeriod int `json:"terminationGracePeriod" yaml:"terminationGracePeriod"`
	// Revision history limit
	RevisionHistoryLimit int `json:"revisionHistoryLimit" yaml:"revisionHistoryLimit"`
}

OperatorConfig specifies operator config

func (*OperatorConfig) AddCHITemplate

func (c *OperatorConfig) AddCHITemplate(template *ClickHouseInstallation)

AddCHITemplate adds CHI template

func (*OperatorConfig) DeepCopy

func (in *OperatorConfig) DeepCopy() *OperatorConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfig.

func (*OperatorConfig) DeepCopyInto

func (in *OperatorConfig) DeepCopyInto(out *OperatorConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*OperatorConfig) DeleteCHITemplate

func (c *OperatorConfig) DeleteCHITemplate(template *ClickHouseInstallation)

DeleteCHITemplate deletes CHI template

func (*OperatorConfig) FindTemplate

func (c *OperatorConfig) FindTemplate(use *ChiUseTemplate, namespace string) *ClickHouseInstallation

FindTemplate finds specified template

func (*OperatorConfig) GetAutoTemplates

func (c *OperatorConfig) GetAutoTemplates() []*ClickHouseInstallation

GetAutoTemplates gets all auto templates. Auto templates are sorted alphabetically by tuple: namespace, name

func (*OperatorConfig) GetInformerNamespace

func (c *OperatorConfig) GetInformerNamespace() string

GetInformerNamespace is a TODO stub Namespace where informers would watch notifications from The thing is that InformerFactory can accept only one parameter as watched namespace, be it explicitly specified namespace or empty line for "all namespaces". That's what conflicts with CHOp's approach to 'specify list of namespaces to watch in', having slice of namespaces (CHOp's approach) incompatible with "one namespace name" approach TODO unify with IsWatchedNamespace TODO unify approaches to multiple namespaces support

func (*OperatorConfig) GetLogLevel

func (c *OperatorConfig) GetLogLevel() (log.Level, error)

GetLogLevel gets logger level

func (*OperatorConfig) GetRevisionHistoryLimit

func (c *OperatorConfig) GetRevisionHistoryLimit() *int32

GetRevisionHistoryLimit gets pointer to revisionHistoryLimit, as expected by statefulSet.Spec.Template.Spec.RevisionHistoryLimit

func (*OperatorConfig) GetTerminationGracePeriod

func (c *OperatorConfig) GetTerminationGracePeriod() *int64

GetTerminationGracePeriod gets pointer to terminationGracePeriod, as expected by statefulSet.Spec.Template.Spec.TerminationGracePeriodSeconds

func (*OperatorConfig) IsWatchedNamespace

func (c *OperatorConfig) IsWatchedNamespace(namespace string) bool

IsWatchedNamespace returns whether specified namespace is in a list of watched TODO unify with GetInformerNamespace

func (*OperatorConfig) MergeFrom

func (c *OperatorConfig) MergeFrom(from *OperatorConfig, _type MergeType) error

MergeFrom merges

func (*OperatorConfig) Postprocess

func (c *OperatorConfig) Postprocess()

Postprocess runs all postprocessors

func (*OperatorConfig) String

func (c *OperatorConfig) String(hideCredentials bool) string

String returns string representation of a OperatorConfig

func (*OperatorConfig) UpdateCHITemplate

func (c *OperatorConfig) UpdateCHITemplate(template *ClickHouseInstallation)

UpdateCHITemplate updates CHI template

type OperatorConfigAnnotation

type OperatorConfigAnnotation struct {
	// When transferring annotations from the chi/chit.metadata to CHI objects, use these filters.
	Include []string `json:"include" yaml:"include"`
	Exclude []string `json:"exclude" yaml:"exclude"`
}

OperatorConfigAnnotation specifies annotation section

func (*OperatorConfigAnnotation) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigAnnotation.

func (*OperatorConfigAnnotation) DeepCopyInto

func (in *OperatorConfigAnnotation) DeepCopyInto(out *OperatorConfigAnnotation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigCHI

type OperatorConfigCHI struct {
	// Path where to look for ClickHouseInstallation templates .yaml files
	Path string `json:"path" yaml:"path"`

	Runtime OperatorConfigCHIRuntime
}

OperatorConfigCHI specifies template CHI section

func (*OperatorConfigCHI) DeepCopy

func (in *OperatorConfigCHI) DeepCopy() *OperatorConfigCHI

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigCHI.

func (*OperatorConfigCHI) DeepCopyInto

func (in *OperatorConfigCHI) DeepCopyInto(out *OperatorConfigCHI)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigCHIRuntime

type OperatorConfigCHIRuntime struct {
	// CHI template files fetched from the path specified above. Maps "file name->file content"
	TemplateFiles map[string]string
	// CHI template objects unmarshalled from CHITemplateFiles. Maps "metadata.name->object"
	Templates []*ClickHouseInstallation `json:"-" yaml:"-"`
	// ClickHouseInstallation template
	Template *ClickHouseInstallation `json:"-" yaml:"-"`
}

OperatorConfigCHIRuntime specifies chi runtime section

func (*OperatorConfigCHIRuntime) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigCHIRuntime.

func (*OperatorConfigCHIRuntime) DeepCopyInto

func (in *OperatorConfigCHIRuntime) DeepCopyInto(out *OperatorConfigCHIRuntime)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigClickHouse

type OperatorConfigClickHouse struct {
	Config OperatorConfigConfig `json:"configuration" yaml:"configuration"`

	Access struct {
		// Username and Password to be used by operator to connect to ClickHouse instances
		// for
		// 1. Metrics requests
		// 2. Schema maintenance
		// User credentials can be specified in additional ClickHouse config files located in `chUsersConfigsPath` folder
		Scheme   string `json:"scheme" yaml:"scheme"`
		Username string `json:"username" yaml:"username"`
		Password string `json:"password" yaml:"password"`

		// Location of k8s Secret with username and password to be used by the operator to connect to ClickHouse instances
		// Can be used instead of explicitly specified (above) username and password
		Secret struct {
			Namespace string `json:"namespace" yaml:"namespace"`
			Name      string `json:"name"      yaml:"name"`

			Runtime struct {
				// Username and Password to be used by operator to connect to ClickHouse instances
				// extracted from k8s secret specified above.
				Username string
				Password string
			}
		} `json:"secret" yaml:"secret"`

		// Port where to connect to ClickHouse instances to
		Port int `json:"port" yaml:"port"`
	} `json:"access" yaml:"access"`
}

OperatorConfigClickHouse specifies ClickHouse section

func (*OperatorConfigClickHouse) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigClickHouse.

func (*OperatorConfigClickHouse) DeepCopyInto

func (in *OperatorConfigClickHouse) DeepCopyInto(out *OperatorConfigClickHouse)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigConfig

type OperatorConfigConfig struct {
	File OperatorConfigFile `json:"file" yaml:"file"`

	User OperatorConfigUser `json:"user" yaml:"user"`

	Network struct {
		HostRegexpTemplate string `json:"hostRegexpTemplate" yaml:"hostRegexpTemplate"`
	} `json:"network" yaml:"network"`
}

OperatorConfigConfig specifies Config section

func (*OperatorConfigConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigConfig.

func (*OperatorConfigConfig) DeepCopyInto

func (in *OperatorConfigConfig) DeepCopyInto(out *OperatorConfigConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigDefault

type OperatorConfigDefault struct {
	// Default values for ClickHouse user configuration
	// 1. user/profile - string
	// 2. user/quota - string
	// 3. user/networks/ip - multiple strings
	// 4. user/password - string
	Profile    string   `json:"profile"   yaml:"profile"`
	Quota      string   `json:"quota"     yaml:"quota"`
	NetworksIP []string `json:"networksIP" yaml:"networksIP"`
	Password   string   `json:"password"  yaml:"password"`
}

OperatorConfigDefault specifies user-default section

func (*OperatorConfigDefault) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigDefault.

func (*OperatorConfigDefault) DeepCopyInto

func (in *OperatorConfigDefault) DeepCopyInto(out *OperatorConfigDefault)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigFile

type OperatorConfigFile struct {
	Path struct {
		// Paths where to look for additional ClickHouse config .xml files to be mounted into Pod
		Common string `json:"common" yaml:"common"`
		Host   string `json:"host"   yaml:"host"`
		User   string `json:"user"   yaml:"user"`
	} `json:"path" yaml:"path"`

	Runtime OperatorConfigFileRuntime
}

OperatorConfigFile specifies File section

func (*OperatorConfigFile) DeepCopy

func (in *OperatorConfigFile) DeepCopy() *OperatorConfigFile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigFile.

func (*OperatorConfigFile) DeepCopyInto

func (in *OperatorConfigFile) DeepCopyInto(out *OperatorConfigFile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigFileRuntime

type OperatorConfigFileRuntime struct {
	// OperatorConfig files fetched from paths specified above. Maps "file name->file content"
	CommonConfigFiles map[string]string
	HostConfigFiles   map[string]string
	UsersConfigFiles  map[string]string
}

OperatorConfigFileRuntime specifies runtime section

func (*OperatorConfigFileRuntime) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigFileRuntime.

func (*OperatorConfigFileRuntime) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigLabel

type OperatorConfigLabel struct {
	// When transferring labels from the chi/chit.metadata to child objects, use these filters.
	Include []string `json:"include" yaml:"include"`
	Exclude []string `json:"exclude" yaml:"exclude"`

	// Whether to append *Scope* labels to StatefulSet and Pod.
	AppendScopeString string `json:"appendScope" yaml:"appendScope"`

	Runtime struct {
		AppendScope bool
	}
}

OperatorConfigLabel specifies label section

func (*OperatorConfigLabel) DeepCopy

func (in *OperatorConfigLabel) DeepCopy() *OperatorConfigLabel

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigLabel.

func (*OperatorConfigLabel) DeepCopyInto

func (in *OperatorConfigLabel) DeepCopyInto(out *OperatorConfigLabel)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigReconcile

type OperatorConfigReconcile struct {
	Runtime struct {
		ThreadsNumber int `json:"threadsNumber" yaml:"threadsNumber"`
	} `json:"runtime" yaml:"runtime"`

	StatefulSet struct {
		Create struct {
			OnFailure string `json:"onFailure" yaml:"onFailure"`
		} `json:"create" yaml:"create"`

		Update struct {
			Timeout      uint64 `json:"timeout" yaml:"timeout"`
			PollInterval uint64 `json:"pollInterval" yaml:"pollInterval"`
			OnFailure    string `json:"onFailure" yaml:"onFailure"`
		} `json:"update" yaml:"update"`
	} `json:"statefulSet" yaml:"statefulSet"`

	Host struct {
		Wait struct {
			Exclude bool `json:"exclude" yaml:"exclude"`
			Include bool `json:"include" yaml:"include"`
		} `json:"host" yaml:"host"`
	} `json:"host" yaml:"host"`
}

OperatorConfigReconcile specifies reconcile section

func (*OperatorConfigReconcile) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigReconcile.

func (*OperatorConfigReconcile) DeepCopyInto

func (in *OperatorConfigReconcile) DeepCopyInto(out *OperatorConfigReconcile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigTemplate

type OperatorConfigTemplate struct {
	CHI OperatorConfigCHI `json:"chi" yaml:"chi"`
}

OperatorConfigTemplate specifies template section

func (*OperatorConfigTemplate) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigTemplate.

func (*OperatorConfigTemplate) DeepCopyInto

func (in *OperatorConfigTemplate) DeepCopyInto(out *OperatorConfigTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigUser

type OperatorConfigUser struct {
	Default OperatorConfigDefault `json:"default" yaml:"default"`
}

OperatorConfigUser specifies User section

func (*OperatorConfigUser) DeepCopy

func (in *OperatorConfigUser) DeepCopy() *OperatorConfigUser

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigUser.

func (*OperatorConfigUser) DeepCopyInto

func (in *OperatorConfigUser) DeepCopyInto(out *OperatorConfigUser)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperatorConfigWatch

type OperatorConfigWatch struct {
	// Namespaces where operator watches for events
	Namespaces []string `json:"namespaces" yaml:"namespaces"`
}

OperatorConfigWatch specifies watch section

func (*OperatorConfigWatch) DeepCopy

func (in *OperatorConfigWatch) DeepCopy() *OperatorConfigWatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConfigWatch.

func (*OperatorConfigWatch) DeepCopyInto

func (in *OperatorConfigWatch) DeepCopyInto(out *OperatorConfigWatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PVCReclaimPolicy

type PVCReclaimPolicy string

PVCReclaimPolicy defines PVC reclaim policy

const (
	PVCReclaimPolicyRetain PVCReclaimPolicy = "Retain"
	PVCReclaimPolicyDelete PVCReclaimPolicy = "Delete"
)

Possible values of PVC reclaim policy

func NewPVCReclaimPolicyFromString

func NewPVCReclaimPolicyFromString(s string) PVCReclaimPolicy

NewPVCReclaimPolicyFromString creates new PVCReclaimPolicy from string

func (PVCReclaimPolicy) IsValid

func (v PVCReclaimPolicy) IsValid() bool

IsValid checks whether PVCReclaimPolicy is valid

func (PVCReclaimPolicy) String

func (v PVCReclaimPolicy) String() string

String returns string value for PVCReclaimPolicy

type PodTemplatesIndex

type PodTemplatesIndex struct {
	// contains filtered or unexported fields
}

PodTemplatesIndex describes index of pod templates

func NewPodTemplatesIndex

func NewPodTemplatesIndex() *PodTemplatesIndex

NewPodTemplatesIndex creates new PodTemplatesIndex object

func (*PodTemplatesIndex) DeepCopy

func (in *PodTemplatesIndex) DeepCopy() *PodTemplatesIndex

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTemplatesIndex.

func (*PodTemplatesIndex) DeepCopyInto

func (in *PodTemplatesIndex) DeepCopyInto(out *PodTemplatesIndex)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodTemplatesIndex) Get

func (i *PodTemplatesIndex) Get(name string) *ChiPodTemplate

Get returns entity `name` from the index

func (*PodTemplatesIndex) Has

func (i *PodTemplatesIndex) Has(name string) bool

Has checks whether index has entity `name`

func (*PodTemplatesIndex) Set

func (i *PodTemplatesIndex) Set(name string, entry *ChiPodTemplate)

Set sets named template into index

func (*PodTemplatesIndex) Walk

func (i *PodTemplatesIndex) Walk(f func(template *ChiPodTemplate))

Walk calls specified function over each items in the index

type ServiceTemplatesIndex

type ServiceTemplatesIndex struct {
	// contains filtered or unexported fields
}

ServiceTemplatesIndex describes index of service templates

func NewServiceTemplatesIndex

func NewServiceTemplatesIndex() *ServiceTemplatesIndex

NewServiceTemplatesIndex creates new ServiceTemplatesIndex object

func (*ServiceTemplatesIndex) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplatesIndex.

func (*ServiceTemplatesIndex) DeepCopyInto

func (in *ServiceTemplatesIndex) DeepCopyInto(out *ServiceTemplatesIndex)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceTemplatesIndex) Get

Get returns entity `name` from the index

func (*ServiceTemplatesIndex) Has

func (i *ServiceTemplatesIndex) Has(name string) bool

Has checks whether index has entity `name`

func (*ServiceTemplatesIndex) Set

func (i *ServiceTemplatesIndex) Set(name string, entry *ChiServiceTemplate)

Set sets named template into index

func (*ServiceTemplatesIndex) Walk

func (i *ServiceTemplatesIndex) Walk(f func(template *ChiServiceTemplate))

Walk calls specified function over each items in the index

type Setting

type Setting struct {
	// contains filtered or unexported fields
}

Setting represents one settings, which can be either a sting or a vector of strings

func NewSettingScalar

func NewSettingScalar(scalar string) *Setting

NewSettingScalar makes new scalar Setting

func NewSettingVector

func NewSettingVector(vector []string) *Setting

NewSettingVector makes new vector Setting

func (*Setting) AsVector

func (s *Setting) AsVector() []string

AsVector gets value of a setting as vector. Scalar value is casted to vector

func (*Setting) Attributes

func (s *Setting) Attributes() string

Attributes returns string form of attributes - used to config tag creation

func (*Setting) DeepCopy

func (in *Setting) DeepCopy() *Setting

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Setting.

func (*Setting) DeepCopyInto

func (in *Setting) DeepCopyInto(out *Setting)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Setting) HasAttributes

func (s *Setting) HasAttributes() bool

HasAttributes checks whether setting has attributes

func (*Setting) IsScalar

func (s *Setting) IsScalar() bool

IsScalar checks whether setting is a scalar value

func (*Setting) IsVector

func (s *Setting) IsVector() bool

IsVector checks whether setting is a vector value

func (*Setting) Scalar

func (s *Setting) Scalar() string

Scalar gets scalar value of a setting

func (*Setting) SetAttribute

func (s *Setting) SetAttribute(name, value string) *Setting

SetAttribute sets attribute of the setting

func (*Setting) String

func (s *Setting) String() string

String gets string value of a setting. Vector is combined into one string

func (*Setting) Vector

func (s *Setting) Vector() []string

Vector gets vector values of a setting

type Settings

type Settings struct {
	M map[string]*Setting
}

Settings specifies settings

func NewSettings

func NewSettings() *Settings

NewSettings creates new settings

func (*Settings) AsSortedSliceOfStrings

func (settings *Settings) AsSortedSliceOfStrings() []string

AsSortedSliceOfStrings return settings as sorted strings

func (*Settings) DeepCopy

func (in *Settings) DeepCopy() *Settings

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Settings.

func (*Settings) DeepCopyInto

func (in *Settings) DeepCopyInto(out *Settings)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Settings) Delete

func (settings *Settings) Delete(name string)

Delete deletes named setting

func (*Settings) Filter

func (settings *Settings) Filter(
	includeSections []SettingsSection,
	excludeSections []SettingsSection,
	includeUnspecified bool,
) *Settings

Filter filters settings according to include and exclude lists

func (*Settings) Get

func (settings *Settings) Get(name string) *Setting

Get gets named setting

func (*Settings) GetHTTPPort

func (settings *Settings) GetHTTPPort() int32

GetHTTPPort gets HTTP port from settings

func (*Settings) GetInterserverHTTPPort

func (settings *Settings) GetInterserverHTTPPort() int32

GetInterserverHTTPPort gets interserver HTTP port from settings

func (*Settings) GetSectionStringMap

func (settings *Settings) GetSectionStringMap(section SettingsSection, includeUnspecified bool) map[string]string

GetSectionStringMap returns map of settings sections

func (*Settings) GetTCPPort

func (settings *Settings) GetTCPPort() int32

GetTCPPort gets TCP port from settings

func (*Settings) Has

func (settings *Settings) Has(name string) bool

Has checks whether named setting exists

func (*Settings) IsZero

func (settings *Settings) IsZero() bool

IsZero checks whether settings is zero

func (*Settings) Len

func (settings *Settings) Len() int

Len gets length of the settings

func (*Settings) MarshalJSON

func (settings *Settings) MarshalJSON() ([]byte, error)

MarshalJSON marshals JSON

func (*Settings) MergeFrom

func (settings *Settings) MergeFrom(src *Settings) *Settings

MergeFrom merges into `dst` non-empty new-key-values from `src` in case no such `key` already in `src`

func (*Settings) MergeFromCB

func (settings *Settings) MergeFromCB(src *Settings, filter func(path string, setting *Setting) bool) *Settings

MergeFromCB merges settings from src approved by filtering callback function

func (*Settings) Normalize

func (settings *Settings) Normalize()

Normalize normalizes settings

func (*Settings) Set

func (settings *Settings) Set(name string, setting *Setting)

Set sets named setting

func (*Settings) SetIfNotExists

func (settings *Settings) SetIfNotExists(name string, setting *Setting)

SetIfNotExists sets named setting

func (*Settings) UnmarshalJSON

func (settings *Settings) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshal JSON

func (*Settings) Walk

func (settings *Settings) Walk(f func(name string, setting *Setting))

Walk walks over settings

type SettingsSection

type SettingsSection string

SettingsSection specifies settings section

var (
	SectionEmpty  SettingsSection = ""
	SectionCommon SettingsSection = "COMMON"
	SectionUsers  SettingsSection = "USERS"
	SectionHost   SettingsSection = "HOST"
)

Configuration sections Each section translates into separate ConfigMap mapped into Pod

type StatefulSetStatus

type StatefulSetStatus string

StatefulSetStatus specifies StatefulSet status

const (
	StatefulSetStatusModified StatefulSetStatus = "modified"
	StatefulSetStatusNew      StatefulSetStatus = "new"
	StatefulSetStatusSame     StatefulSetStatus = "same"
	StatefulSetStatusUnknown  StatefulSetStatus = "unknown"
)

Possible values for StatefulSet status

type VolumeClaimTemplatesIndex

type VolumeClaimTemplatesIndex struct {
	// contains filtered or unexported fields
}

VolumeClaimTemplatesIndex describes index of volume claim templates

func NewVolumeClaimTemplatesIndex

func NewVolumeClaimTemplatesIndex() *VolumeClaimTemplatesIndex

NewVolumeClaimTemplatesIndex creates new VolumeClaimTemplatesIndex object

func (*VolumeClaimTemplatesIndex) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeClaimTemplatesIndex.

func (*VolumeClaimTemplatesIndex) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VolumeClaimTemplatesIndex) Get

Get returns entity `name` from the index

func (*VolumeClaimTemplatesIndex) Has

func (i *VolumeClaimTemplatesIndex) Has(name string) bool

Has checks whether index has entity `name`

func (*VolumeClaimTemplatesIndex) Set

Set sets named template into index

func (*VolumeClaimTemplatesIndex) Walk

func (i *VolumeClaimTemplatesIndex) Walk(f func(template *ChiVolumeClaimTemplate))

Walk calls specified function over each items in the index

Jump to

Keyboard shortcuts

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