-
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/helm-operator/main.go #3451
Remove metrics logic from cmd/helm-operator/main.go #3451
Conversation
@@ -16,17 +16,14 @@ package main | |||
|
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.
Is not missing remove from cmd/ansible-operator/main.go
as well?
Also, should we not add the fragment here with 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.
will be doing separate PR for Ansible, and regarding fragment I had a question if we are adding individual fragments for removal PRs. As in the meeting, some one was saying about doing one big Fragment with all PRs. I just need clarification on that.
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 add many fragments in the same pr. IMO we can do all in the same PR as we are doing in the other cases to be easier to check that and we do not miss anything.
- remove addmetrics impl from anisble and helm
- remove the pkg/kube-metrics
- remove what is not long used from pkg/k8sutil
- add 4 fragments so far 1 for ansible, 1 for helm, 1 for pkg/kube-metrics, 1 for the pkg/utils removed funcs
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.
Yeah, we should add individual removal fragments. Those require migration sections, but we're doing this:
migration:
header: <what got removed>
body: TBD
Then when we go to do the release, we'll run the generator and then rewrite the release notes, using what's there to remind us what to cover.
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.
okay, Ill follow above template, and add fragment for this PR.
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.
return err | ||
} | ||
return nil | ||
} |
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.
Need to also:
- remove the check for the service monitor in
hack/tests/e2e-helm.sh
- remove the
env
section for the pod spec template ininternal/plugins/helm/v1/scaffolds/templates/manager/config.go
…m podspec template from helm plugin scaffold
053a754
to
e31105b
Compare
hack/tests/e2e-helm.sh
Outdated
metrics_service="nginx-operator-controller-manager-metrics-service" | ||
|
||
# verify that metrics service was created | ||
if ! timeout 60s bash -c -- "until kubectl get service/${metrics_service} --namespace=${operator_namespace} > /dev/null 2>&1; do sleep 1; done"; | ||
then | ||
error_text "Failed to get metrics service" | ||
operator_logs | ||
exit 1 | ||
fi | ||
|
||
|
||
serviceaccount_secret=$(kubectl get serviceaccounts default -n ${operator_namespace} -o jsonpath='{.secrets[0].name}') | ||
token=$(kubectl get secret ${serviceaccount_secret} -n ${operator_namespace} -o jsonpath={.data.token} | base64 -d) | ||
|
||
# verify that the metrics endpoint exists | ||
if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never --namespace=${operator_namespace} test-metrics --image=${metrics_test_image} -- -sfkH \"Authorization: Bearer ${token}\" https://${metrics_service}:8443/metrics; do sleep 1; done"; | ||
then | ||
error_text "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.
All of this should be kept. We still have a metrics service in the Kubebuilder layout, but it is created alongside the operator as part of the kustomize manifests.
The only thing we need to remove from the e2e is the test for the presence of the servicemonitors/nginx-operator-metrics
(which you've already 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
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.
I'd prefer to do all in the same PR. But, I am OK with it.
/lgtm
Description: Remove kubemetrics package reference logic from
cmd/helm-operator/main.go
.Motivation: Now that we have handler to setup metrics on primary resources using
handler.InstrumentedEnqueueRequestForObject{}
, we do not separateKubeMetrics
to setup metrics.Partially closes, #3354