Question 22 of ingress practice You are requested to make the new application av . . .

Abhishek Porwal:
Question 22 of ingress practice
You are requested to make the new application available at /pay.
SOlution says that you need to create new ingress

why can’t I use old ingress(ingress-wear-watch) in app-space for service in critical-sapce

adding following backend in

- backend:
      service:
        name: pay-service.critical-space
        port:
          number: 8282
    path: /pay
    pathType: prefix

getting this error

http://gresses.networking.k8s.io|gresses.networking.k8s.io “ingress-wear-watch” was not valid:

* spec.rules[0].http.paths[2].backend.service.name: Invalid value: “pay-service.critical-space”: a DNS-1035 label must consist of lower case alphanumeric characters or ‘-’, start with an alphabetic character, and end with an alphanumeric character (e.g. ‘my-name’, or ‘abc-123’, regex used for validation is ‘a-z?’)

Abhishek Porwal:
@Manish Adhikari @Michaela Markou What am I missing here.

Manish Adhikari:
@Tej_Singh_Rana @Tharanath something you guys can help with ?

Tej_Singh_Rana:
We can’t define that service name in this way.

Tej_Singh_Rana:
Ingress is namespace scoped so I believe you already defined the namespace field under the ingress.metadata.namespace so we don’t need to specify namespace with service.

Tej_Singh_Rana:

root@controlplane:~# kubectl explain ingress.spec.rules.http.paths.backend.service.name
KIND:     Ingress
VERSION:  <http://networking.k8s.io/v1|networking.k8s.io/v1>

FIELD:    name &lt;string&gt;

DESCRIPTION:
     Name is the referenced service. The service must exist in the same
     namespace as the Ingress object.

Tej_Singh_Rana:
Hope it will help you to clear your doubts.

Abhishek Porwal:
I am sorry it is not clear yet . I am applying the concept where it says you can access the service in another name space by servicename.namespace . so in this case ingress in app-space and service to be consumed in critical-namespace.

Abhishek Porwal:
so I am accessing service in ingress rule in app-space name space –

Abhishek Porwal:

  • backend:
    service:
    name: pay-service.critical-space
    port:
    number: 8282
    path: /pay
    pathType: prefix

Abhishek Porwal:
here payservice in critical name space

Abhishek Porwal:
I just read in stack "Now, Ingress Controller can be deployed in any namespace and is, in fact, usually deployed in a namespace separate from your app services. It can out-of-the-box see Ingress rules in all namespaces in the cluster and will pick them up.
The Ingress rules, however, must reside in the namespace where the app that they configure reside."

Tej_Singh_Rana:
I think you’re doing wrong.
As I shared a description.
https://kodekloudworkspace.slack.com/archives/CHBHBANH0/p1630081718014600?thread_ts=1630063871.007700&amp;cid=CHBHBANH0

Abhishek Porwal:
Oh yes

Abhishek Porwal:
I overlooked this part

Abhishek Porwal:
I am good

Abhishek Porwal:
thanks for the time