-
Notifications
You must be signed in to change notification settings - Fork 56
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(testkube): add networkpolicy support #784
base: develop
Are you sure you want to change the base?
feat(testkube): add networkpolicy support #784
Conversation
egress: | ||
- to: | ||
- podSelector: | ||
matchLabels: |
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.
Can this be done similar to how services use a helper method? Example https://github.com/kubeshop/helm-charts/blob/develop/charts/testkube-api/templates/service.yaml#L27
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.
feel free to refactor to your hearts content
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.
could you assist? :)
namespace: testkube | ||
spec: | ||
podSelector: | ||
matchLabels: |
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.
same as above comment for selector
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 9443 |
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.
Can this also be referenced through a param?
egress: | ||
- to: | ||
- podSelector: | ||
matchLabels: |
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.
same comment for selectors
port: 4222 | ||
- to: | ||
- podSelector: | ||
matchLabels: |
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.
same comment for selectors, they should be used through a helper funcion (from the mongodb chart?)
ports: | ||
- protocol: TCP | ||
port: 4222 | ||
- to: |
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 might need to be dynamic if mongodb is disabled (customer is bringing own mongo)
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 agree, idea is good. we need to remove hard code parts, - namespace, ports. etc
Could this support CiliumNetworkPolicy as well? Some inspiration could be taken from datadogs implementation https://github.com/DataDog/helm-charts/blob/61736e9132b9a44a268ae266bc45c99f78a7491e/charts/datadog/values.yaml#L798 |
Just wanted to mention these rules are still valid against the 2.0.17 Helm chart. |
Pull request description
Adds Network Policies support
Checklist (choose whats happened)
Breaking changes
Changes
Fixes
Additional Info
This will be useful to those folks who use network policies with a default-deny configuration. Only Testkube-specific traffic has been accommodated for and by default, these resources will not be created (must enable in values.yaml). I came up with these rules by watching for PacketDrop events (provided by kube-iptables-tailor) in the testkube namespace while running my Test Suites, etc. Hopefully, I didn't miss anything! Also, I am still on 1.16.64 so I added support for the dashboard if enabled.
I didn't update the README as I came to believe it may be auto-generated. LMK if I'm wrong and I'll be happy to update accordingly.
To see the template rendered:
Now from inside the testkube chart directory