Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.09 KB

File metadata and controls

49 lines (38 loc) · 1.09 KB

Service Account

Service Account
Tips and Tricks

For simulated Practice problems visit KillerCoda.
  1. create a service account sacc.

    Solution

    k create sa sacc

  2. create a pi pod with nginx image using sacc as the service account.

    Solution

    # generate required pod yaml
    k run pi --image=nginx --dry-run=client -o yaml > pod.yaml
    
    # add service account name
    apiVersion: v1
    kind: Pod
    metadata:
      creationTimestamp: null
      labels:
        run: pi
      name: pi
    spec:
      serviceAccountName: sacc
      containers:
      - image: nginx
        name: pi
        resources: {}
      dnsPolicy: ClusterFirst
      restartPolicy: Always