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

Controllers and Leader Election #105

Closed
rikatz opened this issue Jan 4, 2017 · 5 comments · Fixed by #149
Closed

Controllers and Leader Election #105

rikatz opened this issue Jan 4, 2017 · 5 comments · Fixed by #149

Comments

@rikatz
Copy link
Contributor

rikatz commented Jan 4, 2017

I was using the old repo 'github.com/kubernetes/contrib/ingress' and am migrating now for this one.

We use ingress controllers on physical servers (not inside containers running on Kubernetes).

In the contrib version, was possible to use this without any great change (like, install NGINX, copy template, create directories, and run the binary with a kubeconfig file, like this:

KUBECONFIG=/etc/kubernetes/kubeconfig.yaml ./nginx-ingress-controller --default-backend-service=sistema/default-backend --configmap sistema/nginx-load-balancer-conf --alsologtostderr true

Using this version is not possible, as it appears the core package expects some leader election, that depends on a POD_NAME and/or POD_NAMESPACE environment variable.

I've tried to comment out the 'status' block on the code, so there is no leader election. It worked fine, until it tries to sync the tls secret from each ingress controller, as the following:

W0104 16:31:54.533475   44215 queue.go:82] requeuing katz1/teste, err deferring sync till endpoints controller has synced
W0104 16:31:54.542871   44215 queue.go:82] requeuing katz2/teste1.estaleiro.com, err deferring sync till endpoints controller has synced
W0104 16:32:04.544228   44215 controller.go:925] secret katz2/tlsteste2 does not exists

So, I don't know if that's possible to (as other kubernetes components) insert a flag that you can ignore the leader election, so this new ingress controller have the same behaviour as the previous one.

Thanks!

@aledbf
Copy link
Member

aledbf commented Jan 4, 2017

@rikatz you can disable the status removing this https://github.com/kubernetes/ingress/blob/master/core/pkg/ingress/controller/controller.go#L265
I will add a flag to disable the status update (keep in mind this means no status information in the ingress rule)

The error you post is not related to the status, just that secret katz2/tlsteste2 does not exists in the cluster. Please run the controller with the flag --v=3 and check for errors reaching the api server

@rikatz
Copy link
Contributor Author

rikatz commented Jan 5, 2017

@aledbf You're right, the error is not related to the sync. The error is related to controller not being able to get a default SSL certificate. I've created a new secret on the same namespace of configmap and default-backend-service, and configured it's argument.

About disabling the status, I understand that I can lose this when running as a Bare Metal (and not a contianer inside kubernetes), but I can't figure out another way to report this status.

Probably we're going to migrate this inside k8s cluster in the future, but anyway I think it's great that I can run the program inside and outside a cluster.

So, do I leave this issue opened until this is a configurable option? Or should I close this?

Thanks!!

@aledbf
Copy link
Member

aledbf commented Jan 5, 2017

About disabling the status, I understand that I can lose this when running as a Bare Metal (and not a contianer inside kubernetes)

Just in case I'm running this ingress controller without issues (the status reports the IP of the node where is running the pod)

@aledbf
Copy link
Member

aledbf commented Jan 5, 2017

So, do I leave this issue opened until this is a configurable option? Or should I close this?

Leave the issue open so I don't forget to add the flag :)

@rikatz
Copy link
Contributor Author

rikatz commented Jan 5, 2017

OK. If it's just about creating a flag, and making an 'if' statement in the location you've mentioned before, I can do this tomorrow and make a PR.

I just don't know if there's impact in other parts of the ingress controller.

haoqing0110 pushed a commit to stolostron/management-ingress that referenced this issue Mar 5, 2021
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 a pull request may close this issue.

2 participants