minikube windows hyperx填坑记

2021-06-10 08:02

阅读:632

标签:als   pull   boa   一个   注意   xposed   代理   node   kubectl   

minikube windows hyperx填坑记

安装了一天半,还是没行,先放弃

开始

minikube start --vm-driver=hyperv --hyperv-virtual-switch=k8svswitch --cpus=4 --memory=4096
--docker-env HTTP_PROXY=http://192.168.31.77:1080 --docker-env HTTPS_PROXY=http://192.168.31.77:1080 --docker-env NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.1/24 --alsologtostderr

其中需要按SSR翻QIANG代理情况改写内部IP

## 注意!!!!千万不要加这个,国内好多博主加了这条,神坑了半天
 --registry-mirror=https://registry.docker-cn.com 
systemctl enable docker.service
kubeadm config images pull

下载需要的镜像

kubeadm config images list |sed -e 's/^/docker pull /g' -e 's#k8s.gcr.io#docker.io/mirrorgooglecontainers#g' |sh -x

上面下不了的手动

docker pull coredns/coredns:1.3.1 
docker pull mirrorgooglecontainers/kube-addon-manager:v9.0 
docker pull mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 
docker pull hawsers/storage-provisioner:v1.8.1

TAG

重命名镜像

docker images |grep mirrorgooglecontainers |awk '{print "docker tag ",$1":"$2,$1":"$2}' |sed -e 's#mirrorgooglecontainers#k8s.gcr.io#2' |sh -x  

手动

docker tag coredns/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1
docker tag mirrorgooglecontainers/kube-addon-manager:v9.0 k8s.gcr.io/kube-addon-manager:v9.0
docker tag mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1
docker tag hawsers/storage-provisioner:v1.8.1 gcr.io/k8s-minikube/storage-provisioner:v1.8.1

删除

删除mirrorgooglecontainers镜像

docker images |grep mirrorgooglecontainers |awk '{print "docker rmi ", $1":"$2}' |sh -x 

手动

docker rmi coredns/coredns:1.3.1
docker rmi mirrorgooglecontainers/kube-addon-manager:v9.0
docker rmi mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1
docker rmi hawsers/storage-provisioner:v1.8.1 
kubectl get pods
minikube service kube-nginx --url

minikube logs
minikube dashboard

Docker 基本操作

minikube service kube-nginx --url

To delete all containers including its volumes use,

docker rm -vf $(docker ps -a -q)

To delete all the images

docker rmi -f $(docker images -a -q)

Use this to delete everything:

docker system prune -a --volumes

3.3 启动一个服务

创建一个 Nginx Pod 服务

$ kubectl run kube-nginx --image=nginx:latest --port=80 
deployment.apps/kube-nginx created

通过 NodePort 暴露服务

$ kubectl expose deployment kube-nginx --type=NodePort 
service/kube-nginx exposed

检查 Pod 状态

$ kubectl get pods 
NAME                                        READY       STATUS      RESTARTS     AGE 
kube-nginx-6d8f6d45-rwz2g        1/1          Running                 0       1d
docker logs --tail 200 c8b9a4c46345
kubectl get pods --all-namespaces
kubectl get svc

minikube windows hyperx填坑记

标签:als   pull   boa   一个   注意   xposed   代理   node   kubectl   

原文地址:https://www.cnblogs.com/francis67/p/10623560.html


评论


亲,登录后才可以留言!