Skip to content

Instantly share code, notes, and snippets.

@mvillarrealb
Created April 7, 2019 02:52
Show Gist options
  • Save mvillarrealb/97f03a2ed0ff79388dc9da2054c7622c to your computer and use it in GitHub Desktop.
Save mvillarrealb/97f03a2ed0ff79388dc9da2054c7622c to your computer and use it in GitHub Desktop.
SImple port forward demo
#create a port forward wich exposes your mysql service to the local machine
kubectl port-forward svc/local-database-mysql 3306 -n test
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=FUnIsntSOmethingOneConsiderWhenBalancingTheUniverse
#Use mysql-client to connect to the host
mysql -h $MYSQL_HOST -P$MYSQL_PORT -u root -p$MYSQL_ROOT_PASSWORD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment