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

[kots]: add registry to preflight and support checks #11056

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Jun 30, 2022

Description

Adds a preflight and support checks to KOTS. As with the storage and database, this uses a container for this job. This extends the storage check so that the S3 backend can be checked as well

This uses Heroku's Docker Registry Client to check the validity of the credentials. I've looked through the source code and, whilst it's not what we're using in the Image Builder, it's a much simpler structure than used elsewhere in the project. From what I could see, we'd have to write (and therefore maintain) a credential checker as I've not found that exact operation in our existing codebase. It does seem to work as expected for all the registries I've checked (Azure, GCP).

The GCP URLs add in a custom check to ensure that they're using the correct server address. This is two-fold:

  1. the library always returns the server as authenticated if using gcr.io/project/repo, but uses the credentials if on gcr.io
  2. we've found that you have to set that with GCP

It's arguably a bit of a hacky approach (I'm open to suggestions), but it does work for our needs.

As with all the preflight checks, they don't prevent the user from deploying but are there to highlight whether it'll work or not. Whilst we shouldn't get any false negatives, the risk is low.

Related Issue(s)

Fixes #10337

How to test

Deploy to a cluster and run tests against the config prefligths

Release Notes

[kots]: add registry to preflight and support checks

Documentation

Werft options:

  • /werft with-preview

@mrsimonemms mrsimonemms force-pushed the sje/kots-registry-check branch 3 times, most recently from b604a93 to cf9a04a Compare July 1, 2022 12:56
@mrsimonemms mrsimonemms force-pushed the sje/kots-registry-check branch 2 times, most recently from 61b3502 to caedb60 Compare July 1, 2022 15:20
This checks a connection can be made, based upon the configuration
given.
@mrsimonemms mrsimonemms force-pushed the sje/kots-registry-check branch from caedb60 to 1e35438 Compare July 1, 2022 15:52
@mrsimonemms mrsimonemms marked this pull request as ready for review July 1, 2022 16:05
@mrsimonemms mrsimonemms requested a review from a team July 1, 2022 16:05
@github-actions github-actions bot added the team: delivery Issue belongs to the self-hosted team label Jul 1, 2022
@nandajavarma
Copy link
Contributor

nandajavarma commented Jul 6, 2022

/werft run no-preview publish-to-kots

👍 started the job as gitpod-build-sje-kots-registry-check.17
(with .werft/ from main)

@nandajavarma
Copy link
Contributor

This is so useful!! Thanks for adding! 🎊
registry_check

Copy link
Contributor

@nandajavarma nandajavarma left a comment

Choose a reason for hiding this comment

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

works great!!

@roboquat roboquat merged commit 57cb39f into main Jul 6, 2022
@roboquat roboquat deleted the sje/kots-registry-check branch July 6, 2022 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/XL team: delivery Issue belongs to the self-hosted team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KOTS registry pre-flight checks
3 participants