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
Fix L7 firewall rule sync errors #1462
Fix L7 firewall rule sync errors #1462
Conversation
Hi @gabihodoroaga. 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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
…to fix-firewall-rules
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gabihodoroaga The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In master branch, support for EndpointSlices has been added but the bug remains the same. for this configuration apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- name: http
containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
annotations:
cloud.google.com/neg: '{"ingress": true}'
spec:
type: NodePort
ports:
- port: 80
targetPort: http
selector:
app: nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
spec:
rules:
- host: ""
http:
paths:
- path: /*
pathType: ImplementationSpecific
backend:
service:
name: nginx-service
port:
number: 80
the controller fails to properly create the firewall rules, does not add the port 80 to the list of the accepted pots, and the health checks are failing. |
The issue with the named service port has been fixed by @alan-kut in this commit 302fdc0. I removed all my code and kept the master version. The second issue related to firewall rule with empty port is still there. When the list of the ports is empty (no valid service found), a firewall rule is generated with protocol tcp and an empty port list. allowed:
- IPProtocol: tcp
...
sourceRanges:
- 35.191.0.0/16
- 130.211.0.0/22 This means UNRESTRICTED access to any port according to the documentation This can be easily reproduced by creating an empty ingress with non-existing default service. apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
spec:
defaultBackend:
service:
name: nonexisting-service
port:
number: 80 |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
Fix issue #1461
Short description of what changed
utils.ServicePort
structGatherEndpointPorts
GatherEndpointPorts
FirewallRules.Sync