This folder contains a Kubernetes resource config file that creates a new Namespace and a ServiceAccount that has admin level permissions in the Namespace, but nowhere else. This example is used to demonstrate how you can test RBAC permissions using terratest.
See the corresponding terratest code (kubernetes_rbac_example_test.go) for an example of how to test this resource config:
-
Setup a Kubernetes cluster. We recommend using a local version:
-
Install and setup kubectl to talk to the deployed Kubernetes cluster.
-
Run
kubectl apply -f namespace-service-account.yml
-
Setup a Kubernetes cluster. We recommend using a local version:
-
Install and setup kubectl to talk to the deployed Kubernetes cluster.
-
Install and setup kubectl.
-
Install Golang and make sure this code is checked out into your
GOPATH
. -
cd test
-
dep ensure
-
go test -v -tags kubernetes -run TestKubernetesRBACExample