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

pin k8s versions with integration tests #7236

Merged
merged 5 commits into from
Nov 11, 2021

Conversation

Pothulapati
Copy link
Contributor

@Pothulapati Pothulapati commented Nov 8, 2021

Fixes #7112

This pins the default integration tests to run on the latest
k3d version by retrieving the latest k3d binary, while also
pinning helm-deep to run on v1.20+ (our min k8s version). T
his way we have integration tests running on both sides
(i.e latest and minimum)

Changes include:

  • Update ./bin/k3d to always retrieve the latest k3d binary and
    use it.
  • Update _test-helpers.sh to use min version image for helm-deep.
    here, we also replace flags that are removed and replaced
    with newer ones with the latest k3d binary.

I've tried to find a GitHub action for K3s, but most of them seem to
be have a had a release while ago, and not goes well with our plan of
somehow getting the latest k8s.

Signed-off-by: Tarun Pothulapati tarunpothulapati@outlook.com

Fixes #7112

This pins the default integration tests to run on the latest
k3d version (which is currently `v5.0.3` and runs k3s `v1.21.5-k3s2`) by
retrieving the latest k3d binary, while also pinning `helm-deep` to run on
`v4.4.4` which runs k3s `v1.20.6-k3s1` (our min k8s version). This way
we have integration tests running on both sides (i.e latest and minimum)

Changes include:

- Update `./bin/k3d` to always retrieve the latest k3d binary and
  use it.
- Add new `./bin/k3d-min` script which pins the minimum k3d version
  (`v1.20.6-k3s1`) and uses it.
- Update `_test-helpers.sh` to use the new `./bin/k3d-min` script based
  on the test. here, we also replace flags that are removed and replaced
  with newer ones with the latest k3d binary.

I've tried to find a GitHub action for K3s, but most of them seem to
be have a had a release while ago, and not goes well with our plan of
somehow getting the latest k8s.

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
@Pothulapati Pothulapati requested a review from a team as a code owner November 8, 2021 06:06
@Pothulapati Pothulapati changed the title tarun/k8s integration test ver pin k8s versions with integration tests Nov 8, 2021
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

Thanks @Pothulapati . There's a bit of code repetition introduced in this change. Can you have start_single_test() simply react differently depending on some new arg? Similarly, I think we can get away with a single bin/k3d maybe through an env var (say K3D_VERSION) defaulting to "latest" (an env var instead of a script arg to avoid messing with the arg forwarding at the last line).

@olix0r
Copy link
Member

olix0r commented Nov 9, 2021

integration test failures when loading images:

ERRO[0010] failed to import images in node 'k3d-helm-deep-server-0': docker failed to create exec config for node 'k3d-helm-deep-server-0': Error response from daemon: Container 8771c4151174fdf1dd9ff5c50939411154617172d36ff2e6392503ad062356bc is restarting, wait until the container is running 
50
ERRO[0018] failed to import images in node 'k3d-helm-deep-server-0': Exec process in node 'k3d-helm-deep-server-0' failed with exit code '137'

Also note that the latest k3d release supports specifying logical versions like +v1.20 per https://github.com/rancher/k3d/releases/tag/v5.1.0

even to create a v1.20 cluster

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
@Pothulapati
Copy link
Contributor Author

Updated this PR, to use the latest k3d binary always but use an older image version with helm-deep as some flags are replaced btw binaries, and it's hard to maintain them based on version.

Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

Changes look good, but for some reason the helm-deep integration test is still show v1.21:
https://github.com/linkerd/linkerd2/runs/4163956319?check_suite_focus=true#step:8:32

@Pothulapati
Copy link
Contributor Author

@alpeb Yep, That is weird and I think that version is about the k3s wrapper. The k8s version seems to be the expected v1.20+ https://github.com/linkerd/linkerd2/runs/4163956319?check_suite_focus=true#step:8:61

Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

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

Nice!

bin/k3d Show resolved Hide resolved
@Pothulapati Pothulapati merged commit 5ba7d04 into main Nov 11, 2021
@Pothulapati Pothulapati deleted the tarun/k8s-integration-test-ver branch November 11, 2021 15:45
olix0r pushed a commit that referenced this pull request Apr 2, 2022
Fixes #7112

This pins the default integration tests to run on the latest
k3d version by retrieving the latest k3d binary, while also
pinning `helm-deep` to run on `v1.20+` (our min k8s version). T
his way we have integration tests running on both sides
(i.e latest and minimum)

Changes include:

- Update `./bin/k3d` to always retrieve the latest k3d binary and
  use it.
- Update `_test-helpers.sh` to use min version image for `helm-deep`.
  here, we also replace flags that are removed and replaced
  with newer ones with the latest k3d binary.

I've tried to find a GitHub action for K3s, but most of them seem to
be have a had a release while ago, and not goes well with our plan of
somehow getting the latest k8s.

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
(cherry picked from commit 5ba7d04)
Signed-off-by: Oliver Gould <ver@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run install tests on our minimum supported k8s version
4 participants