Home > Software engineering >  What is a Policy for controlling access in Kubernetes?
What is a Policy for controlling access in Kubernetes?

Time:01-06

In the Kubernetes documentation for controlling-access to the API server, under the Authorization section it says that authorization is controlled through a Policy.

However, a Policy is not found as an API resource:

❯ k api-resources | grep -i policy
networkpolicies                   netpol              networking.k8s.io/v1                   true         NetworkPolicy
poddisruptionbudgets              pdb                 policy/v1                              true         PodDisruptionBudget

❯ kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.2
Kustomize Version: v4.5.7
Server Version: v1.25.3 k3s1

So what exactly is a Policy? How is it setup?

The docs are not very clear on this point.

CodePudding user response:

...under the Authorization section it says that authorization is controlled through a Policy.

The sample you saw is a cluster that uses ABAC. From your screenshot your cluster is likely to use RBAC which access policy is not used.

So what exactly is a Policy? How is it setup?

Here's the official documentation for Attribute-based access control

  • Related