Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change dashboard refresh rate 1m and add min_duration_ms, max_duration_ms dashboard variables, rename query_type to query_kind #1235

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ if ! command -v yq &> /dev/null; then
echo "Install 'yq', see installation instruction in https://github.com/mikefarah/yq/#install"
exit 1
else
export OPERATOR_CH_USER=$(yq eval .clickhouse.access.username ${CUR_DIR}/../../../config/config.yaml)
export OPERATOR_CH_PASS=$(yq eval .clickhouse.access.password ${CUR_DIR}/../../../config/config.yaml)
export OPERATOR_CH_USER=$(yq 'select(.kind == "Secret") | .stringData.username' "${CUR_DIR}/../../operator/clickhouse-operator-install-bundle.yaml")
export OPERATOR_CH_PASS=$(yq 'select(.kind == "Secret") | .stringData.password' "${CUR_DIR}/../../operator/clickhouse-operator-install-bundle.yaml")
fi

echo "Create ClickHouse DataSource for each ClickHouseInstallation"
Expand All @@ -199,6 +199,23 @@ for LINE in $(kubectl get --all-namespaces chi -o custom-columns=NAMESPACE:.meta
clickhouse-client --echo -mn -q 'SELECT hostName(), dummy FROM system.one SETTINGS log_queries=1; SYSTEM FLUSH LOGS'
done

echo "Ensure clickhouse-operator will connect to any chi from grafana"
POD_NETWORK_CIDR=$(kubectl get cm -n kube-system kube-proxy -o yaml | grep clusterCIDR | cut -d ":" -f 2)
kubectl apply --validate=${VALIDATE_YAML} --namespace="${NAMESPACE}" -f <(
{
echo "apiVersion: clickhouse.altinity.com/v1"
echo "kind: ClickHouseInstallationTemplate"
echo "metadata:"
echo " name: clickhouse-operator-from-cluster-network"
echo "spec:"
echo " templating:"
echo " policy: auto"
echo " configuration:"
echo " users:"
echo " ${OPERATOR_CH_USER}/networks/ip: ${POD_NETWORK_CIDR}"
}
)

GRAFANA_CLICKHOUSE_DATASOURCE_NAME="k8s-${NAMESPACE}-${CHI}"
CLICKHOUSE_URL="http://${ENDPOINT}:${PORT}"
echo "Create ClickHouse DataSource for ClickHouseInstallation ${CHI} '${GRAFANA_NAMESPACE}/${GRAFANA_CLICKHOUSE_DATASOURCE_NAME}'"
Expand Down
2 changes: 1 addition & 1 deletion deploy/prometheus/create-prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "External value for \$VALIDATE_YAML=$VALIDATE_YAML"

export PROMETHEUS_NAMESPACE="${PROMETHEUS_NAMESPACE:-prometheus}"
export OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE:-kube-system}"
export PROMETHEUS_OPERATOR_BRANCH="${PROMETHEUS_OPERATOR_BRANCH:-v0.62.0}"
export PROMETHEUS_OPERATOR_BRANCH="${PROMETHEUS_OPERATOR_BRANCH:-v0.68.0}"
export ALERT_MANAGER_EXTERNAL_URL="${ALERT_MANAGER_EXTERNAL_URL:-http://localhost:9093}"
# Possible values for "validate yaml" are values from --validate=XXX kubectl option. They are true/false ATM
export VALIDATE_YAML="${VALIDATE_YAML:-true}"
Expand Down
Loading