Challenge, Easy,  on  Kubernetes

Extracting and Decoding ServiceAccount Token from Kubernetes Secret

Scenario

You need to work in the mars namespace and identify the Secret that is linked to the ServiceAccount named mars-sa-v2.

After locating this Secret, extract the token value stored inside it and decode the Base64-encoded token.

Once decoded, save the resulting token content into the file /opt/token.

Finally, confirm that the /opt/token file is not empty and that its contents represent a valid JWT structure.

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


Test Cases

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