CKA · Question #58
Reconfigure the existing Deployment front-end in namespace spline-reticulator to expose port 80/tcp of the existing container nginx. Create a new Service named front-end-svc to expose the individual…
Task Summary SSH into cka000022 Modify an existing Deployment: Namespace: spline-reticulator Deployment: front-end Container: nginx Expose: port 80/tcp Create a Service: Name: front-end-svc Type: NodePort Port: 80 → container port 80 ssh cka000022 kubectl edit deployment…
Question
Exhibit
Explanation
Task Summary SSH into cka000022 Modify an existing Deployment: Namespace: spline-reticulator Deployment: front-end Container: nginx Expose: port 80/tcp Create a Service: Name: front-end-svc Type: NodePort Port: 80 → container port 80
ssh cka000022 kubectl edit deployment front-end -n spline-reticulator
Under containers: -> nginx, add this if not present:
ports:
- containerPort: 80
protocol: TCP
Verify deployment labels if needed:
kubectl get deployment front-end -n spline-reticulator -o yaml | grep labels -A 2
cat <<EOF > front-end-svc.yaml apiVersion: v1 kind: Service metadata: name: front-end-svc namespace: spline-reticulator spec: type: NodePort selector: app: front-end ports:
- port: 80 targetPort: 80 protocol: TCP EOF kubectl apply -f front-end-svc.yaml kubectl get svc front-end-svc -n spline-reticulator
Topics
Community Discussion
No community discussion yet for this question.
