Skip to content

Instantly share code, notes, and snippets.

@darrensapalo
Last active June 10, 2021 16:02
Show Gist options
  • Save darrensapalo/85f57de329361be038ce79512173a0dd to your computer and use it in GitHub Desktop.
Save darrensapalo/85f57de329361be038ce79512173a0dd to your computer and use it in GitHub Desktop.
Automatically connects to the utils namespace, and then finds the pod with pgadmin, and portforwards it to 4000.
#! /usr/local/bin/fish
# This fish scripts allows one to automatically:
# 2. connect to the utils kubens
# 3. port-forward the pgadmin service
kubens utils
set HANDLER_POD_NAME (kubectl get pods -o jsonpath="{.items[*].metadata.name}" | tr -s '[[:space:]]' '\n' | grep pgadmin)
kubectl port-forward $HANDLER_POD_NAME 4000:80
# Visit your local browser at http://localhost:4000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment