Valid CKA Dumps shared by EduDump.com for Helping Passing CKA Exam! EduDump.com now offer the newest CKA exam dumps, the EduDump.com CKA exam questions have been updated and answers have been corrected get the newest EduDump.com CKA dumps with Test Engine here:
You must connect to the correct host. Failure to do so may result in a zero score. [candidate@base] $ ssh Cka000022 Task 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 exposing the container port 80/tcp . Configure the new Service to also expose the individual Pods via a NodePort .
Correct Answer:
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 # Step-by-Step Solution 1## SSH into the correct node ssh cka000022 ## Skipping this = zero score 2## Edit the Deployment to expose port 80 kubectl edit deployment front-end -n spline-reticulator Under containers: # nginx, add this if not present: ports: - containerPort: 80 protocol: TCP # This enables the container to accept traffic on port 80. 3## Create a NodePort Service Create a file named front-end-svc.yaml: 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 ## Make sure the Deployment has a matching label selector like app: front-end. You can verify with: kubectl get deployment front-end -n spline-reticulator -o yaml | grep labels -A 2 4## Apply the service kubectl apply -f front-end-svc.yaml 5## Verify Check if the service is created and has a NodePort assigned: kubectl get svc front-end-svc -n spline-reticulator # You should see something like: NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE front-end-svc NodePort 10.96.0.123 <none> 80:3XXXX/TCP 10s Where 3XXXX is your automatically assigned NodePort (between 30000-32767). Final Command Summary ssh cka000022 kubectl edit deployment front-end -n spline-reticulator # Add: # ports: # - containerPort: 80 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