The Teleport Web UI requires valid TLS certificates. These environments use mkcert to generate certificates your browser trusts, so you won't see certificate warnings.
- Install mkcert if you don't already have it.
- Run
make certsto generate and install the certificates in./certs.
macOS and Linux always resolve *.localhost names to 127.0.0.1. On Windows,
browsers resolve *.localhost on their own, but tsh and other command-line
tools may not. As Administrator, add this line to
C:\Windows\System32\drivers\etc\hosts:
127.0.0.1 teleport.localhost duo.localhost okta.localhost entra.localhost github.localhost
Place a valid license.pem file in the same directory as the Docker Compose
stack.
Run make up or docker compose up to start the workshop environments. The
environments store their state in ./data (and the k3s cluster in the
k3s-data Docker volume). For a fresh cluster, run make clean; changes to
teleport/bootstrap.yaml (roles, the SAML connector) only apply to a fresh
cluster.
Open Teleport at https://teleport.localhost:3080.
This Docker Compose stack runs four simulated services: Duo, Okta, Entra ID, and GitHub Enterprise Server.
A GitHub Actions workflow deploys a sample app (nginx) to a Kubernetes cluster
through Teleport without any stored secrets. The job presents its GitHub OIDC ID
token, tbot joins Teleport as the bot github-actions-k8s-demo with the
github join method, and kubectl reaches the k3s cluster through Teleport.
The pieces, all started by docker compose up:
simulatorserves a fake GitHub Enterprise Server, with the repoexample-org/teleport-k8s-demo(contents fromgithub/repo/) and the Actions OIDC issuer.ci-runnerruns the sample GHA workflow (github/repo/.github/workflows/deploy.yaml) with realtbotandkubectl. Actions such asteleport-actions/auth-k8sare mocks that behave similarly to the real ones.k3sis the Kubernetes cluster (enrolled in Teleport ask3s) where the GHA workflow deploys to. It runs as a privileged container, and Teleport waits for it to be ready before starting.teleport-setupcreates the bot, its role and its join token fromteleport/github-actions/*.yaml.ci-runnerwaits for it to finish, so runs dispatched before then queue ("Waiting for a runner") until it has. To watch it, rundocker compose logs -f teleport-setupuntil it exits.
Viewing the audit log and running tsh kube login k3s below needs a user in
the admins group, such as andrew.admin (it grants the root-access
role).
- Open https://github.localhost:11443/example-org/teleport-k8s-demo/actions.
- Select Deploy, click Run workflow, keep branch
main, and click Run workflow. - Open the run. The
teleport-actions/auth-k8sstep logs the decoded ID token claims (repository,ref, ...) that Teleport checks, followed by tbot's output. The last step lists the twonginxpods.
In the Teleport Web UI, open the audit log and find the Bot Joined event
(bot.join, method github). Its attributes are the job's claims. From the
command line:
docker compose exec teleport tctl get bot_instance
The audit log is also on disk, one JSON event per line:
jq 'select(.event=="bot.join")' data/teleport/log/*/*.log
tsh login --proxy=teleport.localhost:3080
tsh kube login k3s
kubectl -n demo get pods
Run the workflow again on branch dev. The join token only allows
refs/heads/main, so Teleport rejects the join: the auth step fails with
tbot's id token claims did not match any allow rules, and the deploy steps
are skipped. The audit log shows a failed bot.join.
-
Copy the contents of
github/repo/into your own GitHub repository, including the hidden.github/directory (cp -R github/repo/. <your repo>). -
In
teleport/github-actions/token.yaml, replace the${GITHUB_REPOSITORY}placeholder with yourowner/nameand deleteenterprise_server_host(it's only for GitHub Enterprise Server). Then create the resources:tctl create -f teleport/gha-demo-resources.yaml -
In
deploy.yaml, setproxyto your Teleport proxy address andkubernetes-clusterto your cluster's name in Teleport. -
Apply
k3s/manifests/github-ci-rbac.yamlto your Kubernetes cluster (namespacedemo, and RBAC for thegithub-cigroup). -
Make sure your Teleport proxy is reachable from GitHub-hosted runners.