Linux Foundation CKA Exam - Topic 3 Question 49 Discussion
Score: 7%TaskReconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx.Create a new service named front-end-svc exposing the container port http.Configure the new service to also expose the individual Pods via a NodePort on the nodes on which they are scheduled.
A) Explanation:
Solution:
kubectl get deploy front-end
kubectl edit deploy front-end -o yaml
#port specification named http
#service.yaml
apiVersion: v1
kind: Service
metadata:
name: front-end-svc
labels:
app: nginx
spec:
ports:
- port: 80
protocol: tcp
name: http
selector:
app: nginx
type: NodePort
# kubectl create -f service.yaml
# kubectl get svc
# port specification named http
kubectl expose deployment front-end --name=front-end-svc --port=80 --tarport=80 --type=NodePort
Carole
6 months agoGlenn
7 months agoAlpha
7 months agoLisbeth
7 months agoRaelene
7 months agoVan
8 months agoDottie
8 months agoIrma
8 months agoKendra
8 months agoLudivina
8 months agoBrandee
8 months agoDyan
8 months agoCristal
8 months agoFrederick
8 months agoCherry
8 months agoShoshana
8 months agoMozell
9 months ago