Skip to content

Commit 1749fbc

Browse files
authored
Merge branch 'branch/v17' into tcsc/branch/v17/ic-rerun-import
2 parents be82617 + 96138d6 commit 1749fbc

File tree

16 files changed

+234
-19
lines changed

16 files changed

+234
-19
lines changed

.github/workflows/changelog-merge-queue.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This check runs only on PRs that are in the merge queue.
22
#
3-
# PRs in the merge queue have already been approved but the reviewers check
3+
# PRs in the merge queue have already passed changelog validation but the check
44
# is still required so this workflow allows the required check to succeed,
55
# otherwise PRs in the merge queue would be blocked indefinitely.
66
#

.github/workflows/changelog.yaml

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# This changelog ensures that PR bodies include a `changelog: <changelog entry>` section,
2-
# or a `no-changelog` label set. If they do not, then a comment will be added to the PR
3-
# asking the developer to add one of the two.
1+
# The changelog workflow checks that a PR message has a line of the form
2+
# `changelog: <text>` or a `no-changelog` label. If neither are present,
3+
# the workflow run will fail, and as this workflow job is a required check,
4+
# the PR cannot be merged.
45
name: Validate changelog entry
56
on:
67
pull_request:
@@ -16,11 +17,6 @@ on:
1617
permissions:
1718
pull-requests: write
1819

19-
concurrency:
20-
cancel-in-progress: true
21-
# This value is arbitrary as long as it includes the pull request number
22-
group: 'limit to running one instance at a time for the pull request ${{ github.event.pull_request.number }}'
23-
2420
jobs:
2521
validate-changelog:
2622
name: Validate the changelog entry

build.assets/Dockerfile-grpcbox

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM docker.io/golang:1.23.7
3+
FROM docker.io/golang:1.24.1
44

55
# Image layers go from less likely to most likely to change.
66
RUN apt-get update && \

build.assets/versions.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LIBPCSCLITE_VERSION ?= 1.9.9-teleport
2020
DEVTOOLSET ?= devtoolset-12
2121

2222
# Protogen related versions.
23-
BUF_VERSION ?= v1.48.0
23+
BUF_VERSION ?= v1.50.1
2424
# Keep in sync with api/proto/buf.yaml (and buf.lock).
2525
GOGO_PROTO_TAG ?= v1.3.2
2626
NODE_GRPC_TOOLS_VERSION ?= 1.12.4

docs/.vale.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ MinAlertLevel = suggestion
44
[formats]
55
mdx = md
66

7-
[*.md]
7+
[*.mdx]
88
BasedOnStyles = messaging,examples,3rd-party-products,structure
9+
CommentDelimiters = "{/*,*/}"

docs/pages/admin-guides/deploy-a-cluster/license.mdx

+25-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Create a secret called "license" in the namespace you are using to deploy
7171
Teleport:
7272

7373
```code
74-
$ kubectl -n teleport create secret generic license --from-file=license.pem
74+
$ kubectl -n <Var name="teleport-namespace" /> create secret generic license --from-file=license.pem
7575
```
7676

7777
For the Teleport pod to load your license:
@@ -115,6 +115,30 @@ The Teleport Auth Service checks the expiration status of your license every
115115
hour. This means that, after you replace your license file and restart your Auth
116116
Service instances, it can take up to an hour to confirm the new license.
117117

118+
If you are running a self-hosted Teleport Enterprise cluster on Kubernetes using
119+
the `teleport-cluster` Helm chart, complete the following steps to update your
120+
license:
121+
122+
1. Download a new license file from your Teleport account using the instructions
123+
we provide [earlier in this guide](#download-your-license-file). We assume
124+
that the license file is called `license.pem`.
125+
126+
1. Assign <Var name="teleport-namespace" /> to the Kubernetes namespace where
127+
you manage Teleport-related resources.
128+
129+
1. Replace the Kubernetes secret that stores your existing license. We assume
130+
that the secret is called `license`, but there may be a different secret name
131+
specified in the `licenseSecretName` field of the chart's values file.
132+
133+
The following command prints a secret resource manifest to stdout using a dry
134+
run of `kubectl create secret` and pipes it to `kubectl replace`. This way,
135+
you can update the license without destroying and recreating it, avoiding the
136+
risk of an Auth Service instance looking up a nonexistent license file:
137+
138+
```code
139+
$ kubectl create secret generic license --from-file license.pem --dry-run=client -o yaml | kubectl replace -n <Var name="teleport-namespace" /> -f -
140+
```
141+
118142
## When your license expires
119143

120144
At 90 days before your Teleport Enterprise license expires, users will see an

docs/pages/connect-your-client/tsh.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,8 @@ $ tsh join <session_ID>
686686
Refer them to the [Moderated Sessions guide](../admin-guides/access-controls/guides/joining-sessions.mdx) for more information on configuring join permissions.
687687
</Admonition>
688688

689+
You can also list active sessions with the `tsh sessions ls` command.
690+
689691
<Admonition type="note" scope={["oss", "enterprise"]}>
690692
Joining sessions is not supported in recording proxy mode (where `session_recording` is set to `proxy`).
691693
</Admonition>

docs/pages/enroll-resources/auto-discovery/kubernetes/aws.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ subjects:
137137

138138
### IAM mapping
139139

140-
If you cluster includes the `aws-auth` config map, edit the `configmap/aws-auth`
140+
If your cluster includes the `aws-auth` config map, edit the `configmap/aws-auth`
141141
in the `kube-system` namespace and append the following to `mapRoles`. Replace
142142
`{teleport_aws_iam_role}` with the appropriate IAM role that Teleport Kubernetes
143143
Service will use. This step will link the Teleport IAM role into the Kubernetes
@@ -245,7 +245,7 @@ $ aws eks create-access-entry \
245245
$ aws eks associate-access-policy \
246246
--cluster-name <Var name="eks-cluster" /> \
247247
--region <Var name="eu-west-1" /> \
248-
--principal-arn <Var name="arn:aws:iam::222222222222:role/teleport-role" />
248+
--principal-arn <Var name="arn:aws:iam::222222222222:role/teleport-role" /> \
249249
--policy-arn "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy" \
250250
--access-scope type=cluster
251251

docs/pages/enroll-resources/machine-id/faq.mdx

+15
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,18 @@ If your use case absolutely requires long-lived certificates,
9393
[`tctl auth sign`](../../reference/cli/tctl.mdx#tctl-auth-sign) can
9494
alternatively be used, however this loses the security benefits of Machine ID's
9595
short-lived renewable certificates.
96+
97+
## Can Machine ID be used to connect to multiple Kubernetes clusters?
98+
99+
This is possible in Teleport v17.2.7 or higher, using the new `kubernetes/v2`
100+
output type in `tbot`. This service can expose many clusters at once via
101+
contexts in the generated `kubeconfig.yaml`, and if label selectors are used,
102+
will dynamically add contexts as clusters are added and removed in Teleport.
103+
104+
Note that both `tbot` and the Teleport Proxy need to be running v17.2.7 to take
105+
advantage of this functionality.
106+
107+
Refer to the
108+
[CLI reference](../../reference/cli/tbot.mdx#tbot-start-kubernetesv2) and
109+
[config reference](../../reference/machine-id/configuration.mdx#kubernetesv2)
110+
for more information.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
```yaml
2+
kind: token
3+
version: v2
4+
metadata:
5+
name: spacelift
6+
spec:
7+
roles: [Bot]
8+
join_method: spacelift
9+
10+
# This must match a bot name, created either with `tctl bots add` or by
11+
# creating a `bot` resource.
12+
bot_name: spacelift
13+
14+
spacelift:
15+
# hostname should be the hostname of your Spacelift tenant.
16+
hostname: example.app.spacelift.io
17+
# allow specifies rules that control which Spacelift executions will be
18+
# granted access. Those not matching any allow rule will be denied.
19+
allow:
20+
# space_id identifies the space that the module or stack resides within.
21+
- space_id: root
22+
# caller_type is the type of caller_id. This must be `stack` or `module`.
23+
caller_type: stack
24+
# caller_id is the id of the caller. e.g the name of the stack or module.
25+
caller_id: my-stack
26+
# scope is the scope of the token - either `read` or `write`.
27+
# See https://docs.spacelift.io/integrations/cloud-providers/oidc/#about-scopes
28+
scope: read
29+
```

docs/pages/installation.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ For Teleport Community Edition, check the
472472
[Downloads](https://goteleport.com/download/) page for the most up-to-date
473473
information.
474474

475+
On cloud-hosted Teleport Enterprise you can visit a download page in the Web UI. Select the user name
476+
in the upper right and select Downloads from the menu.
477+
478+
Customers who self-host Teleport Enterprise can access Enterprise downloads and their license
479+
file from their [dedicated account dashboard](./admin-guides/deploy-a-cluster/license.mdx).
480+
475481
## Docker
476482

477483
### Images

docs/pages/reference/cli/tbot.mdx

+48
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,54 @@ command supports these additional flags:
427427
| `--reader-group` | An additional group name or GID that should be allowed by ACLs to read this destination. Only valid for file destinations on Linux. |
428428
| `--kubernetes-cluster` | The name of the Kubernetes cluster in Teleport for which to fetch credentials |
429429

430+
## tbot start kubernetes/v2
431+
432+
Starts the Machine ID client `tbot` with a Kubernetes V2 output, fetching and
433+
writing Kubernetes credentials to a `kubeconfig.yaml` at a regular interval to
434+
the output specified with `--destination`.
435+
436+
Unlike the `kubernetes` output, `kubernetes/v2` allows fetching many Kubernetes
437+
clusters at once, as multiple contexts within the generated `kubeconfig.yaml`.
438+
If label selectors are used and clusters are added or removed, the list of
439+
clusters will be updated on the bot's next renewal. At least one selector -
440+
either name or label - is required.
441+
442+
Note that as with human users using `tsh kube ls`, only clusters the bot user
443+
has permission to access will be matched. Additionally, note that label
444+
selectors do not currently support wildcards.
445+
446+
### Flags
447+
448+
In addition to the [common `tbot start` flags](#common-start-flags), this
449+
command supports these additional flags:
450+
451+
| Flag | Description |
452+
|-------------------------|-------------|
453+
| `--destination` | A destination URI, such as `file:///foo/bar`. See [Destination URIs](#destination-uris) for more info. Required. |
454+
| `--reader-user` | An additional user name or UID that should be allowed by ACLs to read this destination. Only valid for file destinations on Linux. |
455+
| `--reader-group` | An additional group name or GID that should be allowed by ACLs to read this destination. Only valid for file destinations on Linux. |
456+
| `--name-selector` | Selects a Kubernetes cluster by exact name match. Repeatable. |
457+
| `--label-selector` | Selects many Kubernetes clusters by label match, e.g. `env=dev,role=ci`. Repeatable. |
458+
| `--disable-exec-plugin` | If set, disables the exec plugin. Allows credentials to be used without the `tbot` binary. |
459+
460+
### Examples
461+
462+
First, run `tbot` to generate credentials:
463+
464+
```code
465+
$ tbot start kubernetes/v2 --proxy-server=example.teleport.sh:443 --destination=./example --label-selector env=dev --name-selector example --oneshot
466+
```
467+
468+
This will fetch credentials for all clusters with the label `env: dev`, plus the
469+
cluster named `example`. You can then access the clusters using `kubectl`:
470+
471+
```code
472+
$ kubectl --kubeconfig ./example/kubeconfig.yaml --context example.teleport.sh-example get pods
473+
```
474+
475+
You can inspect the generated `kubeconfig.yaml` to see which clusters were
476+
matched by the label selector.
477+
430478
## tbot start application
431479

432480
Starts the Machine ID client `tbot` with an application output, fetching and

docs/pages/reference/cli/tsh.mdx

+30
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,36 @@ $ tsh ssh -o AddKeysToAgent=yes root@grav-00
11301130
$ tsh ssh root@env=aws hostname
11311131
```
11321132

1133+
## tsh sessions ls
1134+
1135+
List active sessions. The resulting list includes only the sessions that the
1136+
caller has permission to join, unless they have a role with explicit `list`
1137+
access on the `session_tracker` resource.
1138+
1139+
```code
1140+
$ tsh sessions ls
1141+
```
1142+
1143+
### Flags
1144+
1145+
| Name | Default Value(s) | Allowed Value(s) | Description |
1146+
| - | - | - | - |
1147+
| `-f, --format` | text | text, json, yaml | Format for output |
1148+
| `--kind` | none | ssh, k8s, db, app, desktop | Optionally filter by session kind(s) |
1149+
1150+
### Examples
1151+
1152+
```code
1153+
# list all active sessions
1154+
$ tsh sessions ls
1155+
1156+
# list all SSH and desktop sessions
1157+
$ tsh sessions ls --kind=ssh --kind=desktop
1158+
1159+
# list all Kubernetes sessions in JSON format
1160+
$ tsh sessions ls --kind=k8s --format=json
1161+
```
1162+
11331163
## tsh status
11341164

11351165
Display the list of proxy servers and retrieved certificates:

docs/pages/reference/join-methods.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,18 @@ Support for self-hosted Terraform Enterprise requires Teleport Enterprise.
440440
- [Run the Teleport Terraform Provider on Terraform Cloud](../admin-guides/infrastructure-as-code/terraform-provider/terraform-cloud.mdx)
441441
</Admonition>
442442

443+
### Spacelift: `spacelift`
444+
445+
This join method is used to authenticate using Spacelift. It is typically used
446+
by the Teleport Terraform provider on Spacelift (including self-hosted
447+
deployments).
448+
449+
(!docs/pages/includes/provision-token/spacelift-spec.mdx!)
450+
451+
<Admonition type="note" title="See Also">
452+
- [Run the Teleport Terraform Provider on Spacelift](../admin-guides/infrastructure-as-code/terraform-provider/spacelift.mdx)
453+
</Admonition>
454+
443455
### Bitbucket Pipelines: `bitbucket`
444456

445457
This join method is used to authenticate using Bitbucket's support for OpenID

docs/pages/reference/machine-id/configuration.mdx

+52
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,58 @@ kubernetes_cluster: my-cluster
294294
(!docs/pages/includes/machine-id/common-output-config.yaml!)
295295
```
296296

297+
### `kubernetes/v2`
298+
299+
The `kubernetes/v2` output type can be used to access many Kubernetes clusters
300+
as individual contexts within the same `kubeconfig.yaml`.
301+
302+
```yaml
303+
type: kubernetes/v2
304+
305+
# selectors include one or more matching Kubernetes clusters. Each match will be
306+
# included in the resulting `kubeconfig.yaml`, assuming the bot has permission
307+
# to access the cluster.
308+
selectors:
309+
# name includes an exact match by name. Note that wildcards are not currently
310+
# supported. Multiple name selectors can be specified if desired.
311+
- name: foo
312+
# labels include all clusters matching all of these labels. Multiple label
313+
# selectors can be provided if needed.
314+
- labels:
315+
env: dev
316+
317+
# The following configuration fields are available across most output types.
318+
# Note that `roles` are not supported for this output type.
319+
320+
destination:
321+
type: directory
322+
path: /opt/machine-id
323+
324+
# credential_ttl and renewal_interval override the credential TTL and renewal
325+
# interval for this specific output, so that you can make its certificates valid
326+
# for shorter than `tbot`'s internal certificates.
327+
#
328+
# This is particularly useful when using `tbot` in one-shot as part of a cron job
329+
# where you need `tbot`'s internal certificate to live long enough to be renewed
330+
# on the next invocation, but don't want long-lived workload certificates on-disk.
331+
credential_ttl: 30m
332+
renewal_interval: 15m
333+
```
334+
335+
Each Kubernetes cluster matching a selector will result in a new context in the
336+
generated `kubeconfig.yaml`. This can be consumed like so:
337+
338+
```code
339+
$ kubectl --kubeconfig /opt/machine-id/kubeconfig.yaml --context=example.teleport.sh-foo get pods
340+
```
341+
342+
The context name is `[Teleport cluster name]-[Kubernetes cluster name]`, so the
343+
command above runs `kubectl get pods` on the `foo` cluster.
344+
345+
If clusters are added or removed over time, the `kubeconfig.yaml` will be
346+
updated at the bot's normal renewal interval. You can trigger an early renewal
347+
by restarting `tbot`, or signaling it with `pkill -usr1 tbot`.
348+
297349
### `ssh_host`
298350

299351
The `ssh_host` output is used to generate the artifacts required to configure

pnpm-lock.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)