-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Clarify docs around running nginx ingress controller without serviceaccounts #1639
Comments
@sgsits please check ir your ingress controller image version is |
thanks |
Now I am getting following error F0826 16:03:31.076649 1 main.go:121] no service with name default/default-http-backend found: Get http://localhost:8080/api/v1/namespaces/default/services/default-http-backend: dial tcp [::1]:8080: getsockopt: connection refused |
@sgsits like this |
I should have clarified this earlier, I am running the ingress controller in Kubernetes cluster as a pod (using replicationController) I am wondering why it is trying to find Master using localhost. |
One of the reason could be because Also provide more information about your cluster:
|
Thanks again.
I observer that the kubernetes service is only available on HTTPS And inside my ingress controller it is not available on 8080, below are the ENV from within my ingress controller pod (( NOTE : I have manually passed KUBERNETES_MASTER using pod envs) [app@sandbox-132869446-1-154153755 ~]$ kubectl exec nginx-ingress-controller-belmg env | grep KUBER I am wondering how to make kubernetes service available on HTTP (against HTTPS) |
This works only if you set |
Can you share the reason for this? |
Apologies for delay. No good reason to use non TLS but we are in phase 1 implementation and have not yet achieved integration with our cert authority (using self signed is not what we are allowed). This cluster is running internally so for now we are testing without SSL. Going back to my question Are you saying that nginx-ingress-controller will not be able to communicate with default kubernetes service unless the pod contains secrets in /var/run/secrets/kubernetes.io/serviceaccount/token? I also tried using --insecure-bind-address=0.0.0.0 --insecure-port=8080 [app@sandbox-132869446-1-155337960 ~]$ kubectl describe service kubernetes Since I am going to spin up nginx-ingress-controller as a infrastructure pod, I don't want to hardcode/inject the Master URL in it. How could I make it use the kubernetes service to |
That is expected. The api server can listen in both ports.
No. If you enable a service account the token will be mounted in all the pods and the env vars KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT added.
That is a restriction that will affect other parts like the dns addon (or any other pod that requires interaction with the api server).
This is not required if the cluster is configured correctly. |
I was able to consume the kubernetes (kubectl get svc kubernetes) service from inside the pod after enabling serviceaccounts. However I think non TLS communication from inside pod to kubernetes clusterIP/service is no longer supported |
sounds like the issue was resolved, I'm only too happy to force people to use tls. |
Thanks prashanth, will it be possible to share some details on production readiness for nginx ingress controller. Is it ready yet to be deployed to production environment, if not are there any rough/tentative timelines on it? |
Just in case someone comes here and has the same issue I did: In my case, I had this behavior because of another k8s issue in which serviceaccounts are enabled, but the token is not populated: kubernetes/kubernetes#27973 To determine if you have this issue, look in your container and see if /var/run/secrets/kubernetes.io/serviceaccount/token is there. In my case, the serviceaccount directory existed ( proving that i have enabled serviceaccounts correctly), but the token file is no there. |
Issues go stale after 30d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I am running a Kubernetes cluster without TLS (no ca/tokens etc)
I am unable to run nginx-ingress-controller due to following errror
I0825 16:53:47.191547 1 main.go:99] Using build: https://github.com/bprashanth/contrib.git - git-b195d9b
F0825 16:53:47.191966 1 main.go:121] failed to create client: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory
Why is config.go>InClusterConfig() is forcing presence of serviceaccount and ca files.
I should be able to run it in unsecure environment.
The text was updated successfully, but these errors were encountered: