-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples/operator: Change recommended port-forward shell aliases.
Naming the aliases the same as the underlying command has been tripping up users. Also fix port-forwarding for the possibility of multiple query results, and send vtctl output to the console by default instead of log files. Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
- Loading branch information
Showing
2 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/sh | ||
|
||
kubectl port-forward --address localhost deployment/"$(kubectl get deployment --selector="planetscale.com/component=vtctld" -o=jsonpath="{.items..metadata.name}")" 15000 15999 & | ||
kubectl port-forward --address localhost "$(kubectl get service --selector="planetscale.com/component=vtctld" -o name | head -n1)" 15000 15999 & | ||
process_id1=$! | ||
kubectl port-forward --address localhost deployment/"$(kubectl get deployment --selector="planetscale.com/component=vtgate" -o=jsonpath="{.items..metadata.name}")" 15306:3306 & | ||
kubectl port-forward --address localhost "$(kubectl get service --selector="planetscale.com/component=vtgate,!planetscale.com/cell" -o name | head -n1)" 15306:3306 & | ||
process_id2=$! | ||
sleep 2 | ||
echo "You may point your browser to http://localhost:15000, use the following aliases as shortcuts:" | ||
echo 'alias vtctlclient="vtctlclient -server=localhost:15999"' | ||
echo 'alias mysql="mysql -h 127.0.0.1 -P 15306 -u user"' | ||
echo 'alias kvtctl="vtctlclient -server=localhost:15999 -logtostderr"' | ||
echo 'alias kmysql="mysql -h 127.0.0.1 -P 15306 -u user"' | ||
echo "Hit Ctrl-C to stop the port forwards" | ||
wait $process_id1 | ||
wait $process_id2 |