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

Kubernetes API call equivalent to ‘kubectl apply’

I checked the code in pkg/kubectl/cmd/apply.go and I think the following lines of code shows what’s behind the scene when you run kubectl apply -f: // Compute a three way strategic merge patch to send to server. patch, err := strategicpatch.CreateThreeWayMergePatch(original, modified, current, versionedObject, true) helper := resource.NewHelper(info.Client, info.Mapping) _, err = helper.Patch(info.Namespace, info.Name, api.StrategicMergePatchType, … 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

When exactly do I set an ownerReference’s controller field to true?

ownerReferences has two purposes: Garbage collection: Refer to the answer of ymmt2005. Essentially all owners are considered for GC. Contrary to the accepted answer the controller field has no impact on GC. Adoption: The controller field prevents fighting over resources which are to be adopted. Consider a replica set. Usually, the replica set controller creates … Read more

helm init has been removed in version 3

According to the official documentation, the helm init command has been removed without replacement: The helm init command has been removed. It performed two primary functions. First, it installed Tiller. This is no longer needed. Second, it setup directories and repositories where Helm configuration lived. This is now automated. If the directory is not present … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)