Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce tbot-distroless image #38259

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

strideynet
Copy link
Contributor

@strideynet strideynet commented Feb 15, 2024

Closes #21280

Paired with https://github.com/gravitational/teleport.e/pull/3465

changelog: tbot-distroless image is now published. This contains just the tbot binary and therefore has a smaller image size.

Successful build: https://drone.platform.teleport.sh/gravitational/teleport/34023
Image: public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.1

Working docker run:

docker run public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.1                                                                   
Unable to find image 'public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.1' locally
16.0.0-dev.noah.tbr.1: Pulling from gravitational/tbot-distroless
8398841c8311: Pull complete 
2b776ada0341: Pull complete 
2a977872b36c: Pull complete 
fcb6f6d2c998: Pull complete 
e8c73c638ae9: Pull complete 
1e3d9b7d1452: Pull complete 
4aa0ea1413d3: Pull complete 
2fa82a9c76b2: Pull complete 
672354a91bfa: Pull complete 
acd581f1e199: Pull complete 
972a9f56458f: Pull complete 
810b5cc4682a: Pull complete 
45c2519a3853: Pull complete 
2b9c28259b9a: Pull complete 
0d7c3f6d6dc4: Pull complete 
Digest: sha256:1d2d377a93cbff0c66953670c19eef2e793d3c630f361758fec802fe0565078a
Status: Downloaded newer image for public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.1
Usage: tbot [<flags>] <command> [<args> ...]

Teleport Machine ID

Machine ID issues and renews short-lived certificates so your machines can
access Teleport protected resources in the same way your engineers do!

Find out more at https://goteleport.com/docs/machine-id/introduction/

Flags:
  -d, --[no-]debug  Verbose logging to stdout.
  -c, --config      Path to a configuration file.
      --[no-]fips   Runs tbot in FIPS compliance mode. This requires the FIPS
                    binary is in use.

Commands:
  help         Show help.
  version      Print the version of your tbot binary.
  start        Starts the renewal bot, writing certificates to the data dir at a set interval.
  init         Initialize a certificate destination directory for writes from a separate bot user.
  configure    Creates a config file based on flags provided, and writes it to stdout or a file (-c <path>).
  migrate      Migrates a config file from an older version to the newest version. Outputs to stdout by default.
  db           Execute database commands through tsh.
  proxy        Start a local TLS proxy via tsh to connect to Teleport in single-port mode.

Try 'tbot help [command]' to get help for a given command.

@strideynet
Copy link
Contributor Author

I'll rebase out the "Release" commit once this is all approved ;)

@strideynet strideynet marked this pull request as ready for review February 15, 2024 18:59
Copy link
Contributor

@marcoandredinis marcoandredinis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but I would rather have someone from Tooling review this as well

build.assets/charts/Dockerfile-tbot-distroless Outdated Show resolved Hide resolved
Copy link
Contributor

@camscale camscale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How quickly do you need to get this in? I'd very much prefer to avoid adding to Drone right now, as I am currently moving everything off it. It's a slow and painful process but I hope to have it complete by the end of the week. If you can hold off a little, I'll work with you to get this into the GHA build/publish workflows instead.

build.assets/charts/Dockerfile-tbot-distroless Outdated Show resolved Hide resolved
dronegen/promote.go Outdated Show resolved Hide resolved
dronegen/tag.go Outdated Show resolved Hide resolved
@strideynet
Copy link
Contributor Author

How quickly do you need to get this in? I'd very much prefer to avoid adding to Drone right now, as I am currently moving everything off it. It's a slow and painful process but I hope to have it complete by the end of the week. If you can hold off a little, I'll work with you to get this into the GHA build/publish workflows instead.

More than happy to hold off - especially if it means this can go straight into GHA instead of drone. I'll regroup with you next week on this - thank you Cam.

@strideynet
Copy link
Contributor Author

strideynet commented Feb 26, 2024

Successful build in the pure GHA environment: https://github.com/gravitational/teleport.e/actions/runs/8055743348

Successful publish in a pure GHA environment: https://github.com/gravitational/teleport.e/actions/runs/8056429084

➜  teleport git:(strideynet/tbot-docker-image-remastered) ✗ docker run public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.5
Unable to find image 'public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.5' locally
16.0.0-dev.noah.tbr.5: Pulling from gravitational/tbot-distroless
8398841c8311: Already exists 
2b776ada0341: Already exists 
2a977872b36c: Already exists 
fcb6f6d2c998: Already exists 
e8c73c638ae9: Already exists 
1e3d9b7d1452: Already exists 
4aa0ea1413d3: Already exists 
2fa82a9c76b2: Already exists 
672354a91bfa: Already exists 
acd581f1e199: Already exists 
972a9f56458f: Already exists 
810b5cc4682a: Already exists 
45c2519a3853: Already exists 
2b9c28259b9a: Already exists 
ed49bf97d7a7: Pull complete 
Digest: sha256:9914a8a4d82ac4dbfa131dcf421f2bf10c46736d5b8f2483c0c2a196feb8bbef
Status: Downloaded newer image for public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.5
Usage: tbot [<flags>] <command> [<args> ...]

Teleport Machine ID

Machine ID issues and renews short-lived certificates so your machines can
access Teleport protected resources in the same way your engineers do!

Find out more at https://goteleport.com/docs/machine-id/introduction/

Flags:
  -d, --[no-]debug  Verbose logging to stdout.
  -c, --config      Path to a configuration file.
      --[no-]fips   Runs tbot in FIPS compliance mode. This requires the FIPS
                    binary is in use.

Commands:
  help         Show help.
  version      Print the version of your tbot binary.
  start        Starts the renewal bot, writing certificates to the data dir at a set interval.
  init         Initialize a certificate destination directory for writes from a separate bot user.
  configure    Creates a config file based on flags provided, and writes it to stdout or a file (-c <path>).
  migrate      Migrates a config file from an older version to the newest version. Outputs to stdout by default.
  db           Execute database commands through tsh.
  proxy        Start a local TLS proxy via tsh to connect to Teleport in single-port mode.

Try 'tbot help [command]' to get help for a given command.

@strideynet
Copy link
Contributor Author

Running v16.0.0-dev.noah.tbr.6 build to test b326428

@strideynet
Copy link
Contributor Author

Once I've got approval on both sides, I'll drop the release commits from this branch.

@strideynet strideynet requested a review from camscale February 26, 2024 22:34
Copy link
Contributor

@camscale camscale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has still got drone stuff in it that should be dropped. All this PR needs is the Dockerfile-tbot-distroless file.

To keep the version stuff from a dev tag build getting on the PR, what I often do is create a test branch on top of the PR branch (strideynet/test/tbot-docker-image-remastered in this case) and run make update-version; make update-tag on that. The test branch does not even need to be pushed, since the tag is pushed. Then I throw away the branch when I'm done.

I don't like to approve PRs that have the version changes in it in case some accidentally gets merged - I think it's cleaner and easier to leave it off the PR.

build.assets/charts/Dockerfile-tbot-distroless Outdated Show resolved Hide resolved
build.assets/charts/Dockerfile-tbot-distroless Outdated Show resolved Hide resolved
@strideynet strideynet force-pushed the strideynet/tbot-docker-image-remastered branch from fa2a8f3 to 0326745 Compare February 27, 2024 09:23
@strideynet
Copy link
Contributor Author

strideynet commented Feb 27, 2024

Running https://github.com/gravitational/teleport.e/actions/runs/8062741799 to validate deb extraction changes and changes on e to use version action.

Failed due to incorrect config

Fixed config and rerunning https://github.com/gravitational/teleport.e/actions/runs/8064136416

@strideynet
Copy link
Contributor Author

➜  teleport git:(strideynet/migrate-remote-cluster-rpcs-to-grpc) ✗ docker run public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.8
Unable to find image 'public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.8' locally
16.0.0-dev.noah.tbr.8: Pulling from gravitational/tbot-distroless
8398841c8311: Pull complete 
2b776ada0341: Pull complete 
2a977872b36c: Pull complete 
fcb6f6d2c998: Pull complete 
e8c73c638ae9: Pull complete 
1e3d9b7d1452: Pull complete 
4aa0ea1413d3: Pull complete 
2fa82a9c76b2: Pull complete 
672354a91bfa: Pull complete 
acd581f1e199: Pull complete 
972a9f56458f: Pull complete 
810b5cc4682a: Pull complete 
45c2519a3853: Pull complete 
2b9c28259b9a: Pull complete 
0be80286843c: Pull complete 
Digest: sha256:15008c9ada589182e39aea6914dc53d0bc409ab46cb8e0eea5b9b284b9b2f32b
Status: Downloaded newer image for public.ecr.aws/gravitational/tbot-distroless:16.0.0-dev.noah.tbr.8
Usage: tbot [<flags>] <command> [<args> ...]

Teleport Machine ID

Machine ID issues and renews short-lived certificates so your machines can
access Teleport protected resources in the same way your engineers do!

Find out more at https://goteleport.com/docs/machine-id/introduction/

Flags:
  -d, --[no-]debug  Verbose logging to stdout.
  -c, --config      Path to a configuration file.
      --[no-]fips   Runs tbot in FIPS compliance mode. This requires the FIPS
                    binary is in use.

Commands:
  help         Show help.
  version      Print the version of your tbot binary.
  start        Starts the renewal bot, writing certificates to the data dir at a set interval.
  init         Initialize a certificate destination directory for writes from a separate bot user.
  configure    Creates a config file based on flags provided, and writes it to stdout or a file (-c <path>).
  migrate      Migrates a config file from an older version to the newest version. Outputs to stdout by default.
  db           Execute database commands through tsh.
  proxy        Start a local TLS proxy via tsh to connect to Teleport in single-port mode.

Try 'tbot help [command]' to get help for a given command.

Successful build, publish and run based on the last commit!

@strideynet strideynet requested a review from camscale February 27, 2024 16:25
Copy link
Contributor

@camscale camscale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good now. I'm pleased with how simple it's ended up.

@strideynet strideynet added this pull request to the merge queue Feb 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 28, 2024
@strideynet strideynet added this pull request to the merge queue Feb 28, 2024
Merged via the queue into master with commit 3d8d39f Feb 28, 2024
34 checks passed
@strideynet strideynet deleted the strideynet/tbot-docker-image-remastered branch February 28, 2024 09:26
@public-teleport-github-review-bot

@strideynet See the table below for backport results.

Branch Result
branch/v13 Create PR
branch/v14 Create PR
branch/v15 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standalone tbot docker image
4 participants