best-wall-17038
09/04/2022, 9:47 PMkubectl get svc -n nginx
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-nginx-ingress LoadBalancer 10.43.49.252 192.168.178.38 80:32277/TCP,443:32004/TCP 50d
aloof-controller-49647
09/05/2022, 9:02 AMlocalhost
. Host is not required.best-wall-17038
09/05/2022, 9:06 AM192.168.178.38
.. What I am doing wrong?aloof-controller-49647
09/05/2022, 11:31 AMbest-wall-17038
09/05/2022, 11:31 AMaloof-controller-49647
09/05/2022, 11:32 AMbest-wall-17038
09/05/2022, 11:32 AMaloof-controller-49647
09/05/2022, 11:32 AMbest-wall-17038
09/05/2022, 11:33 AMapiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: Ingress
metadata:
name: {{ include "frontend-service.fullname" . }}
namespace: comnext
annotations:
<http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>: "nginx"
<http://nginx.ingress.kubernetes.io/service-upstream|nginx.ingress.kubernetes.io/service-upstream>: "true"
<http://nginx.ingress.kubernetes.io/configuration-snippet|nginx.ingress.kubernetes.io/configuration-snippet>: |
proxy_set_header l5d-dst-override frontend-service.comnext.svc.cluster.local;
proxy_hide_header l5d-remote-ip;
proxy_hide_header l5d-server-id;
spec:
rules:
- host: localhost
http:
paths:
- backend:
service:
name: frontend-service
port:
number: 80
path: /
pathType: ImplementationSpecific
aloof-controller-49647
09/05/2022, 11:33 AMorange-tent-50778
09/06/2022, 12:40 PMkubectl explain --api-version=<http://networking.k8s.io/v1|networking.k8s.io/v1> Ingress.spec.ingressClassName
you will see:
DESCRIPTION:
IngressClassName is the name of the IngressClass cluster resource. The
associated IngressClass defines which controller will implement the
resource. This replaces the deprecated `<http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>`
annotation.
So at some point, you will need to remove the <http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>
annotation and change your spec
section to:
spec:
ingressClassName: nginx
rules:
- host: localhost
http:
paths:
- backend:
service:
name: frontend-service
port:
number: 80
path: /
pathType: ImplementationSpecific
best-wall-17038
09/06/2022, 3:09 PMorange-tent-50778
09/06/2022, 4:07 PMapiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: Ingress
metadata:
annotations:
<http://cert-manager.io/duration|cert-manager.io/duration>: 2160h
<http://cert-manager.io/issuer|cert-manager.io/issuer>: self-signed
<http://cert-manager.io/renew-before|cert-manager.io/renew-before>: 720h
<http://nginx.ingress.kubernetes.io/proxy-body-size|nginx.ingress.kubernetes.io/proxy-body-size>: 250m
creationTimestamp: "2022-09-05T14:23:41Z"
generation: 1
name: thecombine
namespace: thecombine
resourceVersion: "4294"
uid: 7dbe724d-a005-4bce-9d89-a104507b93fc
spec:
ingressClassName: nginx
rules:
- host: thecombine.local
http:
paths:
- backend:
service:
name: frontend
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- thecombine.local
secretName: thecombine-local-tls
status:
{}
I am using helm so I removed the parts added by it. I am also using cert-manager.io to create a self-signed certificate.
Secondly, I have updated my /etc/hosts
to contain:
127.0.0.1 localhost thecombine.local
Last of all, I setup the port forwarding in Rancher Desktop to forward 37700 to the ingress-nginx
https port. Now I can access my front end by navigating to <https://thecombine.local:37700>
. Since it has a self-signed certificate, I need to assure the browser that I know what I am doing and accept the risk.best-wall-17038
09/06/2022, 5:03 PM