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

Update kubeadm api version from v1beta1 to v1beta2 #6150

Merged
merged 21 commits into from
Feb 5, 2020

Conversation

alonyb
Copy link

@alonyb alonyb commented Dec 22, 2019

This PR makes a new validation for Kubernetes v1.17.0 or higher

Updating the template v1beta1, since it is for previous versions of Kubernetes

Add new kubeadm template (v1beta2) for Kubernetes v1.17.0 or higher

This PR should fix #6106

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 22, 2019
@k8s-ci-robot
Copy link
Contributor

Welcome @RubenBaez!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @RubenBaez. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 22, 2019
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@codecov-io
Copy link

codecov-io commented Dec 22, 2019

Codecov Report

Merging #6150 into master will increase coverage by 0.48%.
The diff coverage is 31.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6150      +/-   ##
==========================================
+ Coverage   37.46%   37.95%   +0.48%     
==========================================
  Files         128      128              
  Lines        8650     8716      +66     
==========================================
+ Hits         3241     3308      +67     
+ Misses       4990     4982       -8     
- Partials      419      426       +7
Impacted Files Coverage Δ
pkg/minikube/out/style.go 91.66% <ø> (ø) ⬆️
pkg/minikube/driver/driver.go 71.83% <ø> (+0.99%) ⬆️
pkg/minikube/bootstrapper/bsutil/files.go 0% <ø> (ø) ⬆️
cmd/minikube/cmd/config/profile_list.go 3.94% <0%> (ø) ⬆️
cmd/minikube/cmd/config/addons_list.go 11.59% <0%> (-0.18%) ⬇️
cmd/minikube/cmd/config/disable.go 20% <0%> (ø) ⬆️
cmd/minikube/cmd/status.go 26.31% <0%> (+19.41%) ⬆️
pkg/minikube/service/service.go 77.83% <0%> (ø) ⬆️
cmd/minikube/cmd/unpause.go 7.89% <0%> (ø) ⬆️
cmd/minikube/cmd/service.go 17.94% <0%> (-0.48%) ⬇️
... and 18 more

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 22, 2019
@medyagh
Copy link
Member

medyagh commented Dec 23, 2019

thank you for this PR ! I was just hoping someone would make this !

@medyagh
Copy link
Member

medyagh commented Dec 23, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 23, 2019
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

is it possible to add unit tests like other ones ?

@alonyb alonyb requested a review from medyagh December 23, 2019 10:35
@medyagh
Copy link
Member

medyagh commented Dec 24, 2019

/retest this please

serviceSubnet: {{.ServiceCIDR}}
scheduler: {}
`))

Copy link
Contributor

Choose a reason for hiding this comment

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

kind: KubeletConfiguration doesn't exist here.
Is it OK?
Or kind: KubeletConfiguration isn't needed in Kubernetes v1.17+ ?

Copy link
Author

Choose a reason for hiding this comment

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

@atoato88 the new config file v1beta2.yaml does not have kind: KubeletConfiguration, you can check the new file here

Copy link
Author

Choose a reason for hiding this comment

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

@atoato88 I was reviewing a little more detail and found that kind: KubeletConfiguration is necessary, so I wrote it.

Copy link
Contributor

Choose a reason for hiding this comment

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

@RubenBaez
Thank you to response 👍

@alonyb alonyb requested a review from atoato88 December 27, 2019 12:28
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

@RubenBaez
I just noticed this PR, overrides the image repostiory. to imageRepository: k8s.gcr.io
please fix that.

and also make sure the order of the block is the same as v1beta1 so we can diff and compare.
the current v1beta1 is

apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
  advertiseAddress: {{.AdvertiseAddress}}
  bindPort: {{.APIServerPort}}
bootstrapTokens:
  - groups:
      - system:bootstrappers:kubeadm:default-node-token
    ttl: 24h0m0s
    usages:
      - signing
      - authentication
nodeRegistration:
  criSocket: {{if .CRISocket}}{{.CRISocket}}{{else}}/var/run/dockershim.sock{{end}}
  name: {{.NodeName}}
  taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
{{ if .ImageRepository}}imageRepository: {{.ImageRepository}}
{{end}}{{range .ExtraArgs}}{{.Component}}:
  extraArgs:
{{- range $i, $val := printMapInOrder .Options ": " }}
    {{$val}}
{{- end}}
{{end -}}
{{if .FeatureArgs}}featureGates:
{{range $i, $val := .FeatureArgs}}{{$i}}: {{$val}}
{{end -}}{{end -}}
certificatesDir: {{.CertDir}}
clusterName: kubernetes
controlPlaneEndpoint: localhost:{{.APIServerPort}}
dns:
  type: CoreDNS
etcd:
  local:
    dataDir: {{.EtcdDataDir}}
kubernetesVersion: {{.KubernetesVersion}}
networking:
  dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}
  podSubnet: ""
  serviceSubnet: {{.ServiceCIDR}}
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
  nodefs.available: "0%"
  nodefs.inodesFree: "0%"
  imagefs.available: "0%"

@@ -105,6 +105,10 @@ func GenerateKubeadmYAML(k8s config.KubernetesConfig, r cruntime.Manager) ([]byt
if version.GTE(semver.MustParse("1.14.0-alpha.0")) {
configTmpl = template.KubeAdmConfigTmplV1Beta1
}
// v1beta2 isn't required until v1.18.
if version.GTE(semver.MustParse("1.18.0-alpha.0")) {

Choose a reason for hiding this comment

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

The comment for this PR and the comments in the linked issue say that v1beta2 should be used for v1.17 and higher, so this should parse 1.17.0 instead of 1.18.0-alpha.0

Copy link
Author

Choose a reason for hiding this comment

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

@priyawadhwa I made the change, thank you.

@alonyb
Copy link
Author

alonyb commented Jan 9, 2020

@medyagh I made a refactor for all your observations, may you check it pls.

@tstromberg
Copy link
Contributor

This seems to be erroring with:

no kind "KubeletConfiguration" is registered for version "kubelet.config.k8s.io/v1beta2" in scheme "k8s.io/kubernetes/cmd/kubeadm/app/componentconfigs/scheme.go:28"
To see the stack trace of this error execute with --v=5 or higher

Copy link
Contributor

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

Any chance we could get this merged before v1.7 (Jan 30)?

@@ -35,11 +36,3 @@ networking:
dnsDomain: cluster.local
podSubnet: "192.168.32.0/20"
serviceSubnet: 10.96.0.0/12
---
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this expected? Shouldn't we still be setting the eviction settings for this version?

@alonyb
Copy link
Author

alonyb commented Jan 24, 2020

Any chance we could get this merged before v1.7 (Jan 30)?

@tstromberg
Yes, I needed some help with this, but with your observations, I will solve it

@minikube-pr-bot
Copy link

All Times minikube: [ 97.416506 94.083811 96.239326]
All Times Minikube (PR 6150): [ 247.929842 247.169260 225.332168]

Average minikube: 95.913215
Average Minikube (PR 6150): 240.143757

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6150) |
+----------------------+-----------+--------------------+
| minikube v           |  0.344319 |           0.312017 |
| Creating kvm2        | 20.051961 |         161.118707 |
| Preparing Kubernetes | 48.144813 |          41.886342 |
| Pulling images       |  3.684445 |           2.786951 |
| Launching Kubernetes | 20.892309 |          31.420314 |
| Waiting for cluster  |  2.741720 |           2.567278 |
+----------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

All Times Minikube (PR 6150): [ 243.863336 243.266605 244.269333]
All Times minikube: [ 94.761209 92.763189 93.702278]

Average minikube: 93.742225
Average Minikube (PR 6150): 243.799758

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6150) |
+----------------------+-----------+--------------------+
| minikube v           |  0.314972 |           0.298141 |
| Creating kvm2        | 19.831534 |         160.827834 |
| Preparing Kubernetes | 48.051217 |          41.482605 |
| Pulling images       |  4.705168 |           2.104074 |
| Launching Kubernetes | 17.727333 |          36.626825 |
| Waiting for cluster  |  3.061901 |           2.410574 |
+----------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

All Times minikube: [ 96.111827 94.730622 93.253393]
All Times Minikube (PR 6150): [ 248.333713 245.073672 246.087308]

Average minikube: 94.698614
Average Minikube (PR 6150): 246.498231

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6150) |
+----------------------+-----------+--------------------+
| minikube v           |  0.352877 |           0.289141 |
| Creating kvm2        | 20.168156 |         161.991872 |
| Preparing Kubernetes | 48.715376 |          41.605521 |
| Pulling images       |  3.879183 |           2.387986 |
| Launching Kubernetes | 18.953242 |          37.434996 |
| Waiting for cluster  |  2.576609 |           2.738024 |
+----------------------+-----------+--------------------+

@alonyb
Copy link
Author

alonyb commented Jan 28, 2020

@medyagh @tstromberg
This PR needs integration tests. Could you give me a hand with that??

@medyagh
Copy link
Member

medyagh commented Jan 28, 2020

@alonyb our jenkins is under maintenance, I will trigger the test once that is solved

@medyagh
Copy link
Member

medyagh commented Jan 28, 2020

@alonyb meanwhile please run the integration tests locally on your machine to save some time in case they fail

@medyagh
Copy link
Member

medyagh commented Jan 29, 2020

/ok-to-test

@medyagh
Copy link
Member

medyagh commented Jan 29, 2020

@alonyb the tests are back! but the PR needs rebase

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 29, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 30, 2020
@minikube-pr-bot
Copy link

All Times minikube: [ 95.702665 92.912852 96.515810]
All Times Minikube (PR 6150): [ 97.228434 94.103321 96.487714]

Average minikube: 95.043776
Average Minikube (PR 6150): 95.939823

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6150) |
+----------------------+-----------+--------------------+
| minikube v           |  0.312702 |           0.289359 |
| Creating kvm2        | 20.173137 |          20.980114 |
| Preparing Kubernetes | 48.787080 |          48.259834 |
| Pulling images       |  4.015279 |           4.064154 |
| Launching Kubernetes | 18.634784 |          19.377848 |
| Waiting for cluster  |  3.069851 |           2.918740 |
+----------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

All Times Minikube (PR 6150): [ 97.999055 94.501333 95.064245]
All Times minikube: [ 96.376761 95.614129 97.162683]

Average minikube: 96.384524
Average Minikube (PR 6150): 95.854878

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6150) |
+----------------------+-----------+--------------------+
| minikube v           |  0.318748 |           0.296932 |
| Creating kvm2        | 20.383150 |          20.467187 |
| Preparing Kubernetes | 49.622480 |          49.496467 |
| Pulling images       |  3.380541 |           3.884579 |
| Launching Kubernetes | 19.873408 |          19.096843 |
| Waiting for cluster  |  2.753409 |           2.564274 |
+----------------------+-----------+--------------------+

@alonyb
Copy link
Author

alonyb commented Jan 31, 2020

@medyagh
I Update the changes to the Master branch, but there are problems with the integration tests that are not about the changes I made.

@minikube-pr-bot
Copy link

All Times minikube: [ 100.278850 96.590662 98.063022]
All Times Minikube (PR 6150): [ 97.660433 97.579082 100.055291]

Average minikube: 98.310845
Average Minikube (PR 6150): 98.431602

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6150) |
+----------------------+-----------+--------------------+
| minikube v           |  0.327642 |           0.301167 |
| Creating kvm2        | 20.227161 |          19.987334 |
| Preparing Kubernetes | 50.834209 |          49.719880 |
| Pulling images       |  3.704028 |           3.664736 |
| Launching Kubernetes | 19.493314 |          20.212605 |
| Waiting for cluster  |  1.059263 |           2.715277 |
+----------------------+-----------+--------------------+

@tstromberg tstromberg changed the title wip: Update kubeadm api version from v1beta1 to v1beta2, fixes #6106 Update kubeadm api version from v1beta1 to v1beta2 Feb 5, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 5, 2020
@tstromberg tstromberg merged commit 089a6c2 into kubernetes:master Feb 5, 2020
@tstromberg
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update kubeadm api version from v1beta1 to v1beta2