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

Remove _ssl_expire_time_seconds metric by identifier #9706

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

Lyt99
Copy link
Contributor

@Lyt99 Lyt99 commented Mar 8, 2023

What this PR does / why we need it:

This PR added a new label identifier for _ssl_expire_time_seconds metric, which has the same meaning as the label in _ssl_certificate_info.
When your TLS configuration changed, it will try to remove _ssl_expire_time_seconds by identifier, instead of host.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

How Has This Been Tested?

Follow the instructions in #9705.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.
  • Added Release Notes.

Does my pull request need a release note?

Any user-visible or operator-visible change qualifies for a release note. This could be a:

  • CLI change
  • API change
  • UI change
  • configuration schema change
  • behavioral change
  • change in non-functional attributes such as efficiency or availability, availability of a new platform
  • a warning about a deprecation
  • fix of a previous Known Issue
  • fix of a vulnerability (CVE)

No release notes are required for changes to the following:

  • Tests
  • Build infrastructure
  • Fixes for unreleased bugs

For more tips on writing good release notes, check out the Release Notes Handbook

PLACE RELEASE NOTES HERE

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 8, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @Lyt99. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 8, 2023
@Lyt99 Lyt99 force-pushed the ssl-expire-metric branch 2 times, most recently from fc32aee to faa63c4 Compare March 9, 2023 06:36
@longwuyuan
Copy link
Contributor

I am not a developer so I can't comment on the code but I did test this and I discovered that at least on a grafana dashboard, with a query like

avg(nginx_ingress_controller_ssl_expire_time_seconds{kubernetes_pod_name=~"$controller",namespace=~"$namespace",ingress=~"$ingress"}) by (host) - time()

I can see still the hostname of the ingress, where I have deleted the TLS section (and also deleted the secret from the namespace).

/triage accepted
/kind bug
/priority important-longterm

But there are many many nuances to this like I will seek to check ;

  • that this "seconds" is a prometheus metric of type guage
  • that this metric is not being deleted very quickly after deleting the TLS section in the ingress, but may get deleted later
  • that a "average" is being checked in this query and that is a valid query
  • other such validations

I hope this PR is not going to introduce a new problem because there is no extensive test-data here for all the real-world scenes

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Mar 9, 2023
Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will run test first

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 10, 2023
Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will run test first

/ok-to-test

@longwuyuan
Copy link
Contributor

I am not certain if CI has a test for this.
I just want to comment that raw query in prometheus has a metric like this which returns all certs ever used, even the deleted ones
image

From above list the last 2 are deleted already
image

@longwuyuan
Copy link
Contributor

And I m also unsure if the change proposed will not cause any new problems

@github-actions
Copy link

This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev on Kubernetes Slack.

@github-actions github-actions bot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Apr 25, 2023
@k8s-triage-robot
Copy link

The lifecycle/frozen label can not be applied to PRs.

This bot removes lifecycle/frozen from PRs because:

  • Commenting /lifecycle frozen on a PR has not worked since March 2021
  • PRs that remain open for >150 days are unlikely to be easily rebased

You can:

  • Rebase this PR and attempt to get it merged
  • Close this PR with /close

Please send feedback to sig-contributor-experience at kubernetes/community.

/remove-lifecycle frozen

@k8s-ci-robot k8s-ci-robot removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Apr 25, 2023
@tao12345666333
Copy link
Member

/assign

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 31, 2023
@Lyt99 Lyt99 force-pushed the ssl-expire-metric branch from faa63c4 to 140ba31 Compare September 1, 2023 02:09
@netlify
Copy link

netlify bot commented Sep 1, 2023

Deploy Preview for kubernetes-ingress-nginx canceled.

Name Link
🔨 Latest commit 140ba3182d89016ba8a5639f1c7941209f99ec1c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-ingress-nginx/deploys/64f147cd7e574a00082ad670

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2023
@ndlanier
Copy link

Is there any update on this?

@tao12345666333
Copy link
Member

There is only this one small nit.
We can solve the problems we have encountered with other parts.
Please update the comments and pull the code from the main branch for rebase.
Then we can move forward. Thank you!

@tao12345666333
Copy link
Member

/retest

@Lyt99 Lyt99 force-pushed the ssl-expire-metric branch from 140ba31 to 00d32b2 Compare April 1, 2024 02:35
Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for kubernetes-ingress-nginx canceled.

Name Link
🔨 Latest commit 00d32b2
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-ingress-nginx/deploys/660a1d56d13d790008ef9371

@Lyt99
Copy link
Contributor Author

Lyt99 commented Apr 1, 2024

@tao12345666333 Hi, I've updated the comment and rebase the main branch.

Thank you!

Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 8, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Lyt99, tao12345666333

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2024
@tao12345666333
Copy link
Member

/cherry-pick release-1.10

@k8s-infra-cherrypick-robot
Copy link
Contributor

@tao12345666333: once the present PR merges, I will cherry-pick it on top of release-1.10 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot merged commit b4cae70 into kubernetes:main Apr 8, 2024
27 checks passed
@k8s-infra-cherrypick-robot
Copy link
Contributor

@tao12345666333: new pull request created: #11236

In response to this:

/cherry-pick release-1.10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Gacko
Copy link
Member

Gacko commented Apr 9, 2024

It seems CI on main and release-1.10 is more up-to-date than the source branch and therefore fails in the cherry-pick.

@Gacko
Copy link
Member

Gacko commented Apr 9, 2024

https://github.com/kubernetes/ingress-nginx/actions/runs/8605616383/job/23582254336?pr=11236

But can't tell the reason, at least this wasn't changed in your PR.

@Lyt99
Copy link
Contributor Author

Lyt99 commented Apr 9, 2024

But can't tell the reason, at least this wasn't changed in your PR.

#11228 made an upgrade for google.golang.org/grpc to v1.63.0, which seemed to introduce the deprecation of Dial().

But gprc v1.63.1 removed the deprecation tag . Upgrading to this version should solve the lint problem.

@Gacko
Copy link
Member

Gacko commented Apr 9, 2024

... damn, you're good! Thanks for the quick investigation! Do you want to file a PR for bumping it? That would be nice. Just tag me, I'll lgtm it then.

@Gacko
Copy link
Member

Gacko commented Apr 9, 2024

/cherry-pick release-1.10

@k8s-infra-cherrypick-robot
Copy link
Contributor

@Gacko: new pull request created: #11239

In response to this:

/cherry-pick release-1.10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants