First of all, what I want to build is right below.

as above diagram, I want Ingress to make distribute traffics to service which is at other namespace me in same cluster. (Ingress is in main namespace) But the Ingress doesn't allow to point dns directly, I make ExternalName Service that points to me-service dns me-service.me.svc.cluster.local and then Ingress points to it.
Yaml of it is
main.k8s.yaml
apiVersion: v1
kind: Namespace
metadata:
name: main
---
apiVersion: v1
kind: Service
metadata:
name: me-service
namespace: main
spec:
externalName: me-service.me.svc.cluster.local
type: ExternalName
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: gce
name: main-router
namespace: main
spec:
rules:
- host: some-domain.me
http:
paths:
- backend:
service:
name: me-service
port:
number: 80
path: /
pathType: ImplementationSpecific
me.k8s.yaml
apiVersion: v1
kind: Namespace
metadata:
labels:
stag: production
name: me
---
apiVersion: v1
kind: Service # <-- this is the service I want to point
metadata:
labels:
app: me
stag: production
name: me-service
namespace: me
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: me
stag: production
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: me
stag: production
name: me-deployment
namespace: me
spec:
replicas: 2
selector:
matchLabels:
app: me
stag: production
template:
metadata:
labels:
app: me
stag: production
spec:
containers:
- image: gcr.io/me:latest
name: me
ports:
- containerPort: 80
resources:
limits:
cpu: 300m
memory: 512M
requests:
cpu: 250m
memory: 512M
And I checked dns address works but Ingress object doesn't created with error message
me-service:80 (<error: endpoints "me-service" not found>)
Type Reason Age From Message
---- ------ ---- ---- -------
Warning Translate 6m21s (x233 over 22h) loadbalancer-controller Translation failed: invalid ingress spec: could not find port "80" in service "main/me-service"
How can I make ingress work? If you need more information, please let me know. :pray:
GKE Engine: 1.20.6-gke.1000
HTTP Load Balancing: Enabled
Network policy: Disabled
Dataplane V2: Enabled