-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove metrics logic from cmd/anisble-operator/main.go #3466
Remove metrics logic from cmd/anisble-operator/main.go #3466
Conversation
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.
We can also remove these lines, I think:
operator-sdk/internal/scaffold/role.go
Lines 329 to 356 in 6a36023
- apiGroups: | |
- monitoring.coreos.com | |
resources: | |
- servicemonitors | |
verbs: | |
- "get" | |
- "create" | |
- apiGroups: | |
- apps | |
resources: | |
- deployments/finalizers | |
resourceNames: | |
- {{ .ProjectName }} | |
verbs: | |
- "update" | |
- apiGroups: | |
- "" | |
resources: | |
- pods | |
verbs: | |
- get | |
- apiGroups: | |
- apps | |
resources: | |
- replicasets | |
- deployments | |
verbs: | |
- get |
hack/tests/e2e-ansible.sh
Outdated
# header_text "verify that the metrics endpoint exists (Port 8686)" | ||
# if ! timeout 1m bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sfo /dev/null http://memcached-operator-metrics:8686/metrics; do sleep 1; done"; | ||
# then | ||
# error_text "FAIL: Failed to verify that metrics endpoint exists" | ||
# operator_logs | ||
# exit 1 | ||
# fi |
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.
This can be fully removed since port 8686 is only for the legacy kube-state-metrics stuff that's being removed.
# exit 1 | ||
# fi | ||
|
||
# header_text "verify that the metrics endpoint exists (Port 8383)" |
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 a TODO here to add a --metrics-addr
flag to the ansible operator and default it to 8080.
See #3440
Once we have an equivalent PR merged for ansible, we'll need to update this port to be 8080.
hack/tests/e2e-ansible.sh
Outdated
exit 1 | ||
fi | ||
# header_text "verify that metrics reflect cr creation" | ||
# if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8686/metrics | grep example-memcached; do sleep 1; done"; |
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.
Since the metric is now on 8383 via the instrumented handler:
# if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8686/metrics | grep example-memcached; do sleep 1; done"; | |
# if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8383/metrics | grep example-memcached; do sleep 1; done"; |
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.
/lgtm
Once the unit tests pass.
e1f9e1b
to
92181b0
Compare
New changes are detected. LGTM label has been removed. |
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.
LGTM, though it needs a rebase
breaking: true | ||
migration: | ||
header: Remove legacy metrics generation code from cmd/ansible-operator/main.go, and tests/e2e-anisble.sh checks for servicemonitor. | ||
body: TBD |
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.
nit space
92181b0
to
dd55394
Compare
dd55394
to
d69ae93
Compare
Description: Remove kubemetrics package reference logic from cmd/ansible-operator/main.go.
Remove corresponding checks from hack/tests/e2e-ansible.sh
Motivation: Now that we have handler to setup metrics on primary resources using handler.InstrumentedEnqueueRequestForObject{}, we do not separate KubeMetrics to setup metrics.