Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Latest commit

 

History

History
30 lines (19 loc) · 1.71 KB

009b-cluster-policy.md

File metadata and controls

30 lines (19 loc) · 1.71 KB

Cluster Policy

You can think of a Kubernetes cluster like a personal cloud platform. Much like you have the need to create policies on your public cloud (ex. Azure Policy), you probably should apply policies on your Kubernetes clusters. For example, you may want to deny the creation of Pods with privileged access, except in certain namespaces. In this step you'll enable Azure Policy for AKS, which is built on the Open Policy Agent - Gatekeeper project.

Pre-requisites

Make sure the following are complete before setting up ingress.

  • Cluster is provisioned and accessible via 'kubectl'
  • App Deployment is complete

Cluster Policy Requirements

  • Azure Policy for AKS must be enabled on the cluster
  • Creation of privileged pods should be blocked for all namespaces except kube-system, gatekeeper-system and azure-arc
  • The scope of the policy assignment should be only the resource group where the AKS cluster is deployed

Tasks:

  1. Enable Policy on the AKS Cluster
  2. Apply the privileged pod policy at the cluster level
  3. Test the policy is operating as expected

Useful links: