Skip to content

Latest commit

 

History

History
55 lines (51 loc) · 950 Bytes

10-SERVICE-ACCOUNT.md

File metadata and controls

55 lines (51 loc) · 950 Bytes

How to create kubectl alias (optional):

  • alias k=kubectl

Security Context for the POD:

apiVersion: v1
kind: Pod
metadata:
  name: ubuntu-sleeper
spec:
  securityContext:
    runAsUser: 1000
  containers:
  - command:
    - sleep
    - "4800"
    image: ubuntu         

Security Context for the Container:

apiVersion: v1
kind: Pod
metadata:
  name: ubuntu-sleeper
spec:
  containers:
  - command:
    - sleep
    - "4800"
    image: ubuntu         
    securityContext:
      runAsUser: 1000

Security Context for the Container with capabilities:

apiVersion: v1
kind: Pod
metadata:
  name: ubuntu-sleeper
spec:
  containers:
  - command:
    - sleep
    - "4800"
    image: ubuntu         
    securityContext:
      runAsUser: 1000
      capabilities:
        add: ["SYS_TIME"]

To see more details of the a POD:

  • k get po -o wide