Skip to content

Commit

Permalink
Merge pull request #346 from Altinity/0.9.7
Browse files Browse the repository at this point in the history
0.9.7
  • Loading branch information
alex-zaitsev authored Apr 15, 2020
2 parents a9ed496 + 123af1d commit 2b1aab4
Show file tree
Hide file tree
Showing 29 changed files with 280 additions and 203 deletions.
2 changes: 1 addition & 1 deletion cmd/operator/app/clickhouse_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const (
const (
// TODO probably this should be added as a CLI/Config param
// Default number of controller threads running concurrently (used in case no other specified in config)
defaultControllerThreadsNum = 1
defaultControllerThreadsNum = 10
)

// CLI parameter variables
Expand Down
18 changes: 9 additions & 9 deletions deploy/dev/clickhouse-operator-install-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ subjects:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-files
#
apiVersion: v1
Expand Down Expand Up @@ -1494,7 +1494,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-confd-files
#
apiVersion: v1
Expand All @@ -1509,7 +1509,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-configd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1555,7 +1555,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-templatesd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1654,7 +1654,7 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-usersd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1703,8 +1703,8 @@ data:
# Possible Template Parameters:
#
# dev
# altinity/clickhouse-operator:0.9.6
# altinity/metrics-exporter:0.9.6
# altinity/clickhouse-operator:0.9.7
# altinity/metrics-exporter:0.9.7
#
# Setup Deployment for clickhouse-operator
# Deployment would be created in kubectl-specified namespace
Expand Down Expand Up @@ -1747,7 +1747,7 @@ spec:
name: etc-clickhouse-operator-usersd-files
containers:
- name: clickhouse-operator
image: altinity/clickhouse-operator:0.9.6
image: altinity/clickhouse-operator:0.9.7
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down Expand Up @@ -1812,7 +1812,7 @@ spec:
resource: limits.memory

- name: metrics-exporter
image: altinity/metrics-exporter:0.9.6
image: altinity/metrics-exporter:0.9.7
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ OPERATOR_CH_USER=$(grep chUsername ${CUR_DIR}/../../../config/config.yaml | cut
OPERATOR_CH_PASS=$(grep chPassword ${CUR_DIR}/../../../config/config.yaml | cut -d " " -f 2-)

IFS=$'\n'
for LINE in $(kubectl get --all-namespaces chi -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,ENDPOINT:.status.endpoint | tail -n +2);
do
for LINE in $(kubectl get --all-namespaces chi -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,ENDPOINT:.status.endpoint | tail -n +2); do
ITEMS=( $(grep -Eo '([^[:space:]]+)' <<<"$LINE") )
NAMESPACE=${ITEMS[0]}
CHI=${ITEMS[1]}
Expand All @@ -129,8 +128,7 @@ do
CLICKHOUSE_URL="http://${ENDPOINT}:${PORT}"

# create system.query_log in each pod on CHI
for POD in $(kubectl get --namespace="${NAMESPACE}" pods -l "clickhouse.altinity.com/app=chop,clickhouse.altinity.com/chi=${CHI}" -o='custom-columns=NAME:.metadata.name' | tail -n +2)
do
for POD in $(kubectl get --namespace="${NAMESPACE}" pods -l "clickhouse.altinity.com/app=chop,clickhouse.altinity.com/chi=${CHI}" -o='custom-columns=NAME:.metadata.name' | tail -n +2); do
kubectl exec --namespace="${NAMESPACE}" ${POD} -- clickhouse-client --echo -mn -q 'SELECT hostName(), dummy FROM system.one SETTINGS log_queries=1; SYSTEM FLUSH LOGS'
done

Expand All @@ -141,7 +139,7 @@ do
ENDPOINT="$ENDPOINT" \
OPERATOR_CH_USER="$OPERATOR_CH_USER" \
OPERATOR_CH_PASS="$OPERATOR_CH_PASS" \
envsubst
envsubst \
)

done
Expand All @@ -152,6 +150,5 @@ sleep 10
kubectl apply --namespace="${GRAFANA_NAMESPACE}" -f <(
cat ${CUR_DIR}/grafana-dashboard-queries-cr-template.yaml | \
GRAFANA_DASHBOARD_NAME="$GRAFANA_QUERIES_DASHBOARD_NAME" \
envsubst
envsubst \
)

18 changes: 9 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.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-files
#
apiVersion: v1
Expand Down Expand Up @@ -127,7 +127,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-confd-files
#
apiVersion: v1
Expand All @@ -141,7 +141,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-configd-files
#
apiVersion: v1
Expand Down Expand Up @@ -186,7 +186,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-templatesd-files
#
apiVersion: v1
Expand Down Expand Up @@ -284,7 +284,7 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-usersd-files
#
apiVersion: v1
Expand Down Expand Up @@ -332,8 +332,8 @@ data:
# Possible Template Parameters:
#
# -
# altinity/clickhouse-operator:0.9.6
# altinity/metrics-exporter:0.9.6
# altinity/clickhouse-operator:0.9.7
# altinity/metrics-exporter:0.9.7
#
# Setup Deployment for clickhouse-operator
# Deployment would be created in kubectl-specified namespace
Expand Down Expand Up @@ -375,7 +375,7 @@ spec:
name: etc-clickhouse-operator-usersd-files
containers:
- name: clickhouse-operator
image: altinity/clickhouse-operator:0.9.6
image: altinity/clickhouse-operator:0.9.7
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down Expand Up @@ -440,7 +440,7 @@ spec:
resource: limits.memory

- name: metrics-exporter
image: altinity/metrics-exporter:0.9.6
image: altinity/metrics-exporter:0.9.7
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down
18 changes: 9 additions & 9 deletions deploy/operator/clickhouse-operator-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ subjects:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-files
#
apiVersion: v1
Expand Down Expand Up @@ -1494,7 +1494,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-confd-files
#
apiVersion: v1
Expand All @@ -1509,7 +1509,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-configd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1555,7 +1555,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-templatesd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1654,7 +1654,7 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.9.6
# altinity/clickhouse-operator:0.9.7
# etc-clickhouse-operator-usersd-files
#
apiVersion: v1
Expand Down Expand Up @@ -1703,8 +1703,8 @@ data:
# Possible Template Parameters:
#
# kube-system
# altinity/clickhouse-operator:0.9.6
# altinity/metrics-exporter:0.9.6
# altinity/clickhouse-operator:0.9.7
# altinity/metrics-exporter:0.9.7
#
# Setup Deployment for clickhouse-operator
# Deployment would be created in kubectl-specified namespace
Expand Down Expand Up @@ -1747,7 +1747,7 @@ spec:
name: etc-clickhouse-operator-usersd-files
containers:
- name: clickhouse-operator
image: altinity/clickhouse-operator:0.9.6
image: altinity/clickhouse-operator:0.9.7
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down Expand Up @@ -1812,7 +1812,7 @@ spec:
resource: limits.memory

- name: metrics-exporter
image: altinity/metrics-exporter:0.9.6
image: altinity/metrics-exporter:0.9.7
imagePullPolicy: Always
volumeMounts:
- name: etc-clickhouse-operator-folder
Expand Down
18 changes: 11 additions & 7 deletions dev/image_build_metrics_exporter_universal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ if [[ "${MINIKUBE}" == "yes" ]]; then
# We'd like to build for minikube
eval $(minikube docker-env)
fi
docker build -t "${TAG}" -f "${DOCKERFILE}" "${SRC_ROOT}"

# Publish image
if [[ "${DOCKERHUB_PUBLISH}" == "yes" ]]; then
if [[ ! -z "${DOCKERHUB_LOGIN}" ]]; then
echo "Dockerhub login specified: '${DOCKERHUB_LOGIN}', perform login"
docker login -u "${DOCKERHUB_LOGIN}"
if docker build -t "${TAG}" -f "${DOCKERFILE}" "${SRC_ROOT}"; then
# Image ready, time to publish it
if [[ "${DOCKERHUB_PUBLISH}" == "yes" ]]; then
if [[ ! -z "${DOCKERHUB_LOGIN}" ]]; then
echo "Dockerhub login specified: '${DOCKERHUB_LOGIN}', perform login"
docker login -u "${DOCKERHUB_LOGIN}"
fi
docker push "${TAG}"
fi
docker push "${TAG}"
else
echo "FAILED docker build! Abort."
exit 1
fi
18 changes: 11 additions & 7 deletions dev/image_build_operator_universal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ if [[ "${MINIKUBE}" == "yes" ]]; then
# We'd like to build for minikube
eval $(minikube docker-env)
fi
docker build -t "${TAG}" -f "${DOCKERFILE}" "${SRC_ROOT}"

# Publish image
if [[ "${DOCKERHUB_PUBLISH}" == "yes" ]]; then
if [[ ! -z "${DOCKERHUB_LOGIN}" ]]; then
echo "Dockerhub login specified: '${DOCKERHUB_LOGIN}', perform login"
docker login -u "${DOCKERHUB_LOGIN}"
if docker build -t "${TAG}" -f "${DOCKERFILE}" "${SRC_ROOT}"; then
# Image ready, time to publish it
if [[ "${DOCKERHUB_PUBLISH}" == "yes" ]]; then
if [[ ! -z "${DOCKERHUB_LOGIN}" ]]; then
echo "Dockerhub login specified: '${DOCKERHUB_LOGIN}', perform login"
docker login -u "${DOCKERHUB_LOGIN}"
fi
docker push "${TAG}"
fi
docker push "${TAG}"
else
echo "FAILED docker build! Abort."
exit 1
fi
5 changes: 3 additions & 2 deletions pkg/apis/clickhouse.altinity.com/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ type ChiHost struct {
Templates ChiTemplateNames `json:"templates,omitempty"`

// Internal data
Address ChiHostAddress `json:"address"`
Config ChiHostConfig `json:"config"`
Address ChiHostAddress `json:"-"`
Config ChiHostConfig `json:"-"`
CHI *ClickHouseInstallation `json:"-" testdiff:"ignore"`
}

Expand Down Expand Up @@ -261,6 +261,7 @@ type ChiHostAddress struct {
type ChiHostConfig struct {
ZookeeperFingerprint string `json:"zookeeperfingerprint"`
SettingsFingerprint string `json:"settingsfingerprint"`
FilesFingerprint string `json:"filesfingerprint"`
}

// CHITemplates defines templates section of .spec
Expand Down
Loading

0 comments on commit 2b1aab4

Please sign in to comment.