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

Fix embed-certs global config #11576

Merged

Conversation

JacekDuszenko
Copy link
Contributor

fixes #11253
Fix embed-certs global config by adding embed-certs json tag to EmbedCerts field in ClusterConfig struct.

Unmarshaler in https://github.com/kubernetes/minikube/blob/master/pkg/minikube/config/config.go#L199 wasn't able to deserialize embed-certs json field into EmbedCerts string member variable in ClusterConfig.

That's why existing config in https://github.com/kubernetes/minikube/blob/master/cmd/minikube/cmd/start.go#L173 was created without given flag.

Now global config option successfully initialises cert embedding on cluster creation

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 3, 2021
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 3, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @JacekDuszenko. 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 the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 3, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@JacekDuszenko
Copy link
Contributor Author

@medyagh could you mark this PR as "ok-to-test" please?

@andriyDev
Copy link
Contributor

/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 Jun 4, 2021
@andriyDev
Copy link
Contributor

/approve

@JacekDuszenko
Copy link
Contributor Author

/assign @tstromberg

Copy link
Contributor

@ilya-zuyev ilya-zuyev left a comment

Choose a reason for hiding this comment

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

When set with minikube config set embed-certs true the cluster config is:

ilyaz@skeletron --- g/minikube ‹fix-embed-certs-from-config* ?› » head  ~/.minikube/profiles/minikube/config.json -n 20
{
        "Name": "minikube",
        "KeepContext": false,
        "embed-certs": true,
        "MinikubeISO": "",
        "KicBaseImage": "gcr.io/k8s-minikube/kicbase-builds:v0.0.22-1620785771-11384@sha256:f5844fe35994179bbad8dda27d4912304a2fedccdf0bf93ce8b2ec2b3b83af1c",
        "Memory": 8000,
        "CPUs": 2,
        "DiskSize": 20000,
        "VMDriver": "",
        "Driver": "docker",
        "HyperkitVpnKitSock": "",
        "HyperkitVSockPorts": [],
        "DockerEnv": null,
        "ContainerVolumeMounts": null,
        "InsecureRegistry": null,
        "RegistryMirror": null,
        "HostOnlyCIDR": "192.168.99.1/24",
        "HypervVirtualSwitch": "",
        "HypervUseExternalSwitch": false,

Using different naming scheme for "embed-certs" is a bit ugly, we should use the same style for all fields. Also, it's probably best to avoid exceptions in serialization of individual fields of ClusterConfig.
Let's fix the config command instead, and use "EmbedCerts" name to store the config value

@JacekDuszenko
Copy link
Contributor Author

JacekDuszenko commented Jun 4, 2021

@ilya-zuyev Sure, I'll submit a PR fix shortly

@JacekDuszenko
Copy link
Contributor Author

/assign @JacekDuszenko

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11576) |
+----------------+----------+---------------------+
| minikube start | 48.2s    | 47.7s               |
| enable ingress | 33.2s    | 34.3s               |
+----------------+----------+---------------------+

Times for minikube start: 48.3s 47.6s 47.4s 50.0s 47.8s
Times for minikube (PR 11576) start: 47.1s 46.7s 50.1s 47.3s 47.2s

Times for minikube ingress: 32.8s 32.7s 33.7s 33.8s 33.2s
Times for minikube (PR 11576) ingress: 33.2s 32.7s 36.3s 34.2s 35.2s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11576) |
+----------------+----------+---------------------+
| minikube start | 22.0s    | 21.6s               |
| enable ingress | 28.3s    | 31.1s               |
+----------------+----------+---------------------+

Times for minikube (PR 11576) start: 21.1s 21.5s 21.8s 21.5s 22.3s
Times for minikube start: 22.1s 21.8s 21.9s 22.0s 21.9s

Times for minikube ingress: 26.5s 29.0s 29.0s 28.5s 28.5s
Times for minikube (PR 11576) ingress: 36.5s 30.0s 31.5s 29.0s 28.5s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11576) |
+----------------+----------+---------------------+
| minikube start | 42.7s    | 46.0s               |
| enable ingress |          |                     |
+----------------+----------+---------------------+

Times for minikube start: 31.6s 43.0s 43.4s 47.3s 48.0s
Times for minikube (PR 11576) start: 46.9s 47.3s 43.6s 48.8s 43.8s

@JacekDuszenko
Copy link
Contributor Author

@ilya-zuyev @medyagh I fixed the PR. Now config is saved as EmbedCerts. The viper key had to stay as embed-certs to preserve backwards compatibility, because the startup flag --embed-certs would be changed if we changed the viper key (because of how the code is structured). I went with the approach of creating EmbedCerts alias to embed-certs viper prop key and it works, allowing us to use EmbedCerts in global config and --embed-certs as a startup flag.

@JacekDuszenko
Copy link
Contributor Author

/assign @ilya-zuyev

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11576) |
+----------------+----------+---------------------+
| minikube start | 48.4s    | 48.5s               |
| enable ingress | 35.9s    | 34.3s               |
+----------------+----------+---------------------+

Times for minikube ingress: 35.2s 37.8s 34.3s 37.7s 34.7s
Times for minikube (PR 11576) ingress: 34.2s 34.3s 35.8s 34.2s 33.2s

Times for minikube start: 49.9s 47.0s 49.4s 49.5s 46.2s
Times for minikube (PR 11576) start: 47.7s 51.0s 49.3s 47.4s 47.3s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11576) |
+----------------+----------+---------------------+
| minikube start | 21.5s    | 21.6s               |
| enable ingress | 33.2s    | 31.0s               |
+----------------+----------+---------------------+

Times for minikube start: 22.3s 21.4s 21.4s 21.6s 20.9s
Times for minikube (PR 11576) start: 20.9s 21.8s 21.4s 21.9s 22.2s

Times for minikube ingress: 37.5s 33.0s 29.0s 36.5s 30.0s
Times for minikube (PR 11576) ingress: 29.0s 29.0s 27.5s 36.5s 33.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11576) |
+----------------+----------+---------------------+
| minikube start | 42.7s    | 45.7s               |
| enable ingress |          |                     |
+----------------+----------+---------------------+

Times for minikube start: 31.5s 47.8s 43.0s 47.5s 43.4s
Times for minikube (PR 11576) start: 43.1s 47.1s 47.6s 43.7s 47.1s

@JacekDuszenko
Copy link
Contributor Author

Hey, @ilya-zuyev, would you mind taking a look at this?

Copy link
Contributor

@ilya-zuyev ilya-zuyev left a comment

Choose a reason for hiding this comment

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

looks good now. Thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andriyDev, ilya-zuyev, JacekDuszenko

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2021
@JacekDuszenko
Copy link
Contributor Author

Great, thank you! Are we able to merge it anytime soon @ilya-zuyev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minikube config set embed-certs true does have no effect
8 participants