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

Test Fleet in Rancher on self-hosted runner #2804

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Commits on Sep 26, 2024

  1. Fix Fleet upgrade script to install Fleet in Rancher

    This is the basis for being able to test any given Fleet commit in
    Rancher, installing the latter through Helm.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    560e397 View commit details
    Browse the repository at this point in the history
  2. Install Rancher via Helm

    This simplifies Rancher installation, preventing a costly local build
    and simply making use of existing configuration options to override
    the Fleet version to install from a custom repository and branch.
    
    The Rancher Docker image to use is hard-coded for now.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    0917e69 View commit details
    Browse the repository at this point in the history
  3. Run Fleet-in-Rancher test workflow on self-hosted runner

    This is an attempt to use Rancher's org-wide hosted runners to test
    Fleet within Rancher, instead of dealing with GCP.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    b74dff6 View commit details
    Browse the repository at this point in the history
  4. Refresh CA certificates

    This may help prevent unknown authority errors when installing the
    Ginkgo CLI.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    2f662aa View commit details
    Browse the repository at this point in the history
  5. Use bci/bci-base:15.6 base image

    That image comes with CA certificates, curl and tar installed.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    420cb2a View commit details
    Browse the repository at this point in the history
  6. Skip Docker image building

    Images are already built when releasing Fleet charts against a test
    charts repository.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    bc142d2 View commit details
    Browse the repository at this point in the history
  7. Install helm and kubectl

    This makes use of a dedicated step to install remaining dependencies.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    accdb2c View commit details
    Browse the repository at this point in the history
  8. Run Fleet-in-Rancher tests against Ubuntu

    Do we really need a dedicated VM or self-hosted runner for this?
    Reusing the same setup as Fleet's multi-cluster tests to verify it.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    46d3e28 View commit details
    Browse the repository at this point in the history
  9. Remove Fleet update step

    Installing Rancher should directly take care of installing our test
    Fleet version.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    7fe4bb0 View commit details
    Browse the repository at this point in the history
  10. Install kubectl and other dependencies into ~/.local/bin

    This should fix permissions issues.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    da736cc View commit details
    Browse the repository at this point in the history
  11. Install helm from script

    This prevents issues about package `helm` not being found in Ubuntu
    repositories.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    db1f6e7 View commit details
    Browse the repository at this point in the history
  12. Add WIP script for testing Fleet in Rancher

    This could be reused in CI, after a few improvements.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    a738a25 View commit details
    Browse the repository at this point in the history
  13. Use non-containerized self-hosted runner

    `rancher/fleet` is now approved to use such runners, with help from EIO.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    d067cec View commit details
    Browse the repository at this point in the history
  14. Add rancher bin path to $PATH where needed

    Registering downstream clusters with Rancher requires the `rancher` CLI.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    afbbc4e View commit details
    Browse the repository at this point in the history
  15. Print shell commands when setting up Rancher

    This should help troubleshoot failures with `Process completed with exit
    code 1`.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    063bfe8 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    076b6b4 View commit details
    Browse the repository at this point in the history
  17. Compute public IP instead of hard-coding it

    This may eliminate errors with downstream cluster registration.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    5aa3527 View commit details
    Browse the repository at this point in the history
  18. Enable direct Fleet-in-Rancher workflow call

    This eases troubleshooting and enables testing Fleet against existing
    Rancher releases.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    de9a6d6 View commit details
    Browse the repository at this point in the history
  19. Skip rancher/rancher checkout

    This is not needed when installing Rancher from Helm instead of building
    it.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    3531931 View commit details
    Browse the repository at this point in the history
  20. Replace cert-manager CRDs install parameter

    Old parameter `installCRDs` is deprecated.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    092ef4b View commit details
    Browse the repository at this point in the history
  21. Require a non-empty command to import a cluster

    The Rancher CLI may output an empty command for a bit, leading
    `register-downstream-clusters.sh` to fail. Instead of trying to reverse
    engineer why that might be, we simply run `rancher cluster import`
    repeatedly until the returned command is non-empty.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    2499d01 View commit details
    Browse the repository at this point in the history
  22. Restore Tmate step for troubleshooting

    This could help us understand why downstream cluster registration fails
    in CI although it works locally.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    11a4a1d View commit details
    Browse the repository at this point in the history
  23. Fix downstream cluster registration

    When installing Rancher through Helm:
    * the `CATTLE_SERVER_URL` needs to be set to the same value as `hostname`
    * TLS mode must be set to `system-store`, to prevent cert-related errors
      when running a Fleet agent in a downstream cluster
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    6da4914 View commit details
    Browse the repository at this point in the history
  24. Ensure API server IP is available before setting it

    This waits for the upstream cluster to be ready, preventing an empty IP
    from being set.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    8883d22 View commit details
    Browse the repository at this point in the history
  25. Simplify TLS mode setting

    Environment variables are not necessary, as a dedicated Helm value
    exists.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    97ca39f View commit details
    Browse the repository at this point in the history
  26. Document testing Fleet in Rancher

    This moves `test-in-rancher` to the `dev` scripts directory, and briefly
    explains how to use it.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    2bb8222 View commit details
    Browse the repository at this point in the history
  27. Restore consistency in job blocks layout

    A newline follows the initial `-`, as in other workflows.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    c0d5cb0 View commit details
    Browse the repository at this point in the history
  28. Rename Fleet-in-Rancher test script

    The script does not actually test anything, and is now named
    consistently with other scripts living in the `dev/` folder.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    0ee61e1 View commit details
    Browse the repository at this point in the history
  29. Remove cluster setup from Fleet-in-Rancher dev script

    The script would not manage a cluster's lifecycle beyond its creation
    anyway, and doing so would be harder to automate. It is therefore left
    out of the script's scope.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    8e9506f View commit details
    Browse the repository at this point in the history
  30. Create new workflow for testing Fleet in Rancher

    This leaves the original workflow in place, upgrading Fleet in Rancher.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    0bc41a4 View commit details
    Browse the repository at this point in the history
  31. Remove test workload block

    That block is not necessary, as tests are run against clusters
    afterwards.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    c2a0225 View commit details
    Browse the repository at this point in the history
  32. Add acceptance tests to Fleet-in-Rancher test workflow

    This ensures that Fleet examples are validated against Fleet in Rancher.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    7b82940 View commit details
    Browse the repository at this point in the history
  33. Comment out branch check

    That check is only relevant when using a custom charts branch.
    weyfonk committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    7c318a1 View commit details
    Browse the repository at this point in the history