I'm using on W10 dockerHub 20.10.2 and the embedded kubernetes cluster. I have installed the ingress-nginx controller, without any additional configuration. Then created an ingress service in my namespace following the below yaml. The port is 443 in ingress, but also in the service, deployment, as the docker image is listening to 443.
[EDIT] see below issue is also in HTTP listening to port 4000
budget-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: budget-ingress
labels:
app: budget
namespace: budget-namespace
spec:
rules:
- host: "dwpbudget.com"
http:
paths:
- path: "/"
pathType: Prefix
backend:
service:
name: budget-service
port:
number: 443
However, as shown in the image below, the port remains 80, whereas it should be 443.
the result is of course a 502 error when I'm visiting my page
the describe gives the following
Note that when forwarding the 443 port using kubectl port-forward budget-deployment-59cdb8898d-2zhr4 443:443 -n budget-namespace
, everything is fine.
What am I missing here ?
here is the service yaml file
budget-service.yaml
apiVersion: v1
kind: Service
metadata:
name: budget-service
namespace: budget-namespace
labels:
app: budget
spec:
selector:
app: budget
ports:
- protocol: TCP
port: 443
targetPort: 443
kubectl plugin
responsible for communication withnginx-ingress controller
. As you've posted in the comments under your answer this link, you have provisionednginx-ingress controller
required by anIngress
resource (hence it's working). As for general guideline aboutHTTPS
withnginx-ingress
please take a look here: kubernetes.github.io/ingress-nginx/user-guide/tls – Dawid Kruk