no endpoints available for service \”kubernetes-dashboard\”

It would appear that you are attempting to deploy Kubernetes leveraging kubeadm but have skipped the step of Installing a pod network add-on (CNI). Notice the warning: The network must be deployed before any applications. Also, CoreDNS will not start up before a network is installed. kubeadm only supports Container Network Interface (CNI) based networks … Read more

Can you pass an environment variables into kubectl exec without bash -c?

/usr/bin/env exports values passed in key=value pairs into the environment of any program it’s used to invoke. kubectl -n nmspc exec “$POD” — env curIP=123 script01 Note that you should never use $runScript or any other unquoted expansion to invoke a shell command. See BashFAQ #50 — I’m trying to put a command in a … Read more

How to use “kubectl” command instead of “sudo kubectl”

Fix file permissions Most likely your kubectl files are not owned by your user. You can set these permissions using below command. sudo chown -R $USER $HOME/.kube Run kubectl with sudo Alternatively you can run kubectl as sudo user using a persistent sudo shell. sudo -s then run your kubectl commands kubectl get pods kubectl … Read more

Get the image and SHA image ID of images in pod on Kubernetes deployment

Something like this will do the trick (you must have jq installed): $ kubectl get pod –namespace=xx yyyy -o json | jq ‘.status.containerStatuses[] | { “image”: .image, “imageID”: .imageID }’ { “image”: “nginx:latest”, “imageID”: “docker://sha256:b8efb18f159bd948486f18bd8940b56fd2298b438229f5bd2bcf4cedcf037448” } { “image”: “eu.gcr.io/zzzzzzz/php-fpm-5:latest”, “imageID”: “docker://sha256:6ba3fe274b6110d7310f164eaaaaaaaaaa707a69df7324a1a0817fe3b475566a” }

How to stop kubectl proxy

I believe the “kubectl way” is to not background the proxy at all as it is intended to be a short running process to access the API on your local machine without further authentication. There is no way to stop it other than kill or ^C (if not in background). You can use standard shell … Read more

How can I determine the current ephemeral-storage usage of a running Kubernetes pod?

You can do this through the raw command. kubectl get –raw “/api/v1/nodes/(your-node-name)/proxy/stats/summary” There is also this kubectl get –raw “/api/v1/nodes/(your-node-name)/proxy/metrics/cadvisor”” EDIT: I’ve created a Prometheus exporter for this now. https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics

tech