15 - CKA exam Q15 with Solution.... Expose a pod to by creating a service on port 30002

preview_player
Показать описание
#kubenetes #CKA #DevOps #security
Q15) Expose "audit-web-app" pod to by creating a service "audit-web-app-service" on port 30002 on nodes of given cluster.
Note : Now given web application listens on port 8080
use below command to create an exam like scenario:
kubectl run audit-web-app --image=nginx --port=8080

It's easy:

SOLUTION 15)
alias g=kubectl
g run audit-web-app --image=nginx --port=8080
###########
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
run: audit-web-app
name: audit-web-app-service
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
nodePort: 30002
selector:
run: audit-web-app
type: NodePort
##########
g get pods -o wide |grep audit
g describe svc audit-web-app-svc
Рекомендации по теме