Minikube

kubectl behind a proxy

我们两清 提交于 2019-12-05 00:27:12
I have installed a local Kubernetes cluster using minikube following the instructions here . I'm under a corporate proxy. Therefore I have set the http_proxy and https_proxy env vars. Once the cluster is started after minikube start command I also added the value of minikube ip to the no_proxy env var. However still kubectl cannot connect to the cluster. ubuntu@ros-2:~$ kubectl -v=7 get pods I0105 10:31:47.773801 17607 loader.go:354] Config loaded from file /home/ubuntu/.kube/config I0105 10:31:47.775151 17607 round_trippers.go:296] GET https://192.168.42.22:8443/api I0105 10:31:47.778533

Kubenetes:服务

让人想犯罪 __ 提交于 2019-12-04 23:47:38
1)创建服务 编辑gwp-svc.yaml apiVersion: v1 kind: Service metadata: name: gwp spec: ports: - port: 80 targetPort: 8080 selector: app: gwp 创建服务 kubectl create -f gwp-svc.yaml 查看服务 kubectl get svc 在运行的容器中远程执行命令,其中两个双斜杠(--)代表着kubectl命令项的结束,之后时pod内部需要执行的命令 kubectl exec gwp-fgjg6 -- curl -s http://10.98.20.174 同一个服务可以暴露多个端口,此时需要指定端口名称 编辑gwp-svc.yaml apiVersion: v1 kind: Service metadata: name: gwp spec: ports: - name: http port: 80 targetPort: 8080 - name: https port: 443 targetPort: 8443 selector: app: gwp 此外,targetPort还可以使用命名端口(就是pod中配置的containerPort对应的名称),最大的好处是即使更换端口号也无须更改服务spec。 2)服务发现 通过环境变量发现服务

containerd 与安全沙箱的 Kubernetes 初体验

随声附和 提交于 2019-12-04 20:03:01
作者 | 易立 阿里云资深技术专家 containerd 是一个开源的行业标准容器运行时,关注于简单、稳定和可移植,同时支持 Linux 和 Windows。 2016 年 12 月 14 日,Docker 公司宣布将 Docker Engine 的核心组件 containerd 捐赠到一个新的开源社区独立发展和运营。阿里云、AWS、 Google、IBM 和 Microsoft 作为初始成员,共同建设 containerd 社区; 2017 年 3 月,Docker 将 containerd 捐献给 CNCF(云原生计算基金会)。containerd 得到了快速的发展和广泛的支持; Docker 引擎已经将 containerd 作为容器生命周期管理的基础,Kubernetes 也在 2018 年 5 月,正式支持 containerd 作为容器运行时管理器; 2019 年 2 月,CNCF 宣布 containerd 毕业,成为生产可用的项目。 containerd 从 1.1 版本开始就已经内置了 Container Runtime Interface (CRI) 支持,进一步简化了对 Kubernetes 的支持。其架构图如下: 在 Kubernetes 场景下,containerd 与完整 Docker Engine 相比,具有更少的资源占用和更快的启动速度。 图片来源:

Connect to local database from inside minikube cluster

末鹿安然 提交于 2019-12-04 07:48:19
I'm trying to access a MySQL database hosted inside a docker container on localhost from inside a minikube pod with little success. I tried the solution described Minikube expose MySQL running on localhost as service but to no effect. I have modelled my solution on the service we use on AWS but it does not appear to work with minikube. My service reads as follows apiVersion: v1 kind: Service metadata: name: mysql-db-svc namespace: external spec: type: ExternalName ExternalName: 172.17.0.2 ...where I try to connect to my database from inside a pod using "mysql-db-svc" on port 3306 but to no

How to switch kubectl clusters between gcloud and minikube

六月ゝ 毕业季﹏ 提交于 2019-12-04 07:28:08
问题 I have Kubernetes working well in two different environments, namely in my local environment (MacBook running minikube) and as well as on Google's Container Engine (GCE, Kubernetes on Google Cloud). I use the MacBook/local environment to develop and test my YAML files and then, upon completion, try them on GCE. Currently I need to work with each environment individually: I need to edit the YAML files in my local environment and, when ready, (git) clone them to a GCE environment and then use

`Error: could not find tiller` when running `helm version`

坚强是说给别人听的谎言 提交于 2019-12-04 06:58:30
问题 I have minikube and kubectl installed: $ minikube version minikube version: v1.4.0 commit: 7969c25a98a018b94ea87d949350f3271e9d64b6 $ kubectl version Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:

External ip for kubernetes shows <nodes> in minikube

安稳与你 提交于 2019-12-04 05:46:21
I am fairly new to Kubernetes and I have recently exposed a service using miniKube using NodePort type. I want to test the running of my application but I dont see any external ip but the port only. Here is the output of my: $kubectl get service NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes 10.0.0.1 <none> 443/TCP 1h kubernetes-bootcamp 10.0.0.253 <nodes> 8080:31180/TCP 20m $kubectl describe services/kubernetes-bootcamp Name: kubernetes-bootcamp Namespace: default Labels: run=kubernetes-bootcamp Annotations: <none> Selector: run=kubernetes-bootcamp Type: NodePort IP: 10.0.0.253 Port:

Dev machine as part of Minikube's network?

不问归期 提交于 2019-12-04 03:56:15
Is it possible to have my development machine to be part of Minikube's network? Ideally, it should work both ways: While developing an application in my IDE, I can access k8s resources inside Minikube using the same addressing that pods would use. Pods running in Minikube can access my application running in the IDE, for example via HTTP requests. This sounds like the first part is feasible on GCE using network routes, so I wonder if it's doable locally using Minikube. There is an issue open upstream ( kubernetes/minikube#38 ) in order to discuss that particular use case. kube-proxy already

Minikube not working in Windows 8

喜欢而已 提交于 2019-12-04 02:49:33
I'm new to Kubernetes. With the help of Kubernetes documentation , I installed minikube (v0.24.1) and kubectl in my Windows machine. VirtualBox(Version 5.1.18) is also installed in my machine. Before starting the minikube , i have executed set HTTP_PROXY=xx.xx.xx:8080 and set NO_PROXY=localhost,127.0.0.0/8,192.0.0.0/8 in Windows command prompt Started minikube by passing Proxy Details : C:\minikube>minikube start --memory 4096 --vm-driver=virtualbox --docker-env http_proxy=xx.xx.xx:8080 --docker-env https_proxy=xx.xx.xx:8080 --docker-env no_proxy=localhost,127.0.0.0/8,192.0.0.0/8 --cache

How to fix VM issue with minikube start ?

て烟熏妆下的殇ゞ 提交于 2019-12-04 01:51:51
I am a beginner to Kubernetes and starting off with this tutorial. I installed VM and expected to be able to start a cluster by using the command: minikube start But I get the error: Starting local Kubernetes v1.10.0 cluster... Starting VM... E0911 13:34:45.394430 41676 start.go:174] Error starting host: Error creating host: Error executing step: Creating VM. : Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to