Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Support Patternless kubernetes and crio packages #1178

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

evrardjp
Copy link
Contributor

@evrardjp evrardjp commented Jun 19, 2020

Without this patch, skuba is not able to install the new
kind of packages (patternless).

This is a problem, as it's necessary to install caasp5.

This also tackles the upgrade case, where we remove
the previous packages, and install the new kind of pkgs.

Partial-Fixes: https://github.com/SUSE/avant-garde/issues/1663

Copy link
Contributor Author

@evrardjp evrardjp left a comment

Choose a reason for hiding this comment

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

Notes

// Runs a zypper install command wrapped with the right userdata and parameters
var cliArgs []string
cliArgs = append(cliArgs, "--userdata", "skuba")
cliArgs = append(cliArgs, "--non-interactive", "install", "--")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note self, that looks silly, maybe put it in one line.

@evrardjp evrardjp force-pushed the patternless branch 3 times, most recently from 3657add to 9df27a8 Compare June 22, 2020 14:56
@evrardjp
Copy link
Contributor Author

Rebased to include latest master changes, including the necessary 1.13 support.

@evrardjp evrardjp force-pushed the patternless branch 2 times, most recently from cee71d8 to 5bfdaad Compare June 23, 2020 07:59
@evrardjp
Copy link
Contributor Author

Retriggered CI now that the build service is configured with the correct repos.

@evrardjp
Copy link
Contributor Author

recheck

@evrardjp
Copy link
Contributor Author

evrardjp commented Jun 23, 2020

After a discussion at our standup today, we discussed about having extra feedback on patternless.

I discussed with Dirk today, and had a long chat/etherpad about alternatives (See it here https://etherpad.opendev.org/p/O9Ds7qdMcofMJdfsYyns )

I am now testing a PoC which doesn't imply Conflicts, only Requires, and Obsoletes, with different names. If that PoC is fine, I will update the packages and this PR, as it might mean some of the removals in here might not be needed anymore.

@evrardjp evrardjp changed the title [WIP] Support Patternless kubernetes packages [WIP] Support Patternless kubernetes and crio packages Jun 25, 2020
@evrardjp
Copy link
Contributor Author

Sadly, we went down the rabbithole with a weird behaviour in libsolv for the Obsoletes.
We're gonna drop that idea, and keep this patch idea the same.
The Patternless and versionappended therefore seems still the way to go.

However, as explained in the etherpad, we found a bug in the cri-o handling. This means that CRI-O also need to be versionappended.

This also means that "patternless" is harder, and might not make sense anymore!

However, the spirit behind patternless to simplify and be "versionappended" seems now more than ever necessary. I just fail to name/brand it properly :)
I am discussing with dirk if we should bring patterns back with versionappended cri-o and kubernetes, or if we keep patternless versionappended crio and k8s.

In the meantime, I have updated the PR to do patternless versionappended.

@evrardjp evrardjp force-pushed the patternless branch 3 times, most recently from 5a07fe3 to 1d57a58 Compare June 26, 2020 12:03
@evrardjp evrardjp requested a review from flavio June 26, 2020 12:36
return false, err
}
return true, nil
func (t *Target) zypperInstall(packages ...string) (stdout string, stderr string, error error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note to self, might want to expose this function.

@evrardjp evrardjp force-pushed the patternless branch 2 times, most recently from 01f98e6 to 53a82dd Compare June 26, 2020 14:30
@evrardjp
Copy link
Contributor Author

evrardjp commented Jun 26, 2020

skuba-update requires any version of kubernetes client, therefore the packaging of kubernetes-<version>-client should also provide kubernetes-client. I have updated the package. I will retrigger the build when the package is published.

@evrardjp
Copy link
Contributor Author

Seems like the greenfield empty kubernetes deployed just fine, but there was a problem with the addons. I will check what's going on on Monday

@evrardjp evrardjp changed the title [WIP] Support Patternless kubernetes and crio packages Support Patternless kubernetes and crio packages Jun 29, 2020
Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

LGTM so far, I haven't tested. I've left some comments along the way

Comment on lines +90 to +93
pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-kubeadm", current))
pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-kubelet", current))
pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-client", current))
pkgs = append(pkgs, fmt.Sprintf("+cri-o-%s*", current))
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could put these patterns inside of a constant list to reuse them later inside of the code (eg: kubernetesUpgradeOtherPkgs)?

Maybe two lists: phase1pkgs and phase2kpgs 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hesitated there, because I have the impression they will be fluctuating over time. But indeed, they aren't right now, so that might make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's keep that for now, if you don't mind.

Without this patch, skuba is not able to install the new
kind of packages (patternless).

This is a problem, as it is necessary to install
caasp5 this way, which itself is necessary because
migrations from caasp4 to caasp5 break clusters by
auto-upgrading to kubernetes 1.18 and cri-o
without using skuba.

This patch tackles both the greenfield and the upgrade
cases, where we remove the previous packages,
and install the new kind of pkgs.

Partial Fix: SUSE/avant-garde#1663
@evrardjp
Copy link
Contributor Author

I have resolved @flavio 's comments/concerns, and rebased this to test how this fares with Cilium 1.7 changes.

@evrardjp
Copy link
Contributor Author

I think we should go ahead and merge this PR and the packages into Devel:CaaSP:5, remove the previous kubernetes/cri-o packages in that repo.

@@ -56,24 +58,102 @@ func kubernetesUploadSecrets(errorHandling KubernetesUploadSecretsErrorBehavior)
}
}

func kubernetesInstallNodePattern(t *Target, data interface{}) error {
Copy link
Member

Choose a reason for hiding this comment

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

I'm missing a comment here, explaining the new return parameters


var pkgs []string

if currentV == "1.17" {
Copy link
Member

Choose a reason for hiding this comment

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

This is brittle and shouldn't be buried in the code. There should be a LAST_CAASP_4_K8S_VERSION (or so) constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can have that 1.17 as a constant, no problem. I suggest to do that as a follow up PR, to not delay this further.

// On 1.17 we can't remove kubernetes-1.17-kubeadm, because it doesn't exist.
// Removing kubeadm keeps kubelet alive.
// The rest needs to be removed on the next stage.
pkgs = append(pkgs, "-patterns-caasp-Node-1.17", "-kubernetes-kubeadm", "-cri-o-kubeadm-criconfig")
Copy link
Member

Choose a reason for hiding this comment

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

Frankly, this makes me cringe. Removal of v4 patterns/packages should be handled by Obsoletes imho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While this is a noble thing we tried, and should be working, we arrived to a libsolv issue/feature that was created for bad packagers, where an obsolete-ing package is considered as an upgrade candidate for the obsolete-d package (the tl;dr:). We can discuss this for later, but right now it works, and is user friendly enough IMO


var pkgs []string

if currentV == "1.17" {
Copy link
Member

Choose a reason for hiding this comment

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

see comment above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Will do so in a follow up PR.

Copy link
Contributor Author

@evrardjp evrardjp left a comment

Choose a reason for hiding this comment

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

I think we should go ahead, and fine tune this in a follow up PR. No need to retrigger all the tests and delay this patch further for cosmetics.

// On 1.17 we can't remove kubernetes-1.17-kubeadm, because it doesn't exist.
// Removing kubeadm keeps kubelet alive.
// The rest needs to be removed on the next stage.
pkgs = append(pkgs, "-patterns-caasp-Node-1.17", "-kubernetes-kubeadm", "-cri-o-kubeadm-criconfig")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While this is a noble thing we tried, and should be working, we arrived to a libsolv issue/feature that was created for bad packagers, where an obsolete-ing package is considered as an upgrade candidate for the obsolete-d package (the tl;dr:). We can discuss this for later, but right now it works, and is user friendly enough IMO


var pkgs []string

if currentV == "1.17" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can have that 1.17 as a constant, no problem. I suggest to do that as a follow up PR, to not delay this further.


var pkgs []string

if currentV == "1.17" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Will do so in a follow up PR.

@kkaempf
Copy link
Member

kkaempf commented Jun 30, 2020

Please create a github issue as a reminder for the follow up PR and reference this issue here. Then I'm fine to merge.

@evrardjp
Copy link
Contributor Author

I will just create another PR on top right after my meetings this morning.

Copy link
Contributor

@mssola mssola left a comment

Choose a reason for hiding this comment

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

Besides some comments that have already been noted, this looks good to me. But make sure to polish this later on.

Copy link

@chentex chentex left a comment

Choose a reason for hiding this comment

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

Seems that everyone is now on the same page

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants