-
Notifications
You must be signed in to change notification settings - Fork 370
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
Nodeport and Network Policies #1580
Comments
yes. but not scoped for the next few releases at least. @jianjuns mentioned it also needs NodePort support with AntreaProxy before we could implement such network policies with Antrea. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment, or this will be closed in 180 days |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment, or this will be closed in 180 days |
@salv-orlando @GraysonWu @vicky-liu : there are customers requesting this feature. Could we evaluate and decide a release plan? |
If I understand this issue correctly, we want our network policy could control the external access to a NodePort Service. I have some draft ideas, share them here: First of all, in most cases, users are using Antrea proxyAll will perform DNAT before sending NodePort traffic to OVS, changing the destination IP to a virtual IP. So for the destination matching, we could leverage our Unfortunitly, ingress tables are tables after
For me, I think 1. will be better. 2 & 3 are kind mess around our implementation by this special case. Glad to hear your opinions and other good ideas. Thanks! @tnqn @jianjuns @hongliangl @salv-orlando For the API-wise, I think policies like below looks good? apiVersion: crd.antrea.io/v1alpha1
kind: ClusterNetworkPolicy
metadata:
name: default-deny-all
spec:
priority: 1
tier: Baseline
appliedTo:
- serviceReference:
name: svc-a
ns: ns-a
ingress:
- action: Drop
apiVersion: crd.antrea.io/v1alpha1
kind: ClusterNetworkPolicy
metadata:
name: allow-my-client
spec:
priority: 1
tier: Application
appliedTo:
- serviceReference:
name: svc-a
ns: ns-a
ingress:
- action: Allow
ipBlock:
cidr: x.x.x.x/32 |
@GraysonWu Your approach 1) sounds good to me. For API, probably we should explicitly call out it is NodePort Service (e.g. changing serviceReference to nodePortService). |
1 makes more sense to me, For API, I wonder if this approach can work with ClusterIP, LoadbalancerIPs too. I guess yes. Should we just name it |
Humm, it might make sense to Service of LoadBalancer type too when using with ExternalIP management or MetalLB, probably not for ClusterIP though. I am fine with |
Oh, if this is the case, then it will be easier.
Yes, since no matter what type of Service, with AntreaProxy, we can use its groupID to match traffic. |
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
Fixes antrea-io#1580 With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Signed-off-by: wgrayson <[email protected]>
With this PR users could use ACNP to control the external access of a Nodeport service. 1. Add `service` field in `appliedTo` of ACNP. 2. Add `Service` in `AppliedToGroup` and appliedToGroup with `Service` will span to all Nodes. 3. Use groupIDs of a Service to do destination matching. 4. Use `ct_nw_src` to do source matching. Fixes #1580 Signed-off-by: wgrayson <[email protected]>
Describe the problem/challenge you have
I have external (known) clients to the private Kubernetes cluster that I run that need access to some of the pods in my cluster. To simplify the process, I want to expose these pods via nodeport and by using other tools, I can create a Service Registry on these exposed pods for my clients to consume. I would like to secure this solution using network policies so that I can have a default deny all policy but allow ingress traffic from my external clients only.
Describe the solution you'd like
Looking at Calico, it seems there is a feature that covers this use-case. I imagine that an Antrea solution could be similar but I'm open to other ideas.
Anything else you would like to add?
I appreciate the help.
The text was updated successfully, but these errors were encountered: