There are no users in Kubernetes

Where is user information stored in kubernetes ?

Kubernetes will not store the user details.

Then how kubernetes is able to do the Authentication ?

ca.png

auth.png

How kubernetes components are talking securely ?

Can we share this config file to everybody?

Can we use CA method to authenticate machines to talk to kubernetes ?

Then how we can give permission for machine/process/bot to talk to kubernetes ?

How authorization is happening in kubernetes ?

Eg:

Create a role to get,list,watch pods

cat <<EOF | kubectl apply -f -
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: podReader
  namespace: default
rules:
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - get
  - list
EOF

Create a role binding for the user dinesh and for service account dinesh with role podReader.

cat <<EOF | kubectl apply -f -
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: dinesh-podReader
  namespace: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: podReader
subjects:
- kind: ServiceAccount
  name: dinesh
  namespace: default
- kind: User
  name: dinesh
  namespace: default
EOF

Once the user is authenticated, based on the role, they/it can access the resource.

Comments

comments powered by Disqus