Challenge, Medium,  on  Kubernetes

Inspecting and Extracting Kubernetes Kubeconfig Data

Scenario

You are working on the host dev-machine and are provided with a kubeconfig file located at /opt/labs/2/admin-kubeconfig.

The kubeconfig contains multiple contexts and users, all of which authenticate using a client certificate.

Perform the task on the dev-machine using the root user.

Tasks

  1. Write all kubeconfig context names into /opt/labs/2/context-list, one per line.
  2. Write the name of the current context into /opt/labs/2/active-context.
  3. Extract the base64-encoded client certificate of user user-account-1042, decode it, and write the decoded certificate to /opt/labs/2/client-cert.

Test Cases

Level up your Server Side game — Join 20,000 engineers who receive insightful learning materials straight to their inbox