Kubernetes tips

This commit is contained in:
2025-10-20 12:16:46 +02:00
parent a61c44b085
commit 6ad2e97e2e

View File

@@ -0,0 +1,18 @@
# Kubernetes tricks
A collection of nice to haves while managing applications in kubernetes.
## Kubectl proxy
Running `kubectl proxy` will open a tunnel to the selected cluster. You can then access the webapi on the port that was displayed.
Using that webapi you can browse the resources and even access the application hosted within your cluster.
### Explore a namespace
Enter the following address and replace the namespace name and the resource type (pods|services) to get a list of the available resources.
`http://localhost:8001/api/v1/namespaces/<namespace-name>/<resource-type>`
### Make a request to a service or pod
The url pattern looks like this: `http://localhost:8001/api/v1/namespaces/<namespace-name>/<pods|services>/<protocol>:<name>:<port>/proxy/<url-path>`
Example: `http://localhost:8001/api/v1/namespaces/hangfire-services/services/http:hangfire-services:80/proxy/hangfire` will make a request to my hangfire dashboard.