Commit Graph
14 Commits
Author SHA1 Message Date
Bernard Kim b2d90968dc Fix aws oidc deployment metrics (#38892)
* Add TELEPORT_EXT_UPGRADER env to AWS OIDC deployments

* Add unit tests

* Fix import

* Remove subtest

* Remove constants pkg

* Iterate over all container definitions

* Remove TELEPORT_EXT_UPGRADER from ensured env var

TELEPORT_EXT_UPGRADER=awsoidc_integration is not supported when
attempting to initialize a new exporter. Instead of including version
checks, it is safer to use the install method environment variable to
populate the upgrader value in the heartbeat.

* Use constant

* Remove comment
2024-03-16 00:10:14 +00:00
Hugo ShakaandNoah Stride 1bdb045a12 Enable automatic upgrade server by default (#38937)
* Enable automatic upgrade server by default

This commit means the proxy now serves automatic upgrade channels by
default. The default channel is "default" and its version is the
teleport proxy binary version.

This commit also fixes a bug with the automatic update version server
returning `teleport.Version` instead of `"v"+teleport.Version` when the
version was too high. This was not a critical issue because agents are
supposed to tolerate versions not prefixed with 'v'.

* lint

* thread safety

* Update lib/automaticupgrades/channel.go

* Update lib/config/configuration.go

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* fix tests and lint

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
2024-03-05 23:28:40 +00:00
rosstimothy b7318b5c7e Enable errorlint via golangci-lint (#37669)
Adds the new linter and configures it to prevent direct error
comparisions and type assertions in favor of errors.Is and errors.As.
All current violations caught by the linter have been updated
accordingly.
2024-02-02 15:59:24 +00:00
Hugo Shaka fb8f4b037a Fix a bug causing the webUI to be unusable if automatic upgrades are misconfigured (#37091)
* Fix a bug causing the webUI to be unusable if automatic upgrades are misconfigured

* document which env var
2024-01-23 22:33:52 +00:00
Hugo Shaka 54ede1e11c Fix teleport.e integrations builds (#35996)
* Move automaticupgrades packages in `lib/automaticupgrades`

* Fix `kube-agent-udpater` Dockerfile
2023-12-27 14:39:42 +00:00
Hugo ShakaandBernard Kim 3472a60e13 automatic upgrades: use default version channel everywhere (#35342)
* Use default upgrade channel

This commit:
- initializes default upgrade channels based on the server features
- makes all integrations use the upgrade channels instead of hitting
  hardcoded s3 bucket
- makes the version channel return its own version if the target
  version is too high
- makes the NoVersion handler properly: returned as an error. This way
  soneone relying on the version getter doesn't have to check
- moves the version kube-agent-updater lib in main teleport libs
- add tests for noVersion channels

* Update lib/web/join_tokens.go

Co-authored-by: Bernard Kim <bernard@goteleport.com>

* address marco's feedback

* address marco's feedback pt.2

---------

Co-authored-by: Bernard Kim <bernard@goteleport.com>
2023-12-18 19:57:32 +00:00
Hugo Shaka 856bb39ea9 Add a version server in the proxy + use it in agent chart (#35150)
This PR adds an embedded [version server](https://goteleport.com/docs/architecture/agent-update-management/#version-server-and-source-of-truth) in the proxy to address: https://github.com/gravitational/cloud/issues/6773

The version server can be configured through `teleport.yaml`:

```yaml
proxy_service:
  enabled: "yes"
  automatic_upgrades_channels:
    stable/cloud:
      forward_url: https://updates.releases.teleport.dev/v1/stable/cloud
    preview/cloud:
      static_version: v12.5.4
```

The forwarded call results are cached for a minute.
2023-12-12 01:03:45 +00:00
Bernard KimandMarco André Dinis 6a7369d809 Include upgrader version in metrics and inventory (#35188)
* Add external upgrader version to proto message

* Inlcude upgrader version in metrics and inventory

* Include TELEPORT_EXT_UPGRADER_VERSION in deployment

* whitespace

* Include upgrader version in inventory ls

* Small docs change

* Use teleport-upgrade version if available

* Normalize version

* Address feedback

* Revert e

* Update lib/automaticupgrades/config.go

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>

---------

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>
2023-12-05 19:20:09 +00:00
fheinecke b178b8b732 Updated Teleport codebase to AGPL3 license (#35259)
Signed-off-by: Fred Heinecke <fred.heinecke@goteleport.com>
2023-12-01 17:48:14 +00:00
rosstimothy d5a796c056 Enable testify lint (#34222)
Updates our golangci-lint configuration to enable testifylint and
fixes all issues found.

Bump e ref to include gravitational/teleport.e#2567
2023-11-06 20:38:38 +00:00
Bernard Kim 27fae1a28a Add support for deploy service agent auto updates (#31982)
* Add support for ecs agent auto updates

* fix unit test

* Remove unused var

* Addres feedback

* Use list of available AWS database regions

* Run update task on proxy instances

* Revert GenerateAWSOIDCToken

* Move const to start of file

* Address feedback

* Create separate DeployServiceUpdater struct

* Address feedback

- Perform updates in parallel
- Add additional logging
- Add additional documentation

* debug

* Address feedback

- Check OwnershipTags
- Use semaphore pkg
- Release semaphore lease on success

* Make OwnershipTags explicitly required

* Add cluster alert

* Fix typo and update message

* Revert cluster alert

* Update err messages

* Check minimum compatible server version

* Update log msg
2023-10-10 22:00:09 +00:00
Marco André Dinis e32248c312 EC2 Instance Connect Endpoint: List EC2 Instances (#29366)
* EC2 Instance Connect Endpoint: List EC2 Instances

We must list the EC2 instances to the user, so they can pick one and
then add them as a Node.

This PR adds EC2 Instance Listing.
To do this, we convert the EC2 Instance into Teleport Server with a
special subkind: SubKindOpenSSHEC2InstanceConnectEndpointNode

This is similar to the ListDatabases endpoint.

* review pt1

* fix const and add test

* use any instead of interface{}
2023-08-10 11:26:10 +00:00
Marco André Dinis 48a113bb93 InstallScripts: pin teleport version using ServerVersion (#28149)
* InstallScripts: pin teleport version using ServerVersion

When Automatic Upgrades are enabled and the current installation is an
enterprise build, it will install teleport using:
- stable/cloud repo channel (yum, apt)
- pin the version to the one present at:
  https://updates.releases.teleport.dev/v1/stable/cloud/version

* improve comments
2023-06-23 15:45:36 +00:00
Marco André Dinis 3102b82770 Use stable/cloud when Automatic Upgrades is on. (#23395)
* Use `cloud/stable` when Automatic Upgrades is on.

Teleport provides scripts to install teleport agents/services.
Those scripts use YUM/DEB repositories when possible.
Each repo has multiple channels:
- stable/v11
- stable/v12
- cloud/stable

We want to ensure that if the cluster is running in the cloud and
automatic upgrades is on (auth service was started with
TELEPORT_AUTOMATIC_UPGRADES=yes teleport ...), then the installation
script must offer the `cloud/stable` channel.

This PR changes the following scripts:
- Discover Install Node
- Discover Install Database Service
- Install App script
- EC2 default-installer and EC2 default-agentless-installer

* add helm chart knobs to enable auto updater

* use let instead of const and remove default export

* add HA to helm chart

* always return .automatic_upgrades in web ping response

* rename cloud/stable to stable/cloud

* fix ts test
2023-03-28 16:05:09 +00:00