{
"clientVersion": {
"major": "1",
"minor": "25",
"gitVersion": "v1.25.9",
"gitCommit": "a1a87a0a2bcd605820920c6b0e618a8ab7d117d4",
"gitTreeState": "clean",
"buildDate": "2023-04-12T12:16:51Z",
"goVersion": "go1.19.8",
"compiler": "gc",
"platform": "windows/amd64"
},
"kustomizeVersion": "v4.5.7",
"serverVersion": {
"major": "1",
"minor": "26",
"gitVersion": "v1.26.3",
"gitCommit": "9e644106593f3f4aa98f8a84b23db5fa378900bd",
"gitTreeState": "clean",
"buildDate": "2023-03-15T13:33:12Z",
"goVersion": "go1.19.7",
"compiler": "gc",
"platform": "linux/amd64"
}
}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: nginx
# rewrite means that it will rewrite the api path and send the traffic to the right resource
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
# name should be the same as we have defined in the service
name: client-cluster-ip-service
port:
number: 3000
- path: /api/
pathType: ImplementationSpecific
backend:
service:
# name should be the same as we have defined in the service
name: server-cluster-ip-service
port:
number: 5000
I have also noticed that they have deprecated Ingress in the extensions/v1beta1 from kubernetes and replace with networking.k8s.io/v1beta1 and that's why my ingress-service.yaml was not working.
So here is the updated version of ingress-service.yaml as of now in year 2023.
Here is the current version of client and server of kubernetes.
and the yaml code