Skip to content

Commit

Permalink
Merge branch 'branch/v15' into gabrielcorado/v15/fix-skip-idle-events…
Browse files Browse the repository at this point in the history
…-recording
  • Loading branch information
gabrielcorado authored Nov 5, 2024
2 parents 89ce24b + 568b9bd commit 10642ce
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ chart.

1. Install the `teleport-cluster` Helm chart using the values file you wrote:

```code
$ helm install teleport-cluster teleport/teleport-cluster \
--create-namespace \
--version (=teleport.version=) \
--values teleport-cluster-values.yaml
```
```code
$ helm install teleport-cluster teleport/teleport-cluster \
--create-namespace \
--version (=teleport.version=) \
--values teleport-cluster-values.yaml
```

1. After installing the `teleport-cluster` chart, wait a minute or so and ensure
that both the Auth Service and Proxy Service pods are running:
Expand Down
1 change: 1 addition & 0 deletions docs/pages/admin-guides/deploy-a-cluster/hsm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ to use.
DEBU[0000] preflight complete cert= config= key= pid=73502 seccomp=false serial= syslog=false timeout=0s version=3.0.3
DEBU[0000] takeoff TLS=false listen="localhost:12345" pid=73502
```

1. Use `yubihsm-shell` to create a new authentication key to be used by
Teleport with the necessary capabilities.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ videoBanner: 6lgVObxoLkc
</Admonition>

- (!docs/pages/includes/tctl.mdx!)

- A certificate authority for MongoDB Replica Set, and the public certificate
for that CA, in PEM format: `<Var name="/path/to/your/ca.crt" />`. You can
also configure Teleport to trust this CA for standalone MongoDB instances.
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/upgrading/automatic-agent-updates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ This section assumes that the name of your `teleport-kube-agent` release is

1. Check for any deployment issues by checking the updater logs:

```code
$ kubectl -n <Var name="teleport" /> logs deployment/<Var name="teleport-agent" />-updater
2023-04-28T13:13:30Z INFO StatefulSet is already up-to-date, not updating. {"controller": "statefulset", "controllerGroup": "apps", "controllerKind": "StatefulSet", "StatefulSet": {"name":"my-agent","namespace":"agent"}, "namespace": "agent", "name": "my-agent", "reconcileID": "10419f20-a4c9-45d4-a16f-406866b7fc05", "namespacedname": "agent/my-agent", "kind": "StatefulSet", "err": "no new version (current: \"v12.2.3\", next: \"v12.2.3\")"}
```
```code
$ kubectl -n <Var name="teleport" /> logs deployment/<Var name="teleport-agent" />-updater
2023-04-28T13:13:30Z INFO StatefulSet is already up-to-date, not updating. {"controller": "statefulset", "controllerGroup": "apps", "controllerKind": "StatefulSet", "StatefulSet": {"name":"my-agent","namespace":"agent"}, "namespace": "agent", "name": "my-agent", "reconcileID": "10419f20-a4c9-45d4-a16f-406866b7fc05", "namespacedname": "agent/my-agent", "kind": "StatefulSet", "err": "no new version (current: \"v12.2.3\", next: \"v12.2.3\")"}
```

## Troubleshooting

Expand Down
14 changes: 7 additions & 7 deletions docs/pages/upgrading/upgrading-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ your `teleport-cluster` release is called `teleport-cluster`.
1. Update the Teleport Helm chart repository so you can install the latest
version of the `teleport-cluster` chart:

(!docs/pages/includes/kubernetes-access/helm/helm-repo-add.mdx!)
(!docs/pages/includes/kubernetes-access/helm/helm-repo-add.mdx!)

1. Upgrade the `teleport-cluster` Helm release:

```code
$ helm upgrade teleport-cluster teleport/teleport-cluster \
--version=<Var name="(=teleport.version=)" /> \
--values=values.yaml
```
```code
$ helm upgrade teleport-cluster teleport/teleport-cluster \
--version=<Var name="(=teleport.version=)" /> \
--values=values.yaml
```

The `teleport-cluster` Helm chart automatically waits for the previous
version of the Proxy Service to stop responding to requests before running a
Expand All @@ -395,7 +395,7 @@ that your `teleport-kube-agent` release is called `teleport-agent`.
1. Update the Teleport Helm chart repository so you can install the latest
version of the `teleport-kube-agent` chart:

(!docs/pages/includes/kubernetes-access/helm/helm-repo-add.mdx!)
(!docs/pages/includes/kubernetes-access/helm/helm-repo-add.mdx!)

1. Upgrade the Helm release:

Expand Down
13 changes: 8 additions & 5 deletions tool/tctl/common/edit_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ import (
// EditCommand implements the `tctl edit` command for modifying
// Teleport resources.
type EditCommand struct {
app *kingpin.Application
cmd *kingpin.CmdClause
config *servicecfg.Config
ref services.Ref
app *kingpin.Application
cmd *kingpin.CmdClause
config *servicecfg.Config
ref services.Ref
confirm bool

// Editor is used by tests to inject the editing mechanism
// so that different scenarios can be asserted.
Expand All @@ -61,9 +62,10 @@ func (e *EditCommand) Initialize(app *kingpin.Application, config *servicecfg.Co
e.cmd.Arg("resource type/resource name", `Resource to update
<resource type> Type of a resource [for example: rc]
<resource name> Resource name to update
Example:
$ tctl edit rc/remote`).SetValue(&e.ref)
e.cmd.Flag("confirm", "Confirm an unsafe or temporary resource update").Hidden().BoolVar(&e.confirm)
}

func (e *EditCommand) TryRun(ctx context.Context, cmd string, client *authclient.Client) (bool, error) {
Expand Down Expand Up @@ -115,6 +117,7 @@ func (e *EditCommand) editResource(ctx context.Context, client *authclient.Clien
filename: f.Name(),
force: true,
withSecrets: true,
confirm: e.confirm,
}
rc.Initialize(e.app, e.config)

Expand Down
33 changes: 31 additions & 2 deletions tool/tctl/common/resource_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,14 @@ func (rc *ResourceCommand) updateAuthPreference(ctx context.Context, client *aut
return trace.Wrap(err)
}

storedAuthPref, err := client.GetAuthPreference(ctx)
if err != nil {
return trace.Wrap(err)
}
if err := checkUpdateResourceWithOrigin(storedAuthPref, "cluster auth preference", rc.confirm); err != nil {
return trace.Wrap(err)
}

if _, err := client.UpdateAuthPreference(ctx, newAuthPref); err != nil {
return trace.Wrap(err)
}
Expand Down Expand Up @@ -746,6 +754,14 @@ func (rc *ResourceCommand) updateClusterNetworkingConfig(ctx context.Context, cl
return trace.Wrap(err)
}

storedNetConfig, err := client.GetClusterNetworkingConfig(ctx)
if err != nil {
return trace.Wrap(err)
}
if err := checkUpdateResourceWithOrigin(storedNetConfig, "cluster networking configuration", rc.confirm); err != nil {
return trace.Wrap(err)
}

if _, err := client.UpdateClusterNetworkingConfig(ctx, newNetConfig); err != nil {
return trace.Wrap(err)
}
Expand Down Expand Up @@ -804,6 +820,14 @@ func (rc *ResourceCommand) updateSessionRecordingConfig(ctx context.Context, cli
return trace.Wrap(err)
}

storedRecConfig, err := client.GetSessionRecordingConfig(ctx)
if err != nil {
return trace.Wrap(err)
}
if err := checkUpdateResourceWithOrigin(storedRecConfig, "session recording configuration", rc.confirm); err != nil {
return trace.Wrap(err)
}

if _, err := client.UpdateSessionRecordingConfig(ctx, newRecConfig); err != nil {
return trace.Wrap(err)
}
Expand Down Expand Up @@ -2987,10 +3011,15 @@ func checkCreateResourceWithOrigin(storedRes types.ResourceWithOrigin, resDesc s
if exists := (storedRes.Origin() != types.OriginDefaults); exists && !force {
return trace.AlreadyExists("non-default %s already exists", resDesc)
}
if managedByStatic := (storedRes.Origin() == types.OriginConfigFile); managedByStatic && !confirm {
return checkUpdateResourceWithOrigin(storedRes, resDesc, confirm)
}

func checkUpdateResourceWithOrigin(storedRes types.ResourceWithOrigin, resDesc string, confirm bool) error {
managedByStatic := storedRes.Origin() == types.OriginConfigFile
if managedByStatic && !confirm {
return trace.BadParameter(`The %s resource is managed by static configuration. We recommend removing configuration from teleport.yaml, restarting the servers and trying this command again.
If you would still like to proceed, re-run the command with both --force and --confirm flags.`, resDesc)
If you would still like to proceed, re-run the command with the --confirm flag.`, resDesc)
}
return nil
}
Expand Down

0 comments on commit 10642ce

Please sign in to comment.