Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

e2e: Add image release test #2752

Merged
merged 8 commits into from
Jan 21, 2020
Merged

Conversation

2opremio
Copy link
Contributor

@2opremio 2opremio commented Jan 16, 2020

All tests until now run without using the registry scanner, so I thought it was about time to have an end-to-end test for image releases (which is a fundamental Flux feature)

We probably shouldn't depend on external registries (particularly on stefanprodan/podinfo since it is often updated) for tests. I plan to add an internal registry to the tests, but that will come later. If this test becomes too flakey I am happy to disable it until then. (I have added a local registry for Flux)

Addresses part of #2593 (adds a test covering fluxctl release).

TODO:

  • Test automatic image releases
  • Test HelmRelease image updates

@2opremio 2opremio force-pushed the e2e-release-image branch 2 times, most recently from edc8a12 to 9db9cec Compare January 16, 2020 23:30
@2opremio
Copy link
Contributor Author

The bitnami images (e.g. bitnami/ghost ) from the flux-get-started repo have too many tags and we get rate-limited. This makes the test timeout.

I am considering to create and use a branch in flux-get-started guide, pointing to images from a registry local to the e2e tests. However, we would still need to load the redis/ghost/mongodb images in the local registry, which will take time.

Another option is to create a new example altogether, with tiny images. I wouldn't want to maintain that though.

@stefanprodan @hiddeco any other ideas?

@hiddeco
Copy link
Member

hiddeco commented Jan 17, 2020

Another option is to create a new example altogether, with tiny images. I wouldn't want to maintain that though.

We can build empty FROM scratch (or almost empty, given our label support) images in a loop in combination with a registry container and set the labels using --label 'date=$(date)', building ten images would take about a second and it requires no maintenance.

@2opremio
Copy link
Contributor Author

Ah, it seems I can use an insecure registry mirror kubernetes-sigs/kind#110 (comment)

This will allow us to use the flux-started-guide unchanged.

However this implies changing the k8s node configuration, which I can do for Kind but won't work in general.

I think I can l live with that.

@2opremio
Copy link
Contributor Author

@2opremio
Copy link
Contributor Author

I think I can l live with that.

It's not ideal though, because I don't want to use Kind when working on the tests locally

@2opremio
Copy link
Contributor Author

Here is an intermediate solution. Only make Flux use a local registry without changing the k8s configuration.

Kubernetes will pull images in whatever way it used to but Flux will query the local registry.

When spawning Kind we can also use a mirror.

In fact, if we don't change the get-started example we also need to modify Flux's configuration.

@2opremio
Copy link
Contributor Author

2opremio commented Jan 20, 2020

I bit the bullet and I added a local registry to the test. Note that the registry is only used by Flux to scan images (and not by the cluster).

Adding an /etc/hosts entry for the registry allowed me to keep using https://github.com/fluxcd/flux-get-started as is.

@2opremio
Copy link
Contributor Author

We may also want to change Kind's registry to a local one by leveraging #2752 (comment) , but that's for later.

@2opremio 2opremio marked this pull request as ready for review January 20, 2020 17:16
@2opremio 2opremio requested a review from hiddeco January 20, 2020 17:16
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Amazing work Fons, thanks 🥇

@2opremio 2opremio merged commit c80d6bc into fluxcd:master Jan 21, 2020
@2opremio 2opremio added this to the 1.18.0 milestone Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants