如何在Windows上摆脱Minikube?

时间:2019-04-22 19:29:59

标签: windows docker docker-compose minikube

前一段时间,我安装了minikube with chocolatey,一切正常。

现在,我想将其卸载,看起来似乎要困难得多。

实际上通过Chocolatey卸载并没有阻止容器在后台运行:

eperret@VP0003748 ~
λ docker ps --all
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS               NAMES
03b28d946338        e73645df5dc6           "/api-server --kubec…"   20 seconds ago      Up 19 seconds                           k8s_compose_compose-api-579965d67f-f76f8_docker_63d559c7-62a7-11e9-bcdb-00155d011d03_11
c6410cc784af        f59dcacceff4           "/coredns -conf /etc…"   4 minutes ago       Up 4 minutes                            k8s_coredns_coredns-86c58d9df4-9gcj6_kube-system_4288713f-62a7-11e9-bcdb-00155d011d03_12
5abc29068cfa        3cab8e1b9802           "etcd --advertise-cl…"   5 minutes ago       Up 4 minutes                            k8s_etcd_etcd-docker-desktop_kube-system_d6badd02871341a479a3b7984c2518f4_12
ff59f7145e5c        f59dcacceff4           "/coredns -conf /etc…"   5 minutes ago       Up 4 minutes                            k8s_coredns_coredns-86c58d9df4-gshrp_kube-system_4285e95c-62a7-11e9-bcdb-00155d011d03_12
5245cf66c214        f1ff9b7e3d6e           "kube-apiserver --au…"   5 minutes ago       Up 5 minutes                            k8s_kube-apiserver_kube-apiserver-docker-desktop_kube-system_72f40c465ad43697f0e3a1e8e5b60b38_12
5dd3c33e3201        8fa56d18961f           "/usr/local/bin/kube…"   7 minutes ago       Up 7 minutes                            k8s_kube-proxy_kube-proxy-pgx6c_kube-system_42762e27-62a7-11e9-bcdb-00155d011d03_11
5a96be6090e6        d82530ead066           "kube-controller-man…"   7 minutes ago       Up 7 minutes                            k8s_kube-controller-manager_kube-controller-manager-docker-desktop_kube-system_af678dcf2c5b984f0475a42dbe835297_11
c5ec91d2d718        9508b7d8008d           "kube-scheduler --ad…"   7 minutes ago       Up 7 minutes                            k8s_kube-scheduler_kube-scheduler-docker-desktop_kube-system_69aa2b9af9c518ac6265f1e8dce289a0_11
380a386538bf        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_compose-7cf768cb84-6rq56_docker_63dcae76-62a7-11e9-bcdb-00155d011d03_27
bdfe556e0de3        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_coredns-86c58d9df4-gshrp_kube-system_4285e95c-62a7-11e9-bcdb-00155d011d03_27
df0de842a79b        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_coredns-86c58d9df4-9gcj6_kube-system_4288713f-62a7-11e9-bcdb-00155d011d03_30
f93f833e846c        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_compose-api-579965d67f-f76f8_docker_63d559c7-62a7-11e9-bcdb-00155d011d03_25
8096a8444cee        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_kube-controller-manager-docker-desktop_kube-system_af678dcf2c5b984f0475a42dbe835297_26
1dd54b9cbd83        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_etcd-docker-desktop_kube-system_d6badd02871341a479a3b7984c2518f4_27
5b9c2f55c8b8        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_kube-proxy-pgx6c_kube-system_42762e27-62a7-11e9-bcdb-00155d011d03_27
61a5ca14c6fd        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_kube-scheduler-docker-desktop_kube-system_69aa2b9af9c518ac6265f1e8dce289a0_27
87debb94041b        k8s.gcr.io/pause:3.1   "/pause"                 7 minutes ago       Up 7 minutes                            k8s_POD_kube-apiserver-docker-desktop_kube-system_72f40c465ad43697f0e3a1e8e5b60b38_27

似乎容器的重启策略设置为始终,所以我显然试图更改它:

perret@VP0003748 ~
λ docker update --restart=no $(docker ps -a -q)
b61a93095023
df8fc031980d
e242cb5223e4
ebd562b5ef7f
744b4e249017
e05ee5a07cbe
3fd07127d69b
1d72f9961dac
41b29ca2146b
362164e9862b
ebe192c20f8c
1b6c402ae001

看起来不错,但是停止并尝试删除容器证明了我错了:

eperret@VP0003748 ~
λ docker stop $(docker ps -a -q)
52beaad69402
7cfd36f0b4eb
2fc0c54ca5b9
ad28a4701fe1
b970c5ebaed8
4ef9f46c69ad
8f35f43af4b5
e3fb8d6fc4f1
4fd9ba66ec73
a73d21a2d906
8dce6e2a9fdd
e15b8357dc51

eperret@VP0003748 ~
λ docker rm $(docker ps -a -q)
Error response from daemon: You cannot remove a running container a7ae9a59527092e922662cb17b0730e1000ad7fa883a15f803ad9f1718038da2. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container 94435beb43b151df928f3c89e15c6bc923e36012da5b56ab88345cdf330e78d3. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container 6d7a2abac01ab385c95e0ed648a2ce1cd87865470fd530866b7d66b0a12ee892. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container 7da9c6c12a52e5d98ed174d24972ae8b62184e64e084fff989aa78d9ff5fe7ba. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container ec915af7b386d4bb11d9e88e34e8c33f7319bbc1d53260852cc676f604b3d414. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container 6f24f02e21ce79c518d04c0f3b7d9f591abb85d0987590bd1f2dd545606ec787. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container 5b374ec0b2f18e5ccee092d3c75f15aff3d966249a6dfa9d7260c53aa25fe16b. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container 5cf6999d36af733a5c340df34c73d082652585b624b8a9d8265ce4c3fed04935. Stop the container before attempting removal or force remove
Error response from daemon: You cannot remove a running container 7b6e27d5175943d39098fa2aeaa9d4cad6d0b2e2158be245e0c82f2d49f3fd49. Stop the container before attempting removal or force remove

不确定为什么要让它们弹出。

有什么主意吗?

[编辑]

minikube delete minikube stop在我用Chocolatey卸载minikube之后不再可用,所以我重新安装了它:

eperret@VP0003748 ~
λ choco install minikube -y
Chocolatey v0.10.13
Installing the following packages:
minikube
By installing you accept licenses for the packages.
Progress: Downloading Minikube 1.0.0... 100%

Minikube v1.0.0 [Approved]
minikube package files install completed. Performing other installation steps.
 ShimGen has successfully created a shim for minikube.exe
 The install of minikube was successful.
  Software install location not explicitly set, could be in package or
  default install location if installer.

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
eperret@VP0003748 ~
λ minikube delete
x   Deleting "minikube" from hyperv ...

!   Failed to delete cluster: exit status 1

*   Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
-   https://github.com/kubernetes/minikube/issues/new

但是HyperV中什么都没有:

enter image description here

[编辑2]

第二次通过Chocolatey卸载后,这次似乎一切都消失了。

eperret@VP0003748 ~
λ docker container list --all
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
eperret@VP0003748 ~
λ docker image list --all
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

0 个答案:

没有答案