-
Notifications
You must be signed in to change notification settings - Fork 56
Support Patternless kubernetes and crio packages #1178
Conversation
There was a problem hiding this 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", "--") |
There was a problem hiding this comment.
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.
3657add
to
9df27a8
Compare
Rebased to include latest master changes, including the necessary 1.13 support. |
cee71d8
to
5bfdaad
Compare
Retriggered CI now that the build service is configured with the correct repos. |
recheck |
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. |
Sadly, we went down the rabbithole with a weird behaviour in libsolv for the Obsoletes. 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 :) In the meantime, I have updated the PR to do patternless versionappended. |
5a07fe3
to
1d57a58
Compare
return false, err | ||
} | ||
return true, nil | ||
func (t *Target) zypperInstall(packages ...string) (stdout string, stderr string, error error) { |
There was a problem hiding this comment.
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.
01f98e6
to
53a82dd
Compare
skuba-update requires any version of kubernetes client, therefore the packaging of |
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 |
There was a problem hiding this 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
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)) |
There was a problem hiding this comment.
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
🤔
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
I have resolved @flavio 's comments/concerns, and rebased this to test how this fares with Cilium 1.7 changes. |
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 { |
There was a problem hiding this comment.
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" { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment above
There was a problem hiding this comment.
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.
There was a problem hiding this 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") |
There was a problem hiding this comment.
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" { |
There was a problem hiding this comment.
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" { |
There was a problem hiding this comment.
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.
Please create a github issue as a reminder for the follow up PR and reference this issue here. Then I'm fine to merge. |
I will just create another PR on top right after my meetings this morning. |
There was a problem hiding this 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.
There was a problem hiding this 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
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