Solve this question on: ssh cluster3-controlplane
There is a deployment nginx-deployment-cka04-svcn in cluster3 which is exposed using service nginx-service-cka04-svcn.
Create an ingress resource nginx-ingress-cka04-svcn to load balance the incoming traffic with the following specifications:
pathType: Prefix and path: /
Backend Service Name: nginx-service-cka04-svcn
Backend Service Port: 80
ssl-redirect is set to false
**my solution**
cluster3-controlplane ~ ➜ k get ingressclasses.networking.k8s.io -A
NAME CONTROLLER PARAMETERS AGE
traefik traefik.io/ingress-controller 3h20m
cluster3-controlplane ~ ➜ cat nginx-ingress-cka04-svcn.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress-cka04-svcn
annotations:
traefik.ingress.kubernetes.io/ssl-redirect: “false”
spec:
ingressClassName: traefik
rules:
- http:
paths:- path: /
pathType: Prefix
backend:
service:
name: nginx-service-cka04-svcn
port:
number: 80
- path: /
cluster3-controlplane ~ ➜
my solution is marked wrong even
cluster3-controlplane ~ ➜ k get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
nginx-ingress-cka04-svcn traefik * 10.244.116.188 80 83m
cluster3-controlplane ~ ➜ curl 10.244.116.188
<html>
<head><title>Hello World!</title>
<style> html { font-size: 500.0%; } div { text-align: center; } </style>
</head>
<body>
<div>Hello World!</div>
</body>
</html>
cluster3-controlplane ~ ➜
why ?? there is already an traefic ingress controller given.