{"id":24629511,"url":"https://github.com/framsouza/list-pods-hostpath","last_synced_at":"2026-05-19T11:03:33.449Z","repository":{"id":168612668,"uuid":"523683908","full_name":"framsouza/list-pods-hostpath","owner":"framsouza","description":"List of pods that contains hostPath volume mounted","archived":false,"fork":false,"pushed_at":"2022-08-17T11:07:13.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T06:13:07.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/framsouza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-11T10:42:54.000Z","updated_at":"2022-08-12T21:34:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d1d74c6-6c48-42f2-92e5-dc0d03098dcf","html_url":"https://github.com/framsouza/list-pods-hostpath","commit_stats":null,"previous_names":["framsouza/list-pods-hostpath"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framsouza%2Flist-pods-hostpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framsouza%2Flist-pods-hostpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framsouza%2Flist-pods-hostpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framsouza%2Flist-pods-hostpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/framsouza","download_url":"https://codeload.github.com/framsouza/list-pods-hostpath/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554042,"owners_count":20471172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-25T06:13:10.167Z","updated_at":"2026-05-19T11:03:28.392Z","avatar_url":"https://github.com/framsouza.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# List pods that mounts hostPath\n\nThis code will connect to every GKE cluster and list all the pods that is mount volume as `HostPath`, for more information about `hostPath` see, [Kubernetes HostPath](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath)\n\n## Usage\n\nFirst, make sure you have the `GOOGLE_APPLICATION_CREDENTIALS` environment variable set as per the [google docs](https://cloud.google.com/docs/authentication/production).\n\nIt will require one argument which is `project`, to connect to the specify GKE project to list the pods. By default the zone is set to `-` which means all GKE zones.\n\nYou can choose to build the binary by running\n```\ngo build -o list-pods\n```\n\nand run it as\n```\n./list-pods -project=\u003cPROJECTNAME\u003e\n```\n\nor without building the binary\n```\ngo run main.go -project=\u003cPROJECTNAME\u003e\n```\n\n## Output expected\nYou will have an output like the following:\n\n```\nCLUSTER NAME           POD NAME                                                         NAMESPACE            VOLUME TYPE                VOLUMES PATH\nmaritests-gke          test-76665f4d68-f4gcz                                            default              Directory                  /                                                        \nmaritests-gke          event-exporter-gke-5479fd58c8-p84kc                              kube-system                                     /etc/ssl/certs                                           \nmaritests-gke          fluentbit-gke-4pcm8                                              kube-system                                     /var/run/google-fluentbit/pos-files                      \nmaritests-gke          fluentbit-gke-4pcm8                                              kube-system                                     /var/log                                                 \nmaritests-gke          fluentbit-gke-4pcm8                                              kube-system                                     /var/lib/kubelet/pods                                    \nmaritests-gke          fluentbit-gke-4pcm8                                              kube-system                                     /var/lib/docker/containers                               \nmaritests-gke          fluentbit-gke-szwzv                                              kube-system                                     /var/run/google-fluentbit/pos-files                      \nmaritests-gke          fluentbit-gke-szwzv                                              kube-system                                     /var/log                                                 \nmaritests-gke          fluentbit-gke-szwzv                                              kube-system                                     /var/lib/kubelet/pods                                    \nmaritests-gke          fluentbit-gke-szwzv                                              kube-system                                     /var/lib/docker/containers                               \nmaritests-gke          fluentbit-gke-tr879                                              kube-system                                     /var/run/google-fluentbit/pos-files                      \nmaritests-gke          fluentbit-gke-tr879                                              kube-system                                     /var/log                                                 \nmaritests-gke          fluentbit-gke-tr879                                              kube-system                                     /var/lib/kubelet/pods                                    \nmaritests-gke          fluentbit-gke-tr879                                              kube-system                                     /var/lib/docker/containers                               \nmaritests-gke          gke-metrics-agent-94mhr                                          kube-system          Directory                  /etc/ssl/certs                                           \nmaritests-gke          gke-metrics-agent-sgg9w                                          kube-system          Directory                  /etc/ssl/certs                                           \nmaritests-gke          gke-metrics-agent-zpmwm                                          kube-system          Directory                  /etc/ssl/certs                                           \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-8608c62b-xfzh          kube-system                                     /usr/share/ca-certificates                               \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-8608c62b-xfzh          kube-system                                     /etc/ssl/certs                                           \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-8608c62b-xfzh          kube-system          FileOrCreate               /var/lib/kube-proxy/kubeconfig                           \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-8608c62b-xfzh          kube-system                                     /var/log                                                 \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-8608c62b-xfzh          kube-system          FileOrCreate               /run/xtables.lock                                        \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-8608c62b-xfzh          kube-system                                     /lib/modules                                             \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-af2b35ac-wr63          kube-system                                     /usr/share/ca-certificates                               \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-af2b35ac-wr63          kube-system                                     /etc/ssl/certs                                           \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-af2b35ac-wr63          kube-system          FileOrCreate               /var/lib/kube-proxy/kubeconfig                           \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-af2b35ac-wr63          kube-system                                     /var/log                                                 \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-af2b35ac-wr63          kube-system          FileOrCreate               /run/xtables.lock                                        \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-af2b35ac-wr63          kube-system                                     /lib/modules                                             \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-cebcda79-lpz3          kube-system                                     /usr/share/ca-certificates                               \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-cebcda79-lpz3          kube-system                                     /etc/ssl/certs                                           \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-cebcda79-lpz3          kube-system          FileOrCreate               /var/lib/kube-proxy/kubeconfig                           \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-cebcda79-lpz3          kube-system                                     /var/log                                                 \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-cebcda79-lpz3          kube-system          FileOrCreate               /run/xtables.lock                                        \nmaritests-gke          kube-proxy-gke-maritests-gke-default-pool-cebcda79-lpz3          kube-system                                     /lib/modules                                             \nmaritests-gke          metricbeat-bw7gl                                                 kube-system                                     /proc                                                    \nmaritests-gke          metricbeat-bw7gl                                                 kube-system                                     /sys/fs/cgroup                                           \nmaritests-gke          metricbeat-bw7gl                                                 kube-system          DirectoryOrCreate          /var/lib/metricbeat-data                                 \nmaritests-gke          metricbeat-mjr9c                                                 kube-system                                     /proc                                                    \nmaritests-gke          metricbeat-mjr9c                                                 kube-system                                     /sys/fs/cgroup                                           \nmaritests-gke          metricbeat-mjr9c                                                 kube-system          DirectoryOrCreate          /var/lib/metricbeat-data                                 \nmaritests-gke          metricbeat-tlz88                                                 kube-system                                     /proc                                                    \nmaritests-gke          metricbeat-tlz88                                                 kube-system                                     /sys/fs/cgroup                                           \nmaritests-gke          metricbeat-tlz88                                                 kube-system          DirectoryOrCreate          /var/lib/metricbeat-data                                 \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          Directory                  /var/lib/kubelet/plugins_registry/                       \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          Directory                  /var/lib/kubelet                                         \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          DirectoryOrCreate          /var/lib/kubelet/plugins/pd.csi.storage.gke.io/          \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          Directory                  /dev                                                     \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          Directory                  /etc/udev                                                \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          Directory                  /lib/udev                                                \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          Directory                  /run/udev                                                \nmaritests-gke          pdcsi-node-bpjhj                                                 kube-system          Directory                  /sys                                                     \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          Directory                  /var/lib/kubelet/plugins_registry/                       \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          Directory                  /var/lib/kubelet                                         \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          DirectoryOrCreate          /var/lib/kubelet/plugins/pd.csi.storage.gke.io/          \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          Directory                  /dev                                                     \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          Directory                  /etc/udev                                                \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          Directory                  /lib/udev                                                \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          Directory                  /run/udev                                                \nmaritests-gke          pdcsi-node-c4qkw                                                 kube-system          Directory                  /sys                                                     \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          Directory                  /var/lib/kubelet/plugins_registry/                       \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          Directory                  /var/lib/kubelet                                         \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          DirectoryOrCreate          /var/lib/kubelet/plugins/pd.csi.storage.gke.io/          \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          Directory                  /dev                                                     \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          Directory                  /etc/udev                                                \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          Directory                  /lib/udev                                                \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          Directory                  /run/udev                                                \nmaritests-gke          pdcsi-node-qcmz4                                                 kube-system          Directory                  /sys                                           \n```\n\nIf the `VOLUME TYPE` column is empty, it means the manifest contains an empty `type`. The `VOLUME PATH` represents the host path that has being mounted inside the pod. The pods that are **NOT** using `hostPath` won't be in the list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframsouza%2Flist-pods-hostpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fframsouza%2Flist-pods-hostpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframsouza%2Flist-pods-hostpath/lists"}