Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):
What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
NGINX Ingress controller version: 0.15.0
Kubernetes version (use kubectl version): 1.9.2
uname -a): 3.10.0-514.el7.x86_64What happened:
I used "kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml" to create ingress-nginx. The ingress-nginx container log shows "requeuing sync status, err services "ingress-nginx" not found". Does it mean I should create a service for ingress-nginx? I can not find any infomation in documents. Please show me how to deploy a useable ingress-nginx controller.
What you expected to happen:
The ingress-nginx-controller run normally.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know:
Same log with kubernetes v1.10.3, ingress: nginx-ingress-controller:0.15.0, about 10 logs per second, that's too much.
Also use command"
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml" to deploy, but deploy as "DaemonSet".
@tubzby I will try DaemonSet.
I find it is useful to create a nodeport ingress-nginx service.
I used DaemonSet with hostNetwork: true.
@tubzby So a DaemonSet ingress-nginx-controller with hostNetwork: true has the same error log?
Yes. so far is just annoying logs, ingress is working.
You missed the baremetal step https://kubernetes.github.io/ingress-nginx/deploy/#baremetal
You missed the baremetal step https://kubernetes.github.io/ingress-nginx/deploy/#baremetal
This doesn't strike me as optimal design. So, request arrives at a node, with NodePort, say it's port 80. Then it gets load balanced, potentially to an nginx running in another node, which is totally unnecessary.
In contrast, in my nginx Deployment I have something like:
ports:
- containerPort: 80
hostPort: 8080
- containerPort: 443
hostPort: 8443
With haproxy behind, tunnelling requests to each node that may potentially have nginx running. With hostPort I can ensure there is no further forwarding, hopping from one node to another.
I don't want or need this Service. In the end I create the Service just to silence nginx-IC, but the ClusterIP type instead of NodePort. But it's kind of annoying that nginx IC requires this Service at all.
This doesn't strike me as optimal design.
This is a bit subjective because hostPort is not supported by all the cni providers so by default we only have nodeport or hostnetwork (which has its own problems)
I don't want or need this Service.
Please keep in mind we cannot provide a one-size-fits-all configuration. The service flag in the ingress controller is used to to get information about the node/s or load balancer information required to update the ingress status. We could make this flag optional if --publish-status-address is configured
In the end I create the Service just to silence nginx-IC, but the ClusterIP
Kube on baremetal, i dont need this service too
i create fake service with this manifests and annoying log flood is ended
apiVersion: v1
kind: Service
metadata:
name: ingress-nginx
namespace: ingress-nginx
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP
- name: https
port: 443
targetPort: 443
protocol: TCP
selector:
app: ingress-nginx
In case it helps anyone:
I was getting this issue because I'm using kustomize with namePrefix, I fixed it by overwriting the service name that the controller checks.
# My namespace prefix is "prod-", so I patch `prod-` in front
kubectl patch deployment -n ingress-nginx nginx-ingress-controller --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args/4", "value":"--publish-service=$(POD_NAMESPACE)/prod-ingress-nginx"}]'
+1
Most helpful comment
Kube on baremetal, i dont need this service too
i create fake service with this manifests and annoying log flood is ended