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

Detect windows container and exit with instructions #7984

Merged
merged 9 commits into from
May 4, 2020

Conversation

medyagh
Copy link
Member

@medyagh medyagh commented May 3, 2020

closes #7352

Before this PR

  • confusing Error "Windows does not support privileged mode"
  • minikube hopelessly retrying to re-create the container and waste user's time and make unpleasant logs.

which the real problem was, the new docker desktop by default has Windows containers option "checked" during installation. so unless you change it, u will have windows conatiners.
Screen Shot 2020-05-02 at 4 19 12 PM

After this PR: main scenario registry detects it

medmac@~/workspace/minikube (detect_windows_container) $ make && ./out/minikube start --driver=docker
make: `out/minikube' is up to date.
😄  minikube v1.10.0-beta.2 on Darwin 10.13.6
✨  Using the docker driver based on user configuration

❗  'docker' driver reported an issue: docker container type is windows
💡  Suggestion: Change container type to "linux" in Docker Desktop settings
📘  Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/#verify-docker-container-type-is-linux

💣  Failed to validate 'docker' driver

After this PR scenario 2: Rare but possible

( it has passed the registry- the container type been switched after minikube registry had evaluated the it as healthy)

(please mind this output was produced on Mac by flipping the If statement to genearte the error)

😄  minikube v1.10.0-beta.2 on Darwin 10.13.6
✨  Using the docker driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=2, Memory=4000MB) ...

💥  Your Docker Desktop container os type is Windows but Linux is required.
❗  Please change Docker settings to use Linux containers instead of Windows containers.
📘  https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers
💡  You can verify your Docker container type by running:
        docker info --format '{{.OSType}}'

@medyagh medyagh requested a review from tstromberg May 3, 2020 01:30
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 3, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh

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

@medyagh medyagh changed the title Detect windows container Detect windows container and exit with Usage error May 3, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 3, 2020
@medyagh medyagh changed the title Detect windows container and exit with Usage error Detect windows container and exit with usage instructions May 3, 2020
@medyagh medyagh changed the title Detect windows container and exit with usage instructions Detect windows container and exit with instructions May 3, 2020
@medyagh
Copy link
Member Author

medyagh commented May 3, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 3, 2020
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [65.134428139 67.44602291299998 64.40280484300001]
Average time for minikube: 65.66108529833333

Times for Minikube (PR 7984): [63.552057194999996 65.277374916 66.77798079700001]
Average time for Minikube (PR 7984): 65.20247096933333

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7984) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on   |  0.063380 |           0.063778 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.020390 |           0.022029 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003599 |           0.003276 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 40.633892 |          40.069716 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.1 | 22.565194 |          22.663246 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.404313 |           1.507256 |
| components...                  |           |                    |
| * Enabled addons:              |  0.885556 |           0.784839 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.081543 |           0.081922 |
| configured to use "minikube"   |           |                    |
|                                |  0.003219 |           0.006409 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [28.484185877 25.405832503 28.004849929000002]
Average time for minikube: 27.298289436333334

Times for Minikube (PR 7984): [28.253897865999992 27.808190374 28.95541597]
Average time for Minikube (PR 7984): 28.33916807

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7984) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on           |  0.079916 |           0.081226 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002802 |           0.002655 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.061815 |           0.060921 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  8.053190 |           7.794060 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.1         |  0.125263 |           0.125845 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.084979 |          18.580322 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  0.817156 |           1.535312 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.003000 |           0.083163 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.064159 |           0.070597 |
| configured to use "minikube"           |           |                    |
|                                        |  0.006010 |           0.005068 |
+----------------------------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [64.688351239 66.19071497299998 66.65827848100001]
Average time for minikube: 65.84578156433334

Times for Minikube (PR 7984): [64.659989809 65.38544859199999 66.132769945]
Average time for Minikube (PR 7984): 65.39273611533334

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7984) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on   |  0.061066 |           0.061424 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.023083 |           0.022469 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003276 |           0.003316 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 40.566879 |          40.539626 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.1 | 22.779877 |          22.570960 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.476970 |           1.468712 |
| components...                  |           |                    |
| * Enabled addons:              |  0.839789 |           0.641156 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.091127 |           0.077382 |
| configured to use "minikube"   |           |                    |
|                                |  0.003714 |           0.007691 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [28.880632503 26.985431052 27.967611548]
Average time for minikube: 27.944558367666662

Times for Minikube (PR 7984): [27.880240106999995 28.080424021999992 28.038809752]
Average time for Minikube (PR 7984): 27.999824627

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7984) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on           |  0.076050 |           0.080082 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002684 |           0.003252 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.061688 |           0.060579 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  7.937449 |           7.805493 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.1         |  0.124678 |           0.126194 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.413237 |          18.341492 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.183999 |           1.511309 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.073159 |           0.002839 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.068064 |           0.063835 |
| configured to use "minikube"           |           |                    |
|                                        |  0.003551 |           0.004750 |
+----------------------------------------+-----------+--------------------+

@codecov-io
Copy link

codecov-io commented May 3, 2020

Codecov Report

Merging #7984 into master will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7984      +/-   ##
==========================================
- Coverage   36.04%   36.01%   -0.04%     
==========================================
  Files         144      144              
  Lines        9196     9204       +8     
==========================================
  Hits         3315     3315              
- Misses       5480     5488       +8     
  Partials      401      401              
Impacted Files Coverage Δ
cmd/minikube/cmd/start.go 15.39% <0.00%> (-0.23%) ⬇️

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [66.245175503 65.74485048399998 64.981477736]
Average time for minikube: 65.65716790766668

Times for Minikube (PR 7984): [65.995554508 65.227560903 65.857167564]
Average time for Minikube (PR 7984): 65.69342765833333

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7984) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on   |  0.064460 |           0.062220 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.022312 |           0.020847 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.008086 |           0.003733 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 40.955306 |          40.098866 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.1 | 22.416612 |          23.634260 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.421630 |           1.416662 |
| components...                  |           |                    |
| * Enabled addons:              |  0.689017 |           0.372778 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.076378 |           0.077122 |
| configured to use "minikube"   |           |                    |
|                                |  0.003366 |           0.006941 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [26.858358654999996 27.373400071 29.012608883]
Average time for minikube: 27.74812253633333

Times for Minikube (PR 7984): [28.139059638 27.815587726000004 28.063274393999997]
Average time for Minikube (PR 7984): 28.005973919333332

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7984) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on           |  0.081847 |           0.078215 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.003323 |           0.002793 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.063600 |           0.061848 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  7.938760 |           7.977845 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.1         |  0.126972 |           0.139245 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.210177 |          18.788436 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.216653 |           0.805038 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.032384 |           0.077860 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.069121 |           0.069982 |
| configured to use "minikube"           |           |                    |
|                                        |  0.005285 |           0.004711 |
+----------------------------------------+-----------+--------------------+

@@ -30,11 +30,20 @@ The Docker driver allows you to install Kubernetes into an existing Docker insta

## Troubleshooting

- On macOS or Windows, you may need to restart Docker for Desktop if a command gets hung
Copy link
Member Author

Choose a reason for hiding this comment

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

note that this advice was already stated above and not needed to repeat.

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [64.695650663 65.79432075 64.349941532]
Average time for minikube: 64.94663764833334

Times for Minikube (PR 7984): [64.543399298 66.633368553 65.763454899]
Average time for Minikube (PR 7984): 65.64674091666667

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7984) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on   |  0.062019 |           0.065971 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.021641 |           0.022517 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.005081 |           0.003480 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 40.040654 |          40.853150 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.1 | 22.327952 |          22.498376 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.677627 |           1.451658 |
| components...                  |           |                    |
| * Enabled addons:              |  0.733897 |           0.663387 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.073976 |           0.082569 |
| configured to use "minikube"   |           |                    |
|                                |  0.003791 |           0.005632 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [27.800531580999998 26.834476124 29.934571555]
Average time for minikube: 28.189859753333337

Times for Minikube (PR 7984): [27.811253516 27.365570623999997 28.433022647999998]
Average time for Minikube (PR 7984): 27.869948929333333

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7984) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on           |  0.082102 |           0.083335 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002952 |           0.002686 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.064420 |           0.060948 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  8.345569 |           7.710812 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.1         |  0.125143 |           0.153368 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.479751 |          18.348752 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  0.935433 |           1.436910 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.084589 |           0.002648 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.063987 |           0.065081 |
| configured to use "minikube"           |           |                    |
|                                        |  0.005914 |           0.005409 |
+----------------------------------------+-----------+--------------------+

@medyagh medyagh merged commit e0685c8 into kubernetes:master May 4, 2020
@medyagh medyagh deleted the detect_windows_container branch March 2, 2021 21:30
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create kic node: create container: Windows does not support privileged mode.
5 participants