Skip to content

Commit

Permalink
Merge pull request #650 from Altinity/0.13.5
Browse files Browse the repository at this point in the history
0.13.5 release
  • Loading branch information
sunsingerus committed Feb 15, 2021
2 parents 412a198 + 8298522 commit 9242677
Show file tree
Hide file tree
Showing 73 changed files with 2,869 additions and 904 deletions.
2 changes: 1 addition & 1 deletion cmd/metrics_exporter/app/metrics_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func Run() {
// Create operator instance
chop := chop.GetCHOp(chopClient, chopConfigFile)
chop.SetupLog()
chop.Config().WriteToLog()
log.Info(chop.Config().String(true))

exporter := metrics.StartMetricsREST(
metrics.NewCHAccessInfo(
Expand Down
23 changes: 11 additions & 12 deletions cmd/operator/app/clickhouse_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ import (
"syscall"
"time"

kubeinformers "k8s.io/client-go/informers"

log "github.com/altinity/clickhouse-operator/pkg/announcer"
"github.com/altinity/clickhouse-operator/pkg/chop"
chopinformers "github.com/altinity/clickhouse-operator/pkg/client/informers/externalversions"
"github.com/altinity/clickhouse-operator/pkg/controller/chi"
"github.com/altinity/clickhouse-operator/pkg/version"

chopinformers "github.com/altinity/clickhouse-operator/pkg/client/informers/externalversions"

log "github.com/golang/glog"
// log "k8s.io/klog"

kubeinformers "k8s.io/client-go/informers"
)

// Prometheus exporter defaults
Expand Down Expand Up @@ -87,22 +84,24 @@ func Run() {
os.Exit(0)
}

log.S().P()
defer log.E().P()

if debugRequest {
kubeInformerFactoryResyncPeriod = defaultInformerFactoryResyncDebugPeriod
chopInformerFactoryResyncPeriod = defaultInformerFactoryResyncDebugPeriod
}

log.Infof("Starting clickhouse-operator. Version:%s GitSHA:%s BuiltAt:%s\n", version.Version, version.GitSHA, version.BuiltAt)
log.A().Info("Starting clickhouse-operator. Version:%s GitSHA:%s BuiltAt:%s", version.Version, version.GitSHA, version.BuiltAt)

// Initialize k8s API clients
kubeClient, chopClient := chop.GetClientset(kubeConfigFile, masterURL)

// Create operator instance
chop := chop.GetCHOp(chopClient, chopConfigFile)
chop.SetupLog()
chop.Config().WriteToLog()

log.V(1).Infof("Log options parsed\n")
log.V(1).A().Info("Log options parsed")
log.Info(chop.Config().String(true))

// Create Informers
kubeInformerFactory := kubeinformers.NewSharedInformerFactoryWithOptions(
Expand Down Expand Up @@ -145,7 +144,7 @@ func Run() {
//
// Start Controller
//
log.V(1).Info("Starting CHI controller\n")
log.V(1).A().Info("Starting CHI controller")
wg := &sync.WaitGroup{}
wg.Add(1)
go func() {
Expand Down
8 changes: 8 additions & 0 deletions config/users.d/03-database-ordinary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Remove it for ClickHouse versions before 20.4 -->
<yandex>
<profiles>
<default>
<default_database_engine>Ordinary</default_database_engine>
</default>
</profiles>
</yandex>
27 changes: 18 additions & 9 deletions deploy/dev/clickhouse-operator-install-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ subjects:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-files
#
apiVersion: v1
Expand Down Expand Up @@ -1611,7 +1611,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-confd-files
#
apiVersion: v1
Expand All @@ -1626,7 +1626,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-configd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1682,7 +1682,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-templatesd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1781,7 +1781,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-usersd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1826,12 +1826,21 @@ data:
</default>
</profiles>
</yandex>
03-database-ordinary.xml: |
<!-- Remove it for ClickHouse versions before 20.4 -->
<yandex>
<profiles>
<default>
<default_database_engine>Ordinary</default_database_engine>
</default>
</profiles>
</yandex>
---
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.13.0
# altinity/metrics-exporter:0.13.0
# altinity/clickhouse-operator:0.13.5
# altinity/metrics-exporter:0.13.5
#
# Setup Deployment for clickhouse-operator
# Deployment would be created in kubectl-specified namespace
Expand Down Expand Up @@ -1874,7 +1883,7 @@ spec:
name: etc-clickhouse-operator-usersd-files
containers:
- name: clickhouse-operator
image: altinity/clickhouse-operator:0.13.0
image: altinity/clickhouse-operator:0.13.5
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down Expand Up @@ -1939,7 +1948,7 @@ spec:
resource: limits.memory

- name: metrics-exporter
image: altinity/metrics-exporter:0.13.0
image: altinity/metrics-exporter:0.13.5
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down
27 changes: 18 additions & 9 deletions deploy/operator/clickhouse-operator-install-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-files
#
apiVersion: v1
Expand Down Expand Up @@ -138,7 +138,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-confd-files
#
apiVersion: v1
Expand All @@ -152,7 +152,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-configd-files
#
apiVersion: v1
Expand Down Expand Up @@ -207,7 +207,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-templatesd-files
#
apiVersion: v1
Expand Down Expand Up @@ -305,7 +305,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-usersd-files
#
apiVersion: v1
Expand Down Expand Up @@ -349,12 +349,21 @@ data:
</default>
</profiles>
</yandex>
03-database-ordinary.xml: |
<!-- Remove it for ClickHouse versions before 20.4 -->
<yandex>
<profiles>
<default>
<default_database_engine>Ordinary</default_database_engine>
</default>
</profiles>
</yandex>
---
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.13.0
# altinity/metrics-exporter:0.13.0
# altinity/clickhouse-operator:0.13.5
# altinity/metrics-exporter:0.13.5
#
# Setup Deployment for clickhouse-operator
# Deployment would be created in kubectl-specified namespace
Expand Down Expand Up @@ -396,7 +405,7 @@ spec:
name: etc-clickhouse-operator-usersd-files
containers:
- name: clickhouse-operator
image: altinity/clickhouse-operator:0.13.0
image: altinity/clickhouse-operator:0.13.5
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down Expand Up @@ -461,7 +470,7 @@ spec:
resource: limits.memory

- name: metrics-exporter
image: altinity/metrics-exporter:0.13.0
image: altinity/metrics-exporter:0.13.5
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ data:
</default>
</profiles>
</yandex>
03-database-ordinary.xml: |
<!-- Remove it for ClickHouse versions before 20.4 -->
<yandex>
<profiles>
<default>
<default_database_engine>Ordinary</default_database_engine>
</default>
</profiles>
</yandex>
---
# Possible Template Parameters:
#
Expand Down
9 changes: 9 additions & 0 deletions deploy/operator/clickhouse-operator-install-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,15 @@ data:
</default>
</profiles>
</yandex>
03-database-ordinary.xml: |
<!-- Remove it for ClickHouse versions before 20.4 -->
<yandex>
<profiles>
<default>
<default_database_engine>Ordinary</default_database_engine>
</default>
</profiles>
</yandex>
---
# Possible Template Parameters:
#
Expand Down
27 changes: 18 additions & 9 deletions deploy/operator/clickhouse-operator-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ subjects:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-files
#
apiVersion: v1
Expand Down Expand Up @@ -1611,7 +1611,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-confd-files
#
apiVersion: v1
Expand All @@ -1626,7 +1626,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-configd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1682,7 +1682,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-templatesd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1781,7 +1781,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.13.0
# altinity/clickhouse-operator:0.13.5
# etc-clickhouse-operator-usersd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1826,12 +1826,21 @@ data:
</default>
</profiles>
</yandex>
03-database-ordinary.xml: |
<!-- Remove it for ClickHouse versions before 20.4 -->
<yandex>
<profiles>
<default>
<default_database_engine>Ordinary</default_database_engine>
</default>
</profiles>
</yandex>
---
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.13.0
# altinity/metrics-exporter:0.13.0
# altinity/clickhouse-operator:0.13.5
# altinity/metrics-exporter:0.13.5
#
# Setup Deployment for clickhouse-operator
# Deployment would be created in kubectl-specified namespace
Expand Down Expand Up @@ -1874,7 +1883,7 @@ spec:
name: etc-clickhouse-operator-usersd-files
containers:
- name: clickhouse-operator
image: altinity/clickhouse-operator:0.13.0
image: altinity/clickhouse-operator:0.13.5
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down Expand Up @@ -1939,7 +1948,7 @@ spec:
resource: limits.memory

- name: metrics-exporter
image: altinity/metrics-exporter:0.13.0
image: altinity/metrics-exporter:0.13.5
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down
4 changes: 3 additions & 1 deletion docs/replication_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ CREATE TABLE events_local on cluster '{cluster}' (
event_type Int32,
article_id Int32,
title String
) engine=ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', event_date, (event_type, article_id), 8192);
) engine=ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}')
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_type, article_id);
```

```sql
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/mailru/go-clickhouse v1.3.0
github.com/prometheus/client_golang v1.6.0
github.com/r3labs/diff v0.0.0-20191120142937-b4ed99a31f5a
github.com/sanity-io/litter v1.3.0
github.com/spf13/pflag v1.0.5 // indirect
gopkg.in/d4l3k/messagediff.v1 v1.2.1
gopkg.in/yaml.v2 v2.2.8
Expand Down

0 comments on commit 9242677

Please sign in to comment.