-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Kubeadm add v1beta1 config #69289
Kubeadm add v1beta1 config #69289
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.
Thank you @fabriziopandini ! At a quick first pass this looks OK. I'll do another, more thorough review tomorrow.
// v1alpha2 -> v1alpha3 migration. As the ComponentConfigs were embedded in the structs | ||
// earlier now have moved out it's not possible to do a lossless roundtrip "the normal way" | ||
// When we support v1alpha3 and higher only, we can reenable this | ||
|
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 probably needs to be moved to #69058
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.
You are right, but I missed that train, so I'm fixing it here
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, thanks a lot!
}, | ||
}, | ||
{ | ||
name: "invalid v1beta1 - No CLusterStatus in kubeadm-config ConfigMap", |
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.
super minor nit:
CLusterStatus
-> ClusterStatus
(appears more than once in this file)
{ | ||
name: "invalid v1beta1 - No CLusterStatus in kubeadm-config ConfigMap", | ||
configMap: fakeConfigMap{ | ||
name: kubeadmconstants.InitConfigurationConfigMap, // ClusterConfiguration from kubeadm-config. |
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.
the typecheck CI complains about this const missing.
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.
The merger of #69275 renamed InitConfigurationConfigMap
to KubeadmConfigConfigMap
, thus this test file won't compile.
{ | ||
name: "invalid v1beta1 - No CLusterStatus in kubeadm-config ConfigMap", | ||
configMap: fakeConfigMap{ | ||
name: kubeadmconstants.InitConfigurationConfigMap, // ClusterConfiguration from kubeadm-config. |
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.
The merger of #69275 renamed InitConfigurationConfigMap
to KubeadmConfigConfigMap
, thus this test file won't compile.
@@ -115,7 +115,6 @@ evictionHard: | |||
imagefs.available: 15% | |||
memory.available: 100Mi | |||
nodefs.available: 10% | |||
nodefs.inodesFree: 5% |
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.
Test failure here:
--- FAIL: TestConfigFileAndDefaultsToInternalConfig (0.94s)
--- FAIL: TestConfigFileAndDefaultsToInternalConfig/incompleteYAMLToDefaultedv1beta1 (0.00s)
masterconfig_test.go:123: the expected and actual output differs.
in: testdata/defaulting/master/incomplete.yaml
out: testdata/defaulting/master/defaulted.yaml
groupversion: kubeadm.k8s.io/v1beta1
diff:
--- expected
+++ actual
@@ -115,6 +115,7 @@
imagefs.available: 15%!
(MISSING) memory.available: 100Mi
nodefs.available: 10%!
(MISSING)+ nodefs.inodesFree: 5%!
(MISSING) evictionPressureTransitionPeriod: 5m0s
failSwapOn: true
fileCheckFrequency: 20s
FAIL
FAIL k8s.io/kubernetes/cmd/kubeadm/app/util/config 1.007s
There is probably some change in the KubeletConfig here. So whenever a change is made there we need to update this. We may want to just check if we have the right kind
here. Yet, this is a job for another PR.
e6798c0
to
1e5e7e0
Compare
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.
Minor comments otherwise LGTM
/approve
// for both validation of the practically of the API server from a joining node's point | ||
// of view and as an authentication method for the node in the bootstrap phase of | ||
// "kubeadm join". This token is and should be short-lived | ||
type BootstrapTokenString struct { |
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.
So with bootstrap tokens finding a landing home this cycle do we still need this? We've been carrying this for a while now.
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.
If you don't mind I will iterate on this in a separated PR trying to get rid of the code for bootstrap token management that now is duplicated for each API version
limitations under the License. | ||
*/ | ||
|
||
// +k8s:defaulter-gen=TypeMeta |
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.
You may need to pull in @neolit123 's recent changes here.
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.
Done
@@ -228,6 +229,7 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command { | |||
locally in the CLI tool without ever touching anything in the cluster. | |||
In this version of kubeadm, the following API versions are supported: | |||
- %s | |||
- %s |
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.
?
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 gives some info about api version supported by kubeadm command migrate...
@@ -231,32 +232,28 @@ func TestImagesPull(t *testing.T) { | |||
} | |||
|
|||
func TestMigrate(t *testing.T) { | |||
/* | |||
TODO: refactor this to test v1alpha3 --> v1beta1 after introducing v1beta1 | |||
cfg := []byte(dedent.Dedent(` |
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.
Fine for now, but next time we can break this out as a follow-up PR.
1e5e7e0
to
b99deb4
Compare
b99deb4
to
b4092ac
Compare
/test pull-kubernetes-integration |
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
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: fabriziopandini, timothysc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
This PR adds v1beta1 version of kubeadm config API.
Which issue(s) this PR fixes:
Ref: kubernetes/kubeadm#911
Special notes for your reviewer:
Sorry about the size of this PR 😧
Depends on:
Please consider latest 4 commits:
Release note:
@kubernetes/sig-cluster-lifecycle-pr-reviews
/sig cluster-lifecycle
/kind api-change
/area kubeadm
/cc @timothysc @luxas @rosti