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

white listing #1410

Closed
ssinhas opened this issue Sep 22, 2017 · 18 comments
Closed

white listing #1410

ssinhas opened this issue Sep 22, 2017 · 18 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. nginx

Comments

@ssinhas
Copy link

ssinhas commented Sep 22, 2017

we are working on GCP.

We have three namespaces. Jenkins is running on Jenkins namespace.
We are running nginx ingress controller in "dev" namespace.

We created a ingress rule for jenkins which has
ingress.kubernetes.io/whitelist-source-range: 1.2.3.4/32

But this whitelisting doesn't seem like working.

Do I need nginx ingress controlleron jenkins namespace ?
I tried this but doesn't seem like it works.

If I recreate Jenkins ingress, do i have to recreate ingress controller pod again? I did try delete/ create nginx ingress controller couple of times.

How I can make whitelisting work?

I really appreciate any help. I am totally stuck

We are using NGINX: 0.9.0-beta.13 image

@hzxuzhonghu
Copy link
Member

Look into nginx.conf to see if whitelist configured

@ssinhas
Copy link
Author

ssinhas commented Sep 25, 2017

No I don't see it.. I thought ingress rule will update that.

@aledbf aledbf added the nginx label Sep 29, 2017
@egeland
Copy link
Contributor

egeland commented Oct 4, 2017

We're seeing similar issue on beta.14 - we were getting real source IPs in the logs on beta.11, and on .14, we're getting in-cluster IPs.
We're rolling back to .11 to confirm.

@aledbf
Copy link
Member

aledbf commented Oct 8, 2017

Closing. If you are running in GCE you need to add the annotation service.beta.kubernetes.io/external-traffic: OnlyLocal in the service to get the real IP address.

Also please update to NGINX: 0.9.0-beta.15

@aledbf aledbf closed this as completed Oct 8, 2017
@ssinhas
Copy link
Author

ssinhas commented Oct 9, 2017

looks like this solution has been deprecated https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer
Newer Kubernetes versions may stop supporting these after v1.7.

@aledbf
Copy link
Member

aledbf commented Oct 9, 2017

@ssinhas
Copy link
Author

ssinhas commented Oct 11, 2017

can we please change the status to open..
here is my svc file

kind: Service
apiVersion: v1
metadata:
name: jenkins-ui
namespace: jenkins
spec:
type: NodePort
externalTrafficPolicy: Local
selector:
app: master
ports:
- protocol: TCP
port: 8080
targetPort: 8080
name: ui

here is my ingress file
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: jenkins
namespace: jenkins
annotations:
kubernetes.io/ingress.allow-http: "false"
ingress.kubernetes.io/whitelist-source-range: 96.72.176.237/32
spec:
tls:

  • secretName: jenkins-tls
    backend:
    serviceName: jenkins-ui
    servicePort: 8080

upgrade nginx controller 0.9.0-beta.15

whitelisting still don't work

@aledbf aledbf reopened this Oct 11, 2017
@aledbf
Copy link
Member

aledbf commented Oct 11, 2017

@ssinhas please post the ingress pod logs

@aledbf
Copy link
Member

aledbf commented Oct 11, 2017

@ssinhas kubernetes.io/ingress.allow-http: "false" is not supported in the nginx ingress controller

@ssinhas
Copy link
Author

ssinhas commented Oct 11, 2017

it does and it works.. If i access http://...., it does 404 error...

nginx controller logs shows useless info

I1011 22:30:34.176755 5 controller.go:304] backend reload required
I1011 22:30:34.249270 5 controller.go:313] ingress backend successfully reloaded...
I1011 22:31:26.629438 5 status.go:362] updating Ingress jenkins/jenkins status to [{35.202.164.214 }]
I1011 22:31:26.629760 5 status.go:362] updating Ingress lmms-dev/frontend-srv status to [{35.202.164.214 }]
I1011 22:31:26.637448 5 event.go:218] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"jenkins", Name:"jenkins", UID:"62f2dc3a-aded-11e7-86cc-42010a800fe9", APIVersion:"extensions", ResourceVersion:"160311", FieldPath:""}): type: 'Normal' reason: 'UPDATE' Ingress jenkins/jenkins
I1011 22:31:26.639081 5 event.go:218] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"lmms-dev", Name:"frontend-srv", UID:"b3d2107c-aece-11e7-86cc-42010a800fe9", APIVersion:"extensions", ResourceVersion:"160312", FieldPath:""}): type: 'Normal' reason: 'UPDATE' Ingress lmms-dev/frontend-srv
I1011 22:31:29.435068 5 event.go:218] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"jenkins", Name:"jenkins", UID:"62f2dc3a-aded-11e7-86cc-42010a800fe9", APIVersion:"extensions", ResourceVersion:"160317", FieldPath:""}): type: 'Normal' reason: 'UPDATE' Ingress jenkins/jenkins
I1011 22:31:30.846694 5 controller.go:304] backend reload required
I1011 22:31:30.924577 5 controller.go:313] ingress backend successfully reloaded...
I1011 22:31:32.639500 5 event.go:218] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"lmms-dev", Name:"frontend-srv", UID:"b3d2107c-aece-11e7-86cc-42010a800fe9", APIVersion:"extensions", ResourceVersion:"160321", FieldPath:""}): type: 'Normal' reason: 'UPDATE' Ingress lmms-dev/frontend-srv
I1011 22:31:34.177172 5 controller.go:304] backend reload required
I1011 22:31:34.248345 5 controller.go:313] ingress backend successfully reloaded..

@aledbf
Copy link
Member

aledbf commented Oct 11, 2017

@ssinhas please make some requests to 35.202.164.214. That should appear in the log.
(I want to see the client IP address)

@ssinhas
Copy link
Author

ssinhas commented Oct 11, 2017

i am not sure what service is running 35.202.164.214

updating Ingress jenkins/jenkins status to [{35.202.164.214 }]

what does it even mean?

@aledbf
Copy link
Member

aledbf commented Oct 11, 2017

what does it even mean?

That is the IP of the node where the pod of the ingress controller it's running.

@aledbf
Copy link
Member

aledbf commented Oct 11, 2017

externalTrafficPolicy: Local

That must be used in the ingress service, not in the jenkins one.

@ssinhas
Copy link
Author

ssinhas commented Oct 12, 2017

I did that one too.. still doesn't work

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 11, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 11, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. nginx
Projects
None yet
Development

No branches or pull requests

6 participants