top of page
Search

CKA EXAM QS-12 2025

Question 12:

  1. First create a gateway named web-gateway with hostname gateway.web.k8s.local that maintain the existing TLS and listener configuration from the existing ingress resource named web.


  1. Next, create an HTTPRoute named web-route with hostname gateway.web.k8s.local that maintains the existing routing rules from the current ingress resource named web.


You can test your Gateway API configuration with the following command:



finaly, Delete the existing ingress resource named web


=======================================================

Answer:

1- Navigate to kubernetes URL and search APIGateway and go to Gateway section

manifiest file

=======================================================


2- #vim gateway.yaml


kind: Gateway

metadata:

name: web-gateway

spec:

gatewayClassName: nginx # check gatewayClassName in the exam environment

listeners:

- name: https

protocol: HTTPS

port: 443

hostname: "gateway.web.k8s.local" # remember from here 4 lines to add

tls:

mode: Terminate

certificateRefs:

- name: web-cert # run: kubectl get secret (to verify certificate in default ns)


#kubectl create -f gateway.yaml


Built manifest for HTTPRoute,


Navigate to kubernetes URL and search APIGateway and go to HTTPRoute section

manifiest file


kind: HTTPRoute

metadata:

name: web-route

spec:

parentRefs:

- name: web-gateway

hostnames:

- "gateway.web.k8s.local"

rules:

- matches:

- path:

type: PathPrefix

value: /

backendRefs:

- name: web # can check service name using: kubectl get svc

port: 80


#kubectl create -f httproute.yaml


#kubectl delete ingress web ===>#to delete web ingress as web-gateway is there



Note: Practice Please create gateway class (Not need to do in exam)


#vim gwclass.yaml

kind: GatewayClass

metadata:

name: nginx

spec:

#kubectl create -f gwclass.yaml




 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page