At what levels can security be configured in Kubernetes in regards to containers?
How far do pod-level configurations reach?
What happens if security configurations are set at container and pod level?
How do you configure security context on a pod-level ?
pod Yaml
apiVersion kind metadata spec: securityContext: runAsUser: 1000 containers: - name: ubuntu image: ubuntu command: ["sleep", "3600"]
How do you configure security context on a container-level ?
pod Yaml
apiVersion kind metadata spec: containers: - name: ubuntu image: ubuntu command: ["sleep", "3600"] securityContext: runAsUser: 1000 capabilities: add: ["MAC_ADMIN"]
With what command can you find out what user a pod is running as?
kubectl exec ubuntu-sleeper – whoami
What does the ‘kubectl exec’ command start?