Kubernetes

Cannot connect to kubernetes pod from master: i/o timeout

好久不见. 提交于 2021-02-19 03:35:08
问题 I configured kubernetes cluster with one master and one node, the machines that run master and node aren't in the same network. For networking I installed calico and all the pods are running. For testing the cluster I used get shell example and when I run the following command from master machine: kubectl exec -it shell-demo -- /bin/bash I received the error: Error from server: error dialing backend: dial tcp 10.138.0.2:10250: i/o timeout The ip 10.138.0.2 is on eth0 interface on the node

What is the default memory allocated for a pod

旧巷老猫 提交于 2021-02-19 03:23:32
问题 I am setting up a pod say test-pod on my google kubernetes engine. When I deploy the pod and see in workloads using google console, I am able to see 100m CPU getting allocated to my pod by default, but I am not able to see how much memory my pod has consumed. The memory requested section always shows 0 there. I know we can restrict memory limits and initial allocation in the deployment YAML. But I want to know how much default memory a pod gets allocated when no values are specified through

Permissions error when attaching Azure Disk to AKS pod

烂漫一生 提交于 2021-02-19 02:56:09
问题 I've been battling this error for a few hours now. Found several articles but nothing that has helped so far. My work has been based on the "How-to guide > Configure data volumes > Azure Disk - Static" from https://docs.microsoft.com/en-us/azure/aks/azure-disk-volume. As far as I can tell, I've not missed any steps. I have defined by config in a YAML file as so: kind: Deployment metadata: name: phio-dep-db namespace: production spec: selector: matchLabels: app: phio replicas: 1 strategy: type

Kubernetes client go couldn't find module

时间秒杀一切 提交于 2021-02-19 02:38:06
问题 I'm trying to connect to my local Kubernetes cluster hosted on minikube , here's the code for the same, now when I do go run minikube.go , it gives me an error saying: ../../../pkg/mod/k8s.io/client-go@v11.0.0+incompatible/kubernetes/scheme/register.go:26:2: module k8s.io/api@latest found (v0.19.0), but does not contain package k8s.io/api/auditregistration/v1alpha1`. Now, I tried to manually install the package using go get then I found out that this package does not exist. How can I make it

How to supply external metrics into HPA?

倾然丶 夕夏残阳落幕 提交于 2021-02-19 02:28:06
问题 Problem setting. Suppose I have 2 pods, A and B. I want to be able to dynamically scale pod A based on some arbitrary number from some arbitrary source. Suppose that pod B is such a source: for example, it can have an HTTP server with an endpoint which responds with the number of desired replicas of pod A at the moment of request. Or maybe it is an ES server or a SQL DB (does not matter). Question. What kubernetes objects do I need to define to achieve this (apart from HPA)? What

Why tiller connect to localhost 8080 for kubernetes api?

我只是一个虾纸丫 提交于 2021-02-19 01:20:11
问题 When use helm for kubernetes package management, after installed the helm client, after helm init I can see tiller pods are running on kubernetes cluster, and then when I run helm ls , it gives an error: Error: Get http://localhost:8080/api/v1/namespaces/kube-system/configmaps?labe lSelector=OWNER%3DTILLER: dial tcp 127.0.0.1:8080: getsockopt: connection refused and use kubectl logs I can see similar message like: [storage/driver] 2017/08/28 08:08:48 list: failed to list: Get http://localhost

Kubernetes: Display Pods by age in ascending order

空扰寡人 提交于 2021-02-18 20:58:41
问题 I use below command to sort the pods by age kubectl get pods --sort-by={metadata.creationTimestamp} It shows up pods in descending order. How can we select sorting order like ascending? 回答1: Sorted kubectl output and awk provide the table view with a header. Installation of extra tools is not needed. # kubectl get pods --sort-by=.status.startTime | awk 'NR == 1; NR > 1 {print $0 | "tac"}' An approach with JSON processor offered by paulogrell works also but could require more effort: for some

Kubernetes: Display Pods by age in ascending order

夙愿已清 提交于 2021-02-18 20:58:38
问题 I use below command to sort the pods by age kubectl get pods --sort-by={metadata.creationTimestamp} It shows up pods in descending order. How can we select sorting order like ascending? 回答1: Sorted kubectl output and awk provide the table view with a header. Installation of extra tools is not needed. # kubectl get pods --sort-by=.status.startTime | awk 'NR == 1; NR > 1 {print $0 | "tac"}' An approach with JSON processor offered by paulogrell works also but could require more effort: for some

how to get logs of deployment from kubernetes

社会主义新天地 提交于 2021-02-18 20:53:26
问题 I am create a influxdb deployment in kubernetes cluster(v1.15.2),this is my yaml file: apiVersion: extensions/v1beta1 kind: Deployment metadata: name: monitoring-influxdb namespace: kube-system spec: replicas: 1 template: metadata: labels: task: monitoring k8s-app: influxdb spec: containers: - name: influxdb image: registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-influxdb-amd64:v1.5.2 volumeMounts: - mountPath: /data name: influxdb-storage volumes: - name: influxdb-storage

Prometheus alert manager doesnt send alert k8s

末鹿安然 提交于 2021-02-18 19:13:33
问题 Im using prometheus operator 0.3.4 and alert manager 0.20 and it doesnt work, i.e. I see that the alert is fired (on prometheus UI on the alerts tab) but I didnt get any alert to the email. by looking at the logs I see the following , any idea ? please see the warn in bold maybe this is the reason but not sure how to fix it... This is the helm of prometheus operator which I use: https://github.com/helm/charts/tree/master/stable/prometheus-operator level=info ts=2019-12-23T15:42:28.039Z caller