A Service Account provides an identity for processes that run in a pod. When processes inside a pod contact the API server, they are authenticated as a particular Service Account.
Create a Service Account using the YAML below.
apiVersion: v1
kind: ServiceAccount
metadata:
name: sa-app-name
namespace: namespace-name
Once the Service Account is created, you can reference it in your pod spec:
apiVersion: v1
kind: Pod
metadata:
name: app-name
spec:
serviceAccountName: sa-app-name
Now on to Kubernetes Secrets. A Secret lets you store and manage sensitive information. Here we’ll create two secrets for our tests: mysecret1 and mysecret2. Note the --- separator - without it, the second document silently overwrites the first.