How to enable admission controller on a GKE cluster?

11/29/2019

I'd like to investigate an issue with nginx-ingress on a GKE cluster. Therefore I need to enable admission controller and was wondering whether this is possible on GKE. I'm creating the cluster with

[authentication boilerplate]
gcloud container clusters create cluster-name --machine-type=n1-standard-1 --no-enable-stackdriver-kubernetes --no-enable-autoupgrade --preemptible

I find no option in gcloud --help or gcloud container clusters create --help.

I need to enable the admission controller for service accounts.

-- Karl Richter
gcloud
google-kubernetes-engine
kubernetes

1 Answer

11/29/2019

You can use gcloud beta like this:

gcloud beta container clusters create [CLUSTER_NAME] --enable-pod-security-policy

Or you can use update:

gcloud beta container clusters update [CLUSTER_NAME] --enable-pod-security-policy

This page explains how to use PodSecurityPolicies in Google Kubernetes Engine.

-- Alireza Davoodi
Source: StackOverflow