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

feat(ingress): resource backend support added #2109

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

rohitphatak
Copy link
Contributor

What this PR does / why we need it: Added Resource Backend info into Kubernetes Ingress Path.

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality) No Change

Which issue(s) this PR fixes : Ingress having Resource Backend was not showing Resource related information. This PR adds the related information on the resource backend type ingress.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 29, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 29, 2023
@dgrisonnet
Copy link
Member

/triage accepted
/assign

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 29, 2023
@@ -169,7 +169,7 @@ func TestIngressStore(t *testing.T) {
kube_ingress_created{namespace="ns4",ingress="ingress4"} 1.501569018e+09
kube_ingress_labels{namespace="ns4",ingress="ingress4"} 1
kube_ingress_path{namespace="ns4",ingress="ingress4",host="somehost",path="/somepath",service_name="someservice",service_port="1234"} 1
kube_ingress_path{namespace="ns4",ingress="ingress4",host="somehost",path="/somepath2",service_name="",service_port=""} 1
Copy link
Contributor

Choose a reason for hiding this comment

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

QQ: why service_name and service_port are deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CatherineF-dev If the Ingress backend is of resource type, it will not have service_name, service_port. Resource & Service for a backend are mutually exclusive.
Ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#resource-backend

Copy link
Member

@dgrisonnet dgrisonnet left a comment

Choose a reason for hiding this comment

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2023
@dgrisonnet
Copy link
Member

There is also a test failure if you can have a look at https://github.com/kubernetes/kube-state-metrics/actions/runs/5713294513/job/15479589011?pr=2109.

/remove-approve

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2023
@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 29, 2023
@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 5, 2023
@rohitphatak
Copy link
Contributor Author

/assign @dgrisonnet

@dgrisonnet
Copy link
Member

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Oct 11, 2023
@dgrisonnet
Copy link
Member

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 11, 2023
@CatherineF-dev
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CatherineF-dev, dgrisonnet, rohitphatak

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 merged commit 5c71459 into kubernetes:main Oct 11, 2023
12 checks passed
@CatherineF-dev
Copy link
Contributor

@CatherineF-dev
Copy link
Contributor

I tried to reproduce the linter error, but got

make lint

markdownlint-cli2 v0.9.2 (markdownlint v0.30.0)
[Error: EACCES: permission denied, open '/workdir/.markdownlint-cli2.jsonc'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/workdir/.markdownlint-cli2.jsonc'
}

changhyuni pushed a commit to changhyuni/kube-state-metrics that referenced this pull request Nov 19, 2023
* feat(ingress): resource backend support added

* feat(ingress): updated test case

* Update internal/store/ingress.go

Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>

* feat(ingress): updated doc & test cases

---------

Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. 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.

4 participants