《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.1.Elastic Stack 安装部署——3.4.1.6.配置多节点集群(2) https://developer.aliyun.com/article/1231327
对于中国的开发者来说,由于网路的限制,那么在使用上面的命令时,可能会出现k8s.gcr.io网址不能被访问的情况。那么我们怎么解决这个问题呢?答案是我们可以使用阿里云服务器。我们可以尝试使用如下的命令:
$ minikube start --help |grep repo$ minikube start --help |grep repo --image-repository='': Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers --image-repository='': Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers
根据上面的提示,我们可以修改我们上面的命令为:
$ minikube start --driver=virtualbox --cpus 4 --memory 10240 --kubernetes-version 1.16.0 --image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers'
那么根据上面的命令运行后的结果为:
一旦minikube被成功启动起来,我们可以使用如下的命令:
minikube dashboard
当上面的命令执行后,它就会启动一个web的接口让我们来对kubernetes监控和管理:
等我们上面的Minikube已经被启动后,我们使用如下的命令:
helm repo add elastic https://helm.elastic.co
上面的命令返回:
$ helm repo add elastic https://helm.elastic.co "elastic" has been added to your repositories
接着我们使用如下的命令:
curl -O https://raw.githubusercontent.com/elastic/helm-charts/master/elasticsearch/examples/minikube/values.yaml $ curl -O https://raw.githubusercontent.com/elastic/helm-charts/master/elasticsearch/examples/minikube/values.yaml % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 478 100 478 0 0 810 0 --:--:-- --:--:-- --:--:-- 808
上面的values.yaml的内容如下:
--- # Permit co-located instances for solitary minikube virtual machines. antiAffinity: "soft" # Shrink default JVM heap. esJavaOpts: "-Xmx128m -Xms128m" # Allocate smaller chunks of memory per pod. resources: requests: cpu: "100m" memory: "512M" limits: cpu: "1000m" memory: "512M" # Request smaller persistent volumes. volumeClaimTemplate: accessModes: [ "ReadWriteOnce" ] storageClassName: "standard" resources: requests: storage: 100M
《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.1.Elastic Stack 安装部署——3.4.1.6.配置多节点集群(4) https://developer.aliyun.com/article/1231325