Skip to content

Commit

Permalink
integration: Add teletest namespace and instructions for Kubernetes t…
Browse files Browse the repository at this point in the history
  • Loading branch information
webvictim authored Jul 9, 2021
1 parent 2462c09 commit ee70d8a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
25 changes: 25 additions & 0 deletions fixtures/ci-teleport-rbac/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Generating a ServiceAccount to use for Teleport integration tests

This should be done on a 'clean' k8s cluster i.e. one that doesn't already have Teleport installed for
Kubernetes forwarding (and doesn't require it), as we delete the default Teleport `ClusterRole` and
`ClusterRoleBinding` for security.

```
# Check out the Teleport repo and change dir to it
git clone https://github.com/gravitational/teleport
cd teleport
# generate a ServiceAccount using the get-kubeconfig script
TELEPORT_NAMESPACE="ci-teleport" examples/k8s-auth/get-kubeconfig.sh
# copy the generated kubeconfig, then add it to CI as a secret (out of band)
mv kubeconfig INTEGRATION_CI_KUBECONFIG
# add the additional required RBAC fixtures
kubectl create -f fixtures/ci-teleport-rbac/ci-teleport.yaml
# remove the additional teleport permissions that were added by the get-kubeconfig script
# (as these are not needed for CI, we can remove them for greater security)
kubectl delete clusterrole/teleport-role
kubectl delete clusterrolebinding/teleport-crb
```
6 changes: 6 additions & 0 deletions fixtures/ci-teleport-rbac/ci-teleport.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# defines the permissions needed for Teleport k8s integration tests to run in a cluster
# namespace for teleport tests
apiVersion: v1
kind: Namespace
metadata:
name: teletest
---
# clusterrole granting overarching privileges
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down

0 comments on commit ee70d8a

Please sign in to comment.