Minikube

Unable to run Kubernetes (kubectl) and Minikube on windows 10. Unable to connect to the server: dial tcp [::1]:8080: connectex:

Deadly 提交于 2019-12-07 05:11:21
Here's the full error Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it. Here's my Kubectl config view apiVersion: v1 clusters: [] contexts: - context: cluster: "" user: "" name: dev current-context: dev kind: Config preferences: {} users: [] I'm running Minikube start . It's stuck on Starting VM... In Hyper-V Manager, I have minikube VM running. Check out " Minikube on Windows 10 with Hyper-V " by Jock Reed The command to run, from a Windows CMD console as Administrator, is: minikube start --vm-driver

Starting an Ingress service on Docker for Mac

五迷三道 提交于 2019-12-07 05:04:16
问题 Update: Using: kubectl expose deployment <Name-Of-Servce> --name=loadbalancer --port=8080 --target-port=8080 --type=LoadBalancer The kubectl get services is showing pending: loadbalancer LoadBalancer <x.x.x.x> <pending> 8080:32670/TCP 2m Before Docker surported Kubernetes, I could use MiniKube and Helm: helm install stable/jenkins kubectl get services // To get the service name minikube service original-llama-jenkins // << The service name Now that we have Docker for Mac(Edge) supporting

Find the available RAM using GO API

时光怂恿深爱的人放手 提交于 2019-12-07 02:42:48
问题 I am using the Minikube environment and I have defined the max memory using $] minikube config set memory 2048 Now I want to get this memory value using the Kubernetes API call in GO. I have tried the following, import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ) availableMem := kubernetes.Interface.StorageV1beta1().RESTClient().Get().Name("config") But the output is not in readable manner. 回答1: This code will fetch the available memory of the first cluster nodeList, err := f

kubectl behind a proxy

混江龙づ霸主 提交于 2019-12-06 19:05: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

Kubenetes:服务

狂风中的少年 提交于 2019-12-06 10:57:25
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)服务发现 通过环境变量发现服务

Kubernetes minikube, cannot expose service on public ip range

烂漫一生 提交于 2019-12-06 07:28:54
So I've been playing around with Minkube. I've managed to deploy a simple python flask container: PS C:\Users\Will> kubectl run test-flask-deploy --image 192.168.1.201:5000/test_flask:1 deployment "test-flask-deploy" created I've also then managed to expose the deployment as a service: PS C:\Users\Will> kubectl expose deployment/test-flask-deploy -- type="NodePort" --port 8080 service "test-flask-deploy" exposed In the dashboard I can see that the service has a Cluster IP: 10.0.0.132. I access the dashboard on a 192.168.xxx.xxx address, so I'm hoping I can expose the service on that external

Relation between preStop hook and terminationGracePeriodSeconds

梦想与她 提交于 2019-12-06 06:29:11
Basically I am trying to do is play around with pod lifecycle and check if we can do some cleanup/backup such as copy logs before the pod terminates. What I need : Copy logs/heapdumps from container to a hostPath/S3 before terminating What I tried: I used a preStop hook with a bash command to echo a message (just to see if it works !!). Used terminationGracePeriodSeconds with a delay to preStop and toggle them to see if the process works. Ex. keep terminationGracePeriodSeconds:30 sec (default) and set preStop command to sleep by 50 sec and the message should not be generated since the

Kubernetes pods not starting, running bind the proxy

孤街醉人 提交于 2019-12-06 04:13:58
I am running kubernetes on minikube, I am behind a proxy, so I had set the env variables(HTTP_PROXY & NO_PROXY) for docker in /etc/systemd/system/docker.service.d/http-proxy.conf. I was able to do docker pull but when I run the below example kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080 kubectl expose deployment hello-minikube --type=NodePort kubectl get pod pod never starts and I get the error desc = unable to pull sandbox image \"gcr.io/google_containers/pause-amd64:3.0\" docker pull gcr.io/google_containers/echoserver:1.4 works fine I was able to fix

Minikube on Windows and HyperV: Stuck on prompt “minikube login”

梦想与她 提交于 2019-12-06 03:34:54
问题 I'm "extremely" new to Kubernetes, and I wanted to try it out on my local machine, which is running Windows 10 along with HyperV. I saw that minikube is used for local development, and I was able to find in on Chocolatey , so I installed it using that: choco install minikube -y (I think this also installs kubectl ) The problem I have is that I'm not able to start it; I'm running the following command: minikube start --vm-driver=hyperv I have an external switch configured in HyperV (I found it

How do I enable an audit log on minikube?

…衆ロ難τιáo~ 提交于 2019-12-06 02:48:42
Is it enabled by default? How could I set up an example audit log? I've tried: minikube start --extra-config=apiserver.Authorization.Mode=RBAC --extra-config=apiserver.Audit.LogOptions.Path=/var/log/apiserver/audit.log --extra-config=apiserver.Audit.LogOptions.MaxAge=30 --extra-config=apiserver.Audit.LogOptions.MaxSize=100 --extra-config=apiserver.Audit.LogOptions.MaxBackups=5 I'm also busy reading through (trying out all the options might take a while as minikube start ... is not a quick process): https://github.com/kubernetes/minikube/issues/1609 As far as I know and as per all available