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

feat: custom image settings for k8s upgrade #8283

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

mstrohl
Copy link
Contributor

@mstrohl mstrohl commented Feb 8, 2024

Pull Request

Fixes: #8275

What? (description)

  • Adding management of private registries for k8s upgrades
  • set image before condition
  • format

Due to the usage of authentication for image pullin adding this in the pre-pull feature was to big that is why we enable the feature only on --pre-pull=false.
It could be another feature.

Why? (reasoning)

The cli patch MachineConfig using public registries. This break automatic upgrade because of public registries overwriting.

Acceptance

Please use the following checklist:

  • you linked an issue (if applicable)
  • you included tests (if applicable)
  • you ran conformance (make conformance)
  • you formatted your code (make fmt)
  • you linted your code (make lint)
  • you generated documentation (make docs)
  • you ran unit-tests (make unit-tests)

See make help for a description of the available targets.

Co-author : @g3offrey

Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

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

this PR sounds good, but it has a subtle issue - previously talosctl would always set the proper image ref, but right now it will try to update the previous one.

upstream k8s images, as well as Talos-provided kubelet images were migrated a couple of times, and this change will break that migration

k8s.gcr.io -> registry.k8s.io
ghcr.io/talos-systems -> ghcr.io/siderolabs

@smira
Copy link
Member

smira commented Feb 8, 2024

the reason I brought this up is that probably a more proper way is to use flags which give you base image references for each component, and you can override them if you want, but the tool still always doesn't patch the tag, but sets a complete reference.

also there's another ticket about pinning the images using digests (SHAs), which this PR would not support (but currently upgrade-k8s doesn't support them either)

@mstrohl
Copy link
Contributor Author

mstrohl commented Feb 8, 2024

Another commit will be pushed to add a flag for upgrade options

@mstrohl
Copy link
Contributor Author

mstrohl commented Feb 8, 2024

@smira I'm trying to manage proxy image too but I'm not sure where is managed .ProxyImage in DaemonSet template and if the manifest is managed differently between init and upgrade be cause as far as I know the version of the proxy image is base on talosctl default kubernetes version

@smira
Copy link
Member

smira commented Feb 8, 2024

@smira I'm trying to manage proxy image too but I'm not sure where is managed .ProxyImage in DaemonSet template and if the manifest is managed differently between init and upgrade be cause as far as I know the version of the proxy image is base on talosctl default kubernetes version

not sure what you mean, but talosctl upgrade-k8s does similar action in the end - it patches machine config with new version (and then fetches back manifests from Talos and syncs against Kubernetes, but that is less important).

@mstrohl
Copy link
Contributor Author

mstrohl commented Feb 13, 2024

Hello, I just have tested new flag and proxy kubelet images management that works well. Any change to see the PR moving forward ? (FYI gpg has been generated in a wsl, and i'm can't understand what is appening on number of commits.

Regards

@smira
Copy link
Member

smira commented Feb 13, 2024

it's not quite the way I saw this change, but I can take a look if I can twist the way I'd like to. We'll get it reviewed.

@smira smira self-assigned this Feb 13, 2024
@mstrohl
Copy link
Contributor Author

mstrohl commented Feb 13, 2024

Ok thank you, I wanted to wait this on to be merged before make a proposal on the digest capability base on that code.

@smira smira changed the title Feature reuse private registries in upgrade k8s command line feat: custom image settings for k8s upgrade Feb 15, 2024
@smira
Copy link
Member

smira commented Feb 15, 2024

/ok-to-test

@smira
Copy link
Member

smira commented Feb 15, 2024

@mstrohl please take a look, I reworked it to be a bit different, and more flexible

@mstrohl
Copy link
Contributor Author

mstrohl commented Feb 15, 2024

@smira look good to me

@smira
Copy link
Member

smira commented Feb 15, 2024

/promote integration-provision

Copy link
Member

@frezbo frezbo left a comment

Choose a reason for hiding this comment

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

Maybe a release notes too?

@smira
Copy link
Member

smira commented Feb 15, 2024

Maybe a release notes too?

probably, and also some words in the docs

Allows to use custom registry/images.

Fixes: siderolabs#8275

Co-authored-by:  @g3offrey
Signed-off-by: Matthieu STROHL <mstrohl@dive-in-it.com>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira
Copy link
Member

smira commented Feb 15, 2024

/m

@smira
Copy link
Member

smira commented Feb 15, 2024

/m

@talos-bot talos-bot merged commit 3fe82ec into siderolabs:main Feb 15, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backported
Development

Successfully merging this pull request may close these issues.

[upgrade-k8s] images paths overwrite by const while using private registries
5 participants