helmsdeep/config/clickhouse/operator.yaml
vilorij 07132eea39
Improove (#193)
* add epic branch with java services

* Introduce analytics (#166)

* Introduce questionary (#175)

* Introduce questionary

* actualize questionary

* actualize questionary

* Introduce claim-management (#173)

* Introduce questionary-aggr-proxy (#176)

* management.endpoint.prometheus.enabled=true

* Change Claim database name for PG compatability

* move CH pasword from template

* Introduce magista (#169)

* Introduce magista-kafka

* Introduce magista-kafka

* Introduce magista-kafka

* Introduce mst

* move kafka comment to the end of file

* actualize magista

* actualize magista

* actualize mgista

* management.endpoint.prometheus.enabled=true

Co-authored-by: Dmitry Skokov <d.skokov@rbkmoney.com>
Co-authored-by: vilorij <vilorij@ya.ru>

* fix url in anapi for correct rendering in logs

* Add LE certs issuer to ingress

* erl default templating
disable ServiceMonitor

* new db init

* riak fix ConfigMap

* shortener config templating

* Dashboard fix realm, 404 error and add ingress

* disable SM in hooker

* add objectselector in vault

* Shumway add schema

* add ingress tls variable into defaults.values

* Fistful templatimg erl defaults
typo fix in MG address

* add default realms

* Consuela for MG
add namespace for payouts

* helmfile deps bump

* add fistful-magista

* add payouter

* add columbus

* add columbus

* disable SM

* analitics fix
clickhouse node for analytics

* claimmgmt add

* fix iddqd appconfig mounts

* deanonimus add

* add antifraud

* kafka scale and infinity retention

* KK realms readability
fix password for manager
add roles mapping

* disable consuella for the issues in consul

* typo fix in checkout

* DB for antifraud

* add schema setting for questionary

* shortener fix with KK public key

* HG ingress for iddqd

* Dominant ingress for iddqd

* messages add
disable vault password control because of foreign keys in DB

* papi add

* idkfa add

* dark-api add

* fix hooker DB name
add DB for fraudbusters

* add new services in helmfile and bump deps

* delete useless keycloak values

Co-authored-by: karleowne <a.karlov@rbkmoney.com>
Co-authored-by: Dmitry Skokov <d.skokov@rbkmoney.com>
2021-07-08 04:10:39 +03:00

2265 lines
80 KiB
YAML

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: clickhouseinstallations.clickhouse.altinity.com
spec:
group: clickhouse.altinity.com
version: v1
scope: Namespaced
names:
kind: ClickHouseInstallation
singular: clickhouseinstallation
plural: clickhouseinstallations
shortNames:
- chi
additionalPrinterColumns:
- name: version
type: string
description: Operator version
priority: 1 # show in wide view
JSONPath: .status.version
- name: clusters
type: integer
description: Clusters count
priority: 0 # show in standard view
JSONPath: .status.clusters
- name: shards
type: integer
description: Shards count
priority: 1 # show in wide view
JSONPath: .status.shards
- name: hosts
type: integer
description: Hosts count
priority: 0 # show in standard view
JSONPath: .status.hosts
- name: taskID
type: string
description: TaskID
priority: 1 # show in wide view
JSONPath: .status.taskID
- name: status
type: string
description: CHI status
priority: 0 # show in standard view
JSONPath: .status.status
- name: updated
type: integer
description: Updated hosts count
priority: 1 # show in wide view
JSONPath: .status.updated
- name: added
type: integer
description: Added hosts count
priority: 1 # show in wide view
JSONPath: .status.added
- name: deleted
type: integer
description: Hosts deleted count
priority: 1 # show in wide view
JSONPath: .status.deleted
- name: delete
type: integer
description: Hosts to be deleted count
priority: 1 # show in wide view
JSONPath: .status.delete
- name: endpoint
type: string
description: Client access endpoint
priority: 1 # show in wide view
JSONPath: .status.endpoint
# TODO return to this feature later
# Pruning unknown fields. FEATURE STATE: Kubernetes v1.15
# Probably full specification may be needed
# preserveUnknownFields: false
validation:
openAPIV3Schema:
type: object
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
properties:
taskID:
type: string
# Need to be StringBool
stop:
type: string
enum:
# List StringBoolXXX constants from model
- ""
- "0"
- "1"
- "False"
- "false"
- "True"
- "true"
- "No"
- "no"
- "Yes"
- "yes"
- "Off"
- "off"
- "On"
- "on"
- "Disabled"
- "disabled"
- "Enabled"
- "enabled"
namespaceDomainPattern:
type: string
templating:
type: object
nullable: true
properties:
policy:
type: string
reconciling:
type: object
nullable: true
properties:
policy:
type: string
defaults:
type: object
nullable: true
properties:
# Need to be StringBool
replicasUseFQDN:
type: string
enum:
# List StringBoolXXX constants from model
- ""
- "0"
- "1"
- "False"
- "false"
- "True"
- "true"
- "No"
- "no"
- "Yes"
- "yes"
- "Off"
- "off"
- "On"
- "on"
- "Disabled"
- "disabled"
- "Enabled"
- "enabled"
distributedDDL:
type: object
nullable: true
properties:
profile:
type: string
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
configuration:
type: object
nullable: true
properties:
zookeeper:
type: object
nullable: true
properties:
nodes:
type: array
nullable: true
items:
type: object
#required:
# - host
properties:
host:
type: string
port:
type: integer
minimum: 0
maximum: 65535
session_timeout_ms:
type: integer
operation_timeout_ms:
type: integer
root:
type: string
identity:
type: string
users:
type: object
nullable: true
profiles:
type: object
nullable: true
quotas:
type: object
nullable: true
settings:
type: object
nullable: true
files:
type: object
nullable: true
clusters:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
minLength: 1
# See namePartClusterMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
zookeeper:
type: object
nullable: true
properties:
nodes:
type: array
nullable: true
items:
type: object
#required:
# - host
properties:
host:
type: string
port:
type: integer
minimum: 0
maximum: 65535
session_timeout_ms:
type: integer
operation_timeout_ms:
type: integer
root:
type: string
identity:
type: string
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
layout:
type: object
nullable: true
properties:
# DEPRECATED - to be removed soon
type:
type: string
shardsCount:
type: integer
replicasCount:
type: integer
shards:
type: array
nullable: true
items:
type: object
properties:
name:
type: string
minLength: 1
# See namePartShardMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
# DEPRECATED - to be removed soon
definitionType:
type: string
weight:
type: integer
# Need to be StringBool
internalReplication:
type: string
enum:
# List StringBoolXXX constants from model
- ""
- "0"
- "1"
- "False"
- "false"
- "True"
- "true"
- "No"
- "no"
- "Yes"
- "yes"
- "Off"
- "off"
- "On"
- "on"
- "Disabled"
- "disabled"
- "Enabled"
- "enabled"
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
replicasCount:
type: integer
minimum: 1
replicas:
type: array
nullable: true
items:
# Host
type: object
properties:
name:
type: string
minLength: 1
# See namePartReplicaMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
tcpPort:
type: integer
minimum: 1
maximum: 65535
httpPort:
type: integer
minimum: 1
maximum: 65535
interserverHttpPort:
type: integer
minimum: 1
maximum: 65535
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
replicas:
type: array
nullable: true
items:
type: object
properties:
name:
type: string
minLength: 1
# See namePartShardMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTeampate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
shardsCount:
type: integer
minimum: 1
shards:
type: array
nullable: true
items:
# Host
type: object
properties:
name:
type: string
minLength: 1
# See namePartReplicaMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
tcpPort:
type: integer
minimum: 1
maximum: 65535
httpPort:
type: integer
minimum: 1
maximum: 65535
interserverHttpPort:
type: integer
minimum: 1
maximum: 65535
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
templates:
type: object
nullable: true
properties:
hostTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
portDistribution:
type: array
nullable: true
items:
type: object
#required:
# - type
properties:
type:
type: string
enum:
# List PortDistributionXXX constants
- ""
- "Unspecified"
- "ClusterScopeIndex"
spec:
# Host
type: object
properties:
name:
type: string
minLength: 1
# See namePartReplicaMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
tcpPort:
type: integer
minimum: 1
maximum: 65535
httpPort:
type: integer
minimum: 1
maximum: 65535
interserverHttpPort:
type: integer
minimum: 1
maximum: 65535
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
podTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
generateName:
type: string
zone:
type: object
#required:
# - values
properties:
key:
type: string
values:
type: array
nullable: true
items:
type: string
distribution:
# DEPRECATED
type: string
enum:
- ""
- "Unspecified"
- "OnePerHost"
podDistribution:
type: array
nullable: true
items:
type: object
#required:
# - type
properties:
type:
type: string
enum:
# List PodDistributionXXX constants
- ""
- "Unspecified"
- "ClickHouseAntiAffinity"
- "ShardAntiAffinity"
- "ReplicaAntiAffinity"
- "AnotherNamespaceAntiAffinity"
- "AnotherClickHouseInstallationAntiAffinity"
- "AnotherClusterAntiAffinity"
- "MaxNumberPerNode"
- "NamespaceAffinity"
- "ClickHouseInstallationAffinity"
- "ClusterAffinity"
- "ShardAffinity"
- "ReplicaAffinity"
- "PreviousTailAffinity"
- "CircularReplication"
scope:
type: string
enum:
# list PodDistributionScopeXXX constants
- ""
- "Unspecified"
- "Shard"
- "Replica"
- "Cluster"
- "ClickHouseInstallation"
- "Namespace"
number:
type: integer
minimum: 0
maximum: 65535
spec:
# TODO specify PodSpec
type: object
nullable: true
volumeClaimTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
# - spec
properties:
name:
type: string
reclaimPolicy:
type: string
enum:
- ""
- "Retain"
- "Delete"
metadata:
type: object
nullable: true
spec:
# TODO specify PersistentVolumeClaimSpec
type: object
nullable: true
serviceTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
# - spec
properties:
name:
type: string
generateName:
type: string
metadata:
# TODO specify ObjectMeta
type: object
nullable: true
spec:
# TODO specify ServiceSpec
type: object
nullable: true
useTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
namespace:
type: string
useType:
type: string
enum:
# List useTypeXXX constants from model
- ""
- "merge"
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: clickhouseinstallationtemplates.clickhouse.altinity.com
spec:
group: clickhouse.altinity.com
version: v1
scope: Namespaced
names:
kind: ClickHouseInstallationTemplate
singular: clickhouseinstallationtemplate
plural: clickhouseinstallationtemplates
shortNames:
- chit
additionalPrinterColumns:
- name: version
type: string
description: Operator version
priority: 1 # show in wide view
JSONPath: .status.version
- name: clusters
type: integer
description: Clusters count
priority: 0 # show in standard view
JSONPath: .status.clusters
- name: shards
type: integer
description: Shards count
priority: 1 # show in wide view
JSONPath: .status.shards
- name: hosts
type: integer
description: Hosts count
priority: 0 # show in standard view
JSONPath: .status.hosts
- name: taskID
type: string
description: TaskID
priority: 1 # show in wide view
JSONPath: .status.taskID
- name: status
type: string
description: CHI status
priority: 0 # show in standard view
JSONPath: .status.status
- name: updated
type: integer
description: Updated hosts count
priority: 1 # show in wide view
JSONPath: .status.updated
- name: added
type: integer
description: Added hosts count
priority: 1 # show in wide view
JSONPath: .status.added
- name: deleted
type: integer
description: Hosts deleted count
priority: 1 # show in wide view
JSONPath: .status.deleted
- name: delete
type: integer
description: Hosts to be deleted count
priority: 1 # show in wide view
JSONPath: .status.delete
- name: endpoint
type: string
description: Client access endpoint
priority: 1 # show in wide view
JSONPath: .status.endpoint
# TODO return to this feature later
# Pruning unknown fields. FEATURE STATE: Kubernetes v1.15
# Probably full specification may be needed
# preserveUnknownFields: false
validation:
openAPIV3Schema:
type: object
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
properties:
taskID:
type: string
# Need to be StringBool
stop:
type: string
enum:
# List StringBoolXXX constants from model
- ""
- "0"
- "1"
- "False"
- "false"
- "True"
- "true"
- "No"
- "no"
- "Yes"
- "yes"
- "Off"
- "off"
- "On"
- "on"
- "Disabled"
- "disabled"
- "Enabled"
- "enabled"
namespaceDomainPattern:
type: string
templating:
type: object
nullable: true
properties:
policy:
type: string
reconciling:
type: object
nullable: true
properties:
policy:
type: string
defaults:
type: object
nullable: true
properties:
# Need to be StringBool
replicasUseFQDN:
type: string
enum:
# List StringBoolXXX constants from model
- ""
- "0"
- "1"
- "False"
- "false"
- "True"
- "true"
- "No"
- "no"
- "Yes"
- "yes"
- "Off"
- "off"
- "On"
- "on"
- "Disabled"
- "disabled"
- "Enabled"
- "enabled"
distributedDDL:
type: object
nullable: true
properties:
profile:
type: string
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
configuration:
type: object
nullable: true
properties:
zookeeper:
type: object
nullable: true
properties:
nodes:
type: array
nullable: true
items:
type: object
#required:
# - host
properties:
host:
type: string
port:
type: integer
minimum: 0
maximum: 65535
session_timeout_ms:
type: integer
operation_timeout_ms:
type: integer
root:
type: string
identity:
type: string
users:
type: object
nullable: true
profiles:
type: object
nullable: true
quotas:
type: object
nullable: true
settings:
type: object
nullable: true
files:
type: object
nullable: true
clusters:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
minLength: 1
# See namePartClusterMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
zookeeper:
type: object
nullable: true
properties:
nodes:
type: array
nullable: true
items:
type: object
#required:
# - host
properties:
host:
type: string
port:
type: integer
minimum: 0
maximum: 65535
session_timeout_ms:
type: integer
operation_timeout_ms:
type: integer
root:
type: string
identity:
type: string
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
layout:
type: object
nullable: true
properties:
# DEPRECATED - to be removed soon
type:
type: string
shardsCount:
type: integer
replicasCount:
type: integer
shards:
type: array
nullable: true
items:
type: object
properties:
name:
type: string
minLength: 1
# See namePartShardMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
# DEPRECATED - to be removed soon
definitionType:
type: string
weight:
type: integer
# Need to be StringBool
internalReplication:
type: string
enum:
# List StringBoolXXX constants from model
- ""
- "0"
- "1"
- "False"
- "false"
- "True"
- "true"
- "No"
- "no"
- "Yes"
- "yes"
- "Off"
- "off"
- "On"
- "on"
- "Disabled"
- "disabled"
- "Enabled"
- "enabled"
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
replicasCount:
type: integer
minimum: 1
replicas:
type: array
nullable: true
items:
# Host
type: object
properties:
name:
type: string
minLength: 1
# See namePartReplicaMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
tcpPort:
type: integer
minimum: 1
maximum: 65535
httpPort:
type: integer
minimum: 1
maximum: 65535
interserverHttpPort:
type: integer
minimum: 1
maximum: 65535
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
replicas:
type: array
nullable: true
items:
type: object
properties:
name:
type: string
minLength: 1
# See namePartShardMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTeampate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
shardsCount:
type: integer
minimum: 1
shards:
type: array
nullable: true
items:
# Host
type: object
properties:
name:
type: string
minLength: 1
# See namePartReplicaMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
tcpPort:
type: integer
minimum: 1
maximum: 65535
httpPort:
type: integer
minimum: 1
maximum: 65535
interserverHttpPort:
type: integer
minimum: 1
maximum: 65535
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
templates:
type: object
nullable: true
properties:
hostTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
portDistribution:
type: array
nullable: true
items:
type: object
#required:
# - type
properties:
type:
type: string
enum:
# List PortDistributionXXX constants
- ""
- "Unspecified"
- "ClusterScopeIndex"
spec:
# Host
type: object
properties:
name:
type: string
minLength: 1
# See namePartReplicaMaxLen const
maxLength: 15
pattern: "^[a-zA-Z0-9-]{0,15}$"
tcpPort:
type: integer
minimum: 1
maximum: 65535
httpPort:
type: integer
minimum: 1
maximum: 65535
interserverHttpPort:
type: integer
minimum: 1
maximum: 65535
settings:
type: object
nullable: true
files:
type: object
nullable: true
templates:
type: object
nullable: true
properties:
hostTemplate:
type: string
podTemplate:
type: string
dataVolumeClaimTemplate:
type: string
logVolumeClaimTemplate:
type: string
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
shardServiceTemplate:
type: string
replicaServiceTemplate:
type: string
podTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
generateName:
type: string
zone:
type: object
#required:
# - values
properties:
key:
type: string
values:
type: array
nullable: true
items:
type: string
distribution:
# DEPRECATED
type: string
enum:
- ""
- "Unspecified"
- "OnePerHost"
podDistribution:
type: array
nullable: true
items:
type: object
#required:
# - type
properties:
type:
type: string
enum:
# List PodDistributionXXX constants
- ""
- "Unspecified"
- "ClickHouseAntiAffinity"
- "ShardAntiAffinity"
- "ReplicaAntiAffinity"
- "AnotherNamespaceAntiAffinity"
- "AnotherClickHouseInstallationAntiAffinity"
- "AnotherClusterAntiAffinity"
- "MaxNumberPerNode"
- "NamespaceAffinity"
- "ClickHouseInstallationAffinity"
- "ClusterAffinity"
- "ShardAffinity"
- "ReplicaAffinity"
- "PreviousTailAffinity"
- "CircularReplication"
scope:
type: string
enum:
# list PodDistributionScopeXXX constants
- ""
- "Unspecified"
- "Shard"
- "Replica"
- "Cluster"
- "ClickHouseInstallation"
- "Namespace"
number:
type: integer
minimum: 0
maximum: 65535
spec:
# TODO specify PodSpec
type: object
nullable: true
volumeClaimTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
# - spec
properties:
name:
type: string
reclaimPolicy:
type: string
enum:
- ""
- "Retain"
- "Delete"
metadata:
type: object
nullable: true
spec:
# TODO specify PersistentVolumeClaimSpec
type: object
nullable: true
serviceTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
# - spec
properties:
name:
type: string
generateName:
type: string
metadata:
# TODO specify ObjectMeta
type: object
nullable: true
spec:
# TODO specify ServiceSpec
type: object
nullable: true
useTemplates:
type: array
nullable: true
items:
type: object
#required:
# - name
properties:
name:
type: string
namespace:
type: string
useType:
type: string
enum:
# List useTypeXXX constants from model
- ""
- "merge"
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: clickhouseoperatorconfigurations.clickhouse.altinity.com
spec:
group: clickhouse.altinity.com
version: v1
scope: Namespaced
names:
kind: ClickHouseOperatorConfiguration
singular: clickhouseoperatorconfiguration
plural: clickhouseoperatorconfigurations
shortNames:
- chopconf
additionalPrinterColumns:
- name: namespaces
type: string
description: Watch namespaces
priority: 0 # show in standard view
JSONPath: .status
# TODO return to this feature later
# Pruning unknown fields. FEATURE STATE: Kubernetes v1.15
# Probably full specification may be needed
# preserveUnknownFields: false
validation:
openAPIV3Schema:
type: object
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
properties:
watchNamespaces:
type: array
items:
type: string
chCommonConfigsPath:
type: string
chHostConfigsPath:
type: string
chUsersConfigsPath:
type: string
chiTemplatesPath:
type: string
statefulSetUpdateTimeout:
type: integer
statefulSetUpdatePollPeriod:
type: integer
onStatefulSetCreateFailureAction:
type: string
onStatefulSetUpdateFailureAction:
type: string
chConfigUserDefaultProfile:
type: string
chConfigUserDefaultQuota:
type: string
chConfigUserDefaultNetworksIP:
type: array
items:
type: string
chConfigUserDefaultPassword:
type: string
chConfigNetworksHostRegexpTemplate:
type: string
chUsername:
type: string
chPassword:
type: string
chCredentialsSecretNamespace:
type: string
chCredentialsSecretName:
type: string
chPort:
type: integer
minimum: 1
maximum: 65535
logtostderr:
type: string
alsologtostderr:
type: string
v:
type: string
stderrthreshold:
type: string
vmodule:
type: string
log_backtrace_at:
type: string
reconcileThreadsNumber:
type: integer
minimum: 1
maximum: 65535
reconcileWaitExclude:
type: string
reconcileWaitInclude:
type: string
excludeFromPropagationLabels:
type: array
items:
type: string
appendScopeLabels:
type: string
enum:
# List StringBoolXXX constants from model
- ""
- "0"
- "1"
- "False"
- "false"
- "True"
- "true"
- "No"
- "no"
- "Yes"
- "yes"
- "Off"
- "off"
- "On"
- "on"
- "Disabled"
- "disabled"
- "Enabled"
- "enabled"
---
# Possible Template Parameters:
#
# kube-system
#
# Setup ServiceAccount
# ServiceAccount would be created in kubectl-specified namespace
apiVersion: v1
kind: ServiceAccount
metadata:
name: clickhouse-operator
namespace: dev-rbkmoney
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clickhouse-operator-kube-system
rules:
- apiGroups:
- ""
resources:
- configmaps
- services
verbs:
- create
- delete
- get
- patch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
- pods
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- delete
- get
- patch
- update
- apiGroups:
- clickhouse.altinity.com
resources:
- clickhouseinstallations
verbs:
- delete
- get
- patch
- update
- apiGroups:
- apps
resourceNames:
- clickhouse-operator
resources:
- deployments
verbs:
- get
- patch
- update
- delete
- apiGroups:
- apps
resources:
- replicasets
verbs:
- delete
- get
- patch
- update
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- services
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- get
- list
- watch
- apiGroups:
- clickhouse.altinity.com
resources:
- clickhouseinstallations
- clickhouseinstallationtemplates
- clickhouseoperatorconfigurations
verbs:
- get
- list
- watch
---
# Setup ClusterRoleBinding between ClusterRole and ServiceAccount.
# ClusterRoleBinding is namespace-less and must have unique name
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: clickhouse-operator-kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: clickhouse-operator-kube-system
subjects:
- kind: ServiceAccount
name: clickhouse-operator
namespace: dev-rbkmoney
---
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.14.0
# etc-clickhouse-operator-files
#
apiVersion: v1
kind: ConfigMap
metadata:
name: etc-clickhouse-operator-files
namespace: dev-rbkmoney
labels:
app: clickhouse-operator
data:
config.yaml: |
################################################
##
## Watch Namespaces Section
##
################################################
# List of namespaces where clickhouse-operator watches for events.
# Concurrently running operators should watch on different namespaces
#watchNamespaces:
# - dev
# - test
# - info
# - onemore
################################################
##
## Additional Configuration Files Section
##
################################################
# Path to folder where ClickHouse configuration files common for all instances within CHI are located.
chCommonConfigsPath: config.d
# Path to folder where ClickHouse configuration files unique for each instance (host) within CHI are located.
chHostConfigsPath: conf.d
# Path to folder where ClickHouse configuration files with users settings are located.
# Files are common for all instances within CHI
chUsersConfigsPath: users.d
# Path to folder where ClickHouseInstallation .yaml manifests are located.
# Manifests are applied in sorted alpha-numeric order
chiTemplatesPath: templates.d
################################################
##
## Cluster Create/Update/Delete Objects Section
##
################################################
# How many seconds to wait for created/updated StatefulSet to be Ready
statefulSetUpdateTimeout: 300
# How many seconds to wait between checks for created/updated StatefulSet status
statefulSetUpdatePollPeriod: 5
# What to do in case created StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds
# Possible options:
# 1. abort - do nothing, just break the process and wait for admin
# 2. delete - delete newly created problematic StatefulSet
# 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet
onStatefulSetCreateFailureAction: ignore
# What to do in case updated StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds
# Possible options:
# 1. abort - do nothing, just break the process and wait for admin
# 2. rollback - delete Pod and rollback StatefulSet to previous Generation.
# Pod would be recreated by StatefulSet based on rollback-ed configuration
# 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet
onStatefulSetUpdateFailureAction: rollback
################################################
##
## ClickHouse Settings Section
##
################################################
# 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: default
chConfigUserDefaultQuota: default
chConfigUserDefaultNetworksIP:
- "::1"
- "127.0.0.1"
chConfigUserDefaultPassword: "default"
# Default host_regexp to limit network connectivity from outside
chConfigNetworksHostRegexpTemplate: "(chi-{chi}-[^.]+\\d+-\\d+|clickhouse\\-{chi})\\.{namespace}\\.svc\\.cluster\\.local$"
################################################
##
## Access to ClickHouse instances
##
################################################
# ClickHouse credentials (username, password and port) to be used by operator to connect to ClickHouse instances
# for:
# 1. Metrics requests
# 2. Schema maintenance
# 3. DROP DNS CACHE
# User with such credentials can be specified in additional ClickHouse .xml config files,
# located in `chUsersConfigsPath` folder
chUsername: clickhouse_operator
chPassword: clickhouse_operator_password
# 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: ""
chCredentialsSecretName: ""
# Port where to connect to ClickHouse instances to
chPort: 8123
################################################
##
## Log parameters
##
################################################
logtostderr: "true"
alsologtostderr: "false"
v: "1"
stderrthreshold: ""
vmodule: ""
log_backtrace_at: ""
################################################
##
## Runtime parameters
##
################################################
# Max number of concurrent reconciles in progress
reconcileThreadsNumber: 10
reconcileWaitExclude: false
reconcileWaitInclude: false
################################################
##
## Labels management parameters
##
################################################
# When propagating labels from the chi's `metadata.labels` section to child objects' `metadata.labels`,
# exclude labels from the following list:
#excludeFromPropagationLabels:
# - "labelA"
# - "labelB"
# Whether to append *Scope* labels to StatefulSet and Pod.
# Full list of available *scope* labels check in labeler.go
# LabelShardScopeIndex
# LabelReplicaScopeIndex
# LabelCHIScopeIndex
# LabelCHIScopeCycleSize
# LabelCHIScopeCycleIndex
# LabelCHIScopeCycleOffset
# LabelClusterScopeIndex
# LabelClusterScopeCycleSize
# LabelClusterScopeCycleIndex
# LabelClusterScopeCycleOffset
appendScopeLabels: "no"
---
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.14.0
# etc-clickhouse-operator-confd-files
#
apiVersion: v1
kind: ConfigMap
metadata:
name: etc-clickhouse-operator-confd-files
namespace: dev-rbkmoney
labels:
app: clickhouse-operator
data:
---
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.14.0
# etc-clickhouse-operator-configd-files
#
apiVersion: v1
kind: ConfigMap
metadata:
name: etc-clickhouse-operator-configd-files
namespace: dev-rbkmoney
labels:
app: clickhouse-operator
data:
01-clickhouse-listen.xml: |
<yandex>
<!-- Listen wildcard address to allow accepting connections from other containers and host network. -->
<listen_host>::</listen_host>
<listen_host>0.0.0.0</listen_host>
<listen_try>1</listen_try>
</yandex>
02-clickhouse-logger.xml: |
<yandex>
<logger>
<!-- Possible levels: https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/Logger.h#L105 -->
<level>debug</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
<!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
<console>1</console>
</logger>
</yandex>
03-clickhouse-querylog.xml: |
<yandex>
<query_log replace="1">
<database>system</database>
<table>query_log</table>
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day</engine>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_log>
<query_thread_log remove="1"/>
</yandex>
04-clickhouse-partlog.xml: |
<yandex>
<part_log replace="1">
<database>system</database>
<table>part_log</table>
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day</engine>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</part_log>
</yandex>
---
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.14.0
# etc-clickhouse-operator-templatesd-files
#
apiVersion: v1
kind: ConfigMap
metadata:
name: etc-clickhouse-operator-templatesd-files
namespace: dev-rbkmoney
labels:
app: clickhouse-operator
data:
001-templates.json.example: |
{
"apiVersion": "clickhouse.altinity.com/v1",
"kind": "ClickHouseInstallationTemplate",
"metadata": {
"name": "01-default-volumeclaimtemplate"
},
"spec": {
"templates": {
"volumeClaimTemplates": [
{
"name": "chi-default-volume-claim-template",
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "2Gi"
}
}
}
}
],
"podTemplates": [
{
"name": "chi-default-oneperhost-pod-template",
"distribution": "OnePerHost",
"spec": {
"containers" : [
{
"name": "clickhouse",
"image": "yandex/clickhouse-server:19.3.7",
"ports": [
{
"name": "http",
"containerPort": 8123
},
{
"name": "client",
"containerPort": 9000
},
{
"name": "interserver",
"containerPort": 9009
}
]
}
]
}
}
]
}
}
}
default-pod-template.yaml.example: |
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallationTemplate"
metadata:
name: "default-oneperhost-pod-template"
spec:
templates:
podTemplates:
- name: default-oneperhost-pod-template
distribution: "OnePerHost"
default-storage-template.yaml.example: |
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallationTemplate"
metadata:
name: "default-storage-template-2Gi"
spec:
templates:
volumeClaimTemplates:
- name: default-storage-template-2Gi
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
readme: |
Templates in this folder are packaged with an operator and available via 'useTemplate'
---
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.14.0
# etc-clickhouse-operator-usersd-files
#
apiVersion: v1
kind: ConfigMap
metadata:
name: etc-clickhouse-operator-usersd-files
namespace: dev-rbkmoney
labels:
app: clickhouse-operator
data:
01-clickhouse-user.xml: |
<yandex>
<users>
<clickhouse_operator>
<networks>
<ip>127.0.0.1</ip>
<ip>0.0.0.0/0</ip>
<ip>::/0</ip>
</networks>
<password_sha256_hex>716b36073a90c6fe1d445ac1af85f4777c5b7a155cea359961826a030513e448</password_sha256_hex>
<profile>clickhouse_operator</profile>
<quota>default</quota>
</clickhouse_operator>
</users>
<profiles>
<clickhouse_operator>
<log_queries>0</log_queries>
<skip_unavailable_shards>1</skip_unavailable_shards>
<http_connection_timeout>10</http_connection_timeout>
</clickhouse_operator>
</profiles>
</yandex>
02-clickhouse-default-profile.xml: |
<yandex>
<profiles>
<default>
<log_queries>1</log_queries>
<connect_timeout_with_failover_ms>1000</connect_timeout_with_failover_ms>
<distributed_aggregation_memory_efficient>1</distributed_aggregation_memory_efficient>
<parallel_view_processing>1</parallel_view_processing>
</default>
</profiles>
</yandex>
---
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.14.0
# altinity/metrics-exporter:0.14.0
#
# Setup Deployment for clickhouse-operator
# Deployment would be created in kubectl-specified namespace
kind: Deployment
apiVersion: apps/v1
metadata:
name: clickhouse-operator
namespace: dev-rbkmoney
labels:
app: clickhouse-operator
spec:
replicas: 1
selector:
matchLabels:
app: clickhouse-operator
template:
metadata:
labels:
app: clickhouse-operator
annotations:
prometheus.io/port: '8888'
prometheus.io/scrape: 'true'
spec:
serviceAccountName: clickhouse-operator
volumes:
- name: etc-clickhouse-operator-folder
configMap:
name: etc-clickhouse-operator-files
- name: etc-clickhouse-operator-confd-folder
configMap:
name: etc-clickhouse-operator-confd-files
- name: etc-clickhouse-operator-configd-folder
configMap:
name: etc-clickhouse-operator-configd-files
- name: etc-clickhouse-operator-templatesd-folder
configMap:
name: etc-clickhouse-operator-templatesd-files
- name: etc-clickhouse-operator-usersd-folder
configMap:
name: etc-clickhouse-operator-usersd-files
containers:
- name: clickhouse-operator
image: altinity/clickhouse-operator:0.14.0
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
mountPath: /etc/clickhouse-operator
- name: etc-clickhouse-operator-confd-folder
mountPath: /etc/clickhouse-operator/conf.d
- name: etc-clickhouse-operator-configd-folder
mountPath: /etc/clickhouse-operator/config.d
- name: etc-clickhouse-operator-templatesd-folder
mountPath: /etc/clickhouse-operator/templates.d
- name: etc-clickhouse-operator-usersd-folder
mountPath: /etc/clickhouse-operator/users.d
env:
# Pod-specific
# spec.nodeName: ip-172-20-52-62.ec2.internal
- name: OPERATOR_POD_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
# metadata.name: clickhouse-operator-6f87589dbb-ftcsf
- name: OPERATOR_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
# metadata.namespace: dev-rbkmoney
- name: OPERATOR_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# status.podIP: 100.96.3.2
- name: OPERATOR_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
# spec.serviceAccount: clickhouse-operator
# spec.serviceAccountName: clickhouse-operator
- name: OPERATOR_POD_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
# Container-specific
- name: OPERATOR_CONTAINER_CPU_REQUEST
valueFrom:
resourceFieldRef:
containerName: clickhouse-operator
resource: requests.cpu
- name: OPERATOR_CONTAINER_CPU_LIMIT
valueFrom:
resourceFieldRef:
containerName: clickhouse-operator
resource: limits.cpu
- name: OPERATOR_CONTAINER_MEM_REQUEST
valueFrom:
resourceFieldRef:
containerName: clickhouse-operator
resource: requests.memory
- name: OPERATOR_CONTAINER_MEM_LIMIT
valueFrom:
resourceFieldRef:
containerName: clickhouse-operator
resource: limits.memory
- name: metrics-exporter
image: altinity/metrics-exporter:0.14.0
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
mountPath: /etc/clickhouse-operator
- name: etc-clickhouse-operator-confd-folder
mountPath: /etc/clickhouse-operator/conf.d
- name: etc-clickhouse-operator-configd-folder
mountPath: /etc/clickhouse-operator/config.d
- name: etc-clickhouse-operator-templatesd-folder
mountPath: /etc/clickhouse-operator/templates.d
- name: etc-clickhouse-operator-usersd-folder
mountPath: /etc/clickhouse-operator/users.d
---
# Possible Template Parameters:
#
# kube-system
#
# Setup ClusterIP Service to provide monitoring metrics for Prometheus
# Service would be created in kubectl-specified namespace
# In order to get access outside of k8s it should be exposed as:
# kubectl --namespace prometheus port-forward service/prometheus 9090
# and point browser to localhost:9090
kind: Service
apiVersion: v1
metadata:
name: clickhouse-operator-metrics
namespace: dev-rbkmoney
labels:
app: clickhouse-operator
spec:
ports:
- port: 8888
name: clickhouse-operator-metrics
selector:
app: clickhouse-operator