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(kmesh-cp) add kubernetes tags automatically #3439

Merged
merged 3 commits into from
Dec 13, 2021

Conversation

jakubdyszkiewicz
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz commented Dec 7, 2021

Summary

Add k8s.kuma.io/namespace tag automatically so we can build policy based on it.

Issues resolved

Fix #3367

Documentation

Testing

  • Unit tests
  • E2E tests
  • No testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • No changes in UPGRADE.md
  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Copy link
Contributor

@lahabana lahabana left a comment

Choose a reason for hiding this comment

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

Nice! I have a couple of comments but this change LGTM!

@@ -12,6 +12,8 @@ import (
util_k8s "github.com/kumahq/kuma/pkg/plugins/runtime/k8s/util"
)

const NamespaceTag = "k8s.kuma.io/namespace"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we add a k8s.kuma.io/port the point was to be able to use the port in virtual-outbound.

Copy link
Contributor

Choose a reason for hiding this comment

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

And maybe k8s.kuma.io/service which is the serviceName in k8s. That way you have the info in kuma.io/service in separate tags.
Usage of k8s.kuma.io/service would be for example adding policy to services exposed on all pods (.e.g metrics)

Copy link
Contributor

Choose a reason for hiding this comment

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

@jakubdyszkiewicz said:

I think that k8s.kuma.io/port is a bit generic. It always raises the question of “but what port?“. Should this be k8s.kuma.io/service-port?

I don't really mind either way so if you think service-port is better go for it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added. I also put k8s.kuma.io/service-name. Although -name suffix sounds redundant, I find k8s.kuma.io/service to be too close to kuma.io/service

pkg/plugins/runtime/k8s/controllers/pod_converter_test.go Outdated Show resolved Hide resolved
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz marked this pull request as ready for review December 8, 2021 12:01
@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team as a code owner December 8, 2021 12:01
@lahabana lahabana linked an issue Dec 8, 2021 that may be closed by this pull request
@jakubdyszkiewicz jakubdyszkiewicz merged commit 19b4a04 into master Dec 13, 2021
@jakubdyszkiewicz jakubdyszkiewicz deleted the feat/kube-tags branch December 13, 2021 10:08
mergify bot pushed a commit that referenced this pull request Dec 13, 2021
(cherry picked from commit 19b4a04)

# Conflicts:
#	pkg/plugins/runtime/k8s/controllers/inbound_converter.go
jakubdyszkiewicz added a commit that referenced this pull request Dec 13, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
lahabana pushed a commit that referenced this pull request Dec 13, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>

Co-authored-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto add labels for useful pod info
2 participants