Application to search pods with given label(s) and return resources information for each container in all pods.
The project uses goreleaser to build the binary for the application as well as docker image
To build the binary (output in /dist
):
goreleaser build --snapshot
To build the docker image:
goreleaser release --snapshot
Note: Docker image built and uploaded to dockerhub under umarhussain/container-info
The application will only run inside the kubernetes cluster since it will use serviceaccount
token
added to the pod by the cluster, otherwise it will exit with error.
Helm chart is provided to install the application inside the cluster. The chart
also creates the ServiceAccount
for the application and a ClusterRoleBinding
for this
service account to give view permissions in RBAC.
Install the application with helm chart:
helm install container-info build/helm/container-info/
The REST server api of the application is documented with OpenApi (under api/
).
For giving label selector to the request the format of the value is similar to kubectl
.
Example of values for the query:
app.kubernetes.io/instance in (app1,app2)
key=value
key!=value
key1 in (app1,app2),key2=work,key3!=dev
To run the unit tests of the application run the following command:
go test -v -cover ./...