-
Notifications
You must be signed in to change notification settings - Fork 26
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
add setup-prometheus-adapter #1012
Conversation
Makefile
Outdated
setup-prometheus-adapter: ## Setup prometheus adapter for VerticaAutoscaler | ||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | ||
helm repo update | ||
helm install prometheus-adapter prometheus-community/prometheus-adapter --namespace monitoring --create-namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the release name and namespace a parameter. Default release name and namespace can be prometheus-adapter.
- There must be an undeploy command too
- The user must be able to set the prometheus url, prometheus port , the number of replicas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- add PROMETHEUS_ADAPTER_NAME and PROMETHEUS_ADAPTER_NAMESPACE
- added undeploy-prometheus-adapter
- added example values with
--set prometheus.url
,--set prometheus.port
, and--set replicas
. I will make them configurable later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at Hao's PR. I think his PR needs to go in before yours, because I would like you to test the dapter when prometheus is running.
Co-authored-by: Roy Paulin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update Hao's test case
Makefile
Outdated
PROMETHEUS_ADAPTER_NAMESPACE ?= prometheus-adapter | ||
PROMETHEUS_ADAPTER_REPLICAS ?= 1 | ||
# The Prometheus service URL and port for Prometheus adapter to connect to | ||
PROMETHEUS_URL ?= http://prometheus.default.svc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PROMETHEUS_URL ?= http://prometheus.default.svc | |
PROMETHEUS_URL ?= http://$(PROMETHEUS_HELM_NAME)-kube-prometheus-prometheus.$(PROMETHEUS_NAMESPACE).svc |
Also move the adapter variables ddfinition after prometheus'
Makefile
Outdated
deploy-prometheus-adapter: ## Setup prometheus adapter for VerticaAutoscaler | ||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | ||
helm repo update | ||
helm install $(DEPLOY_WAIT) -n ${PROMETHEUS_ADAPTER_NAMESPACE} --create-namespace ${PROMETHEUS_ADAPTER_NAME} prometheus-community/prometheus-adapter --values prometheus/adapter.yaml --set prometheus.url=${PROMETHEUS_URL} --set prometheus.port=${PROMETHEUS_PORT} --set replicas=${PROMETHEUS_ADAPTER_REPLICAS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helm install $(DEPLOY_WAIT) -n ${PROMETHEUS_ADAPTER_NAMESPACE} --create-namespace ${PROMETHEUS_ADAPTER_NAME} prometheus-community/prometheus-adapter --values prometheus/adapter.yaml --set prometheus.url=${PROMETHEUS_URL} --set prometheus.port=${PROMETHEUS_PORT} --set replicas=${PROMETHEUS_ADAPTER_REPLICAS} | |
helm install $(DEPLOY_WAIT) -n ${PROMETHEUS_ADAPTER_NAMESPACE} --create-namespace ${PROMETHEUS_ADAPTER_NAME} prometheus-community/prometheus-adapter --values prometheus/adapter.yaml --set prometheus.url=${PROMETHEUS_URL} --set prometheus.port=${PROMETHEUS_PORT} --set replicas=${PROMETHEUS_ADAPTER_REPLICAS} $(PROMETHEUS_ADAPTER_HELM_OVERRIDES) |
Add PROMETHEUS_ADAPTER_HELM_OVERRIDES that we can use to set more fields.
prometheus/adapter.yaml
Outdated
prometheus: | ||
url: http://prometheus.default.svc | ||
port: 9090 | ||
path: "" | ||
|
||
# Number of prometheus adapter instances | ||
replicas: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prometheus: | |
url: http://prometheus.default.svc | |
port: 9090 | |
path: "" | |
# Number of prometheus adapter instances | |
replicas: 1 |
This is not needed. The default replica is already 1
@roypaulin If a vdb has sandboxes, how do we exclude them when collecting metrics? |
It can be done on prometheus by setting the service monitor to target only specific subclusters, but We do not need to exclude them, the hpa will select only subclusters that match the service name specified in the CR. |
Makefile
Outdated
DB_USER?=dbadmin | ||
DB_PASSWORD?= | ||
VDB_NAME?=verticadb-sample | ||
VDB_NAMESPACE?=default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these next to other prometheus variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you address this?
Try prometheus-sanity first on your local machine to make sure it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Can you also update DEVELOPER.md like Hao did in his open PR?
Makefile
Outdated
DB_USER?=dbadmin | ||
DB_PASSWORD?= | ||
VDB_NAME?=verticadb-sample | ||
VDB_NAMESPACE?=default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you address this?
To scale up/down the Vertica DB subcluster size based on prometheus metrics, we need to install the prometheus adapter. This PR provided a way to deploy the promutheus adapter in our e2e test environment.