Hi Team,
Kindly let me know why the question below is marked as wrong and fails on Is the svc exposed to outside world ?
Thanks!
Q:
A new pod named frontend-app and a service called frontend-svc have been deployed in the default namespace.
Expose the service on the / path by creating an HTTPRoute named frontend-route.
My solution:
controlplane ~ ➜ k get httproute frontend-route
NAME HOSTNAMES AGE
frontend-route 4m18s
controlplane ~ ➜ kubectl describe httproute frontend-route
Name: frontend-route
Namespace: default
Labels: <none>
Annotations: <none>
API Version: gateway.networking.k8s.io/v1
Kind: HTTPRoute
Metadata:
Creation Timestamp: 2025-07-19T05:50:35Z
Generation: 1
Resource Version: 3143
UID: 57671242-53bd-4128-ada4-f366bc535612
Spec:
Parent Refs:
Group: gateway.networking.k8s.io
Kind: Gateway
Name: nginx-gateway
Namespace: nginx-gateway
Section Name: http
Rules:
Backend Refs:
Group:
Kind: Service
Name: frontend-svc
Port: 80
Weight: 1
Matches:
Path:
Type: PathPrefix
Value: /
Status:
Parents:
Conditions:
Last Transition Time: 2025-07-19T05:50:35Z
Message: All references are resolved
Observed Generation: 1
Reason: ResolvedRefs
Status: True
Type: ResolvedRefs
Last Transition Time: 2025-07-19T05:50:35Z
Message: The Gateway is ignored by the controller
Observed Generation: 1
Reason: GatewayIgnored
Status: False
Type: Accepted
Controller Name: gateway.nginx.org/nginx-gateway-controller
Parent Ref:
Group: gateway.networking.k8s.io
Kind: Gateway
Name: nginx-gateway
Namespace: nginx-gateway
Section Name: http
Events: <none>
Yaml of the route created:
ontrolplane ~ ➜ k get httproute frontend-route -o yaml
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
creationTimestamp: "2025-07-19T05:50:35Z"
generation: 1
name: frontend-route
namespace: default
resourceVersion: "3143"
uid: 57671242-53bd-4128-ada4-f366bc535612
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: nginx-gateway
namespace: nginx-gateway
sectionName: http
rules:
- backendRefs:
- group: ""
kind: Service
name: frontend-svc
port: 80
weight: 1
matches:
- path:
type: PathPrefix
value: /
status:
parents:
- conditions:
- lastTransitionTime: "2025-07-19T05:50:35Z"
message: All references are resolved
observedGeneration: 1
reason: ResolvedRefs
status: "True"
type: ResolvedRefs
- lastTransitionTime: "2025-07-19T05:50:35Z"
message: The Gateway is ignored by the controller
observedGeneration: 1
reason: GatewayIgnored
status: "False"
type: Accepted
controllerName: gateway.nginx.org/nginx-gateway-controller
parentRef:
group: gateway.networking.k8s.io
kind: Gateway
name: nginx-gateway
namespace: nginx-gateway
sectionName: http
- Describe on Gateway:
ontrolplane ~ ✖ k get gateway nginx-gateway -n nginx-gateway
NAME CLASS ADDRESS PROGRAMMED AGE
nginx-gateway nginx False 16m
controlplane ~ ➜ k describe gateway nginx-gateway -n nginx-gateway
Name: nginx-gateway
Namespace: nginx-gateway
Labels: <none>
Annotations: <none>
API Version: gateway.networking.k8s.io/v1
Kind: Gateway
Metadata:
Creation Timestamp: 2025-07-19T05:40:13Z
Generation: 1
Resource Version: 1993
UID: 0eee8a9b-8f65-4bda-86b1-2bce2b554508
Spec:
Gateway Class Name: nginx
Listeners:
Allowed Routes:
Namespaces:
From: All
Name: http
Port: 80
Protocol: HTTP
Status:
Conditions:
Last Transition Time: 2025-07-19T05:40:13Z
Message: The resource is ignored due to a conflicting Gateway resource
Observed Generation: 1
Reason: GatewayConflict
Status: False
Type: Accepted
Last Transition Time: 2025-07-19T05:40:13Z
Message: The resource is ignored due to a conflicting Gateway resource
Observed Generation: 1
Reason: GatewayConflict
Status: False
Type: Programmed
Events: <none>