Skip to content

Latest commit

 

History

History

12-Admission-Controller

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Important

This example assume you use kind k8s cluster..
kind Cluster
Static Pods


  1. copy manifest file from control plane node
docker cp multi-control-plane:/etc/kubernetes/manifests/kube-apiserver.yaml .
  1. Edit manifest file to enable admission controller.
spec:
  containers:
  - command:
    - kube-apiserver
    - --client-ca-file=/etc/kubernetes/pki/ca.crt
    - --enable-admission-plugins=NodeRestriction,NamespaceAutoProvision,LimitRanger # Manualy Updated
    - --enable-bootstrap-token-auth=true
  1. Copy Updated manifest file to control plane node
docker cp kube-apiserver.yaml multi-control-plane:/etc/kubernetes/manifests/kube-apiserver.yaml
  1. Check if the Plugins Are Enabled
kubectl get pod -n kube-system -l component=kube-apiserver -o yaml | grep enable-admission-plugins
  1. Test the NamespaceAutoProvision plugin
kubectl create deployment test-deployment --image=nginx:alpine -n test-namespace