mirror of
https://github.com/wardviaene/kubernetes-course.git
synced 2026-05-16 04:56:32 +00:00
59 lines
884 B
Markdown
59 lines
884 B
Markdown
# Files
|
|
There is no quickstart-for-gke.sh anymore. This has been replaced by quickstart.sh.
|
|
|
|
# setup storage
|
|
```
|
|
kubectl create -f storage.yml
|
|
```
|
|
|
|
# setup Operator
|
|
```
|
|
./quickstart.sh
|
|
./set-path.sh
|
|
```
|
|
|
|
After these commands you'll need to logout and login again.
|
|
|
|
# port forwarding
|
|
|
|
```
|
|
kubectl get pods -n pgo
|
|
kubectl port-forward -n pgo postgres-operator-xxx-yyy 8443:8443
|
|
```
|
|
|
|
# Test command
|
|
|
|
```
|
|
pgo version
|
|
```
|
|
|
|
# Create cluster
|
|
|
|
```
|
|
pgo create cluster mycluster
|
|
```
|
|
|
|
# show secrets
|
|
```
|
|
pgo show cluster mycluster
|
|
```
|
|
|
|
# connect to psql
|
|
```
|
|
pgo show user mycluster
|
|
kubectl run -it --rm --image=postgres:10.4 psql-client -- psql -h mycluster.pgo -U testuser -W postgres
|
|
```
|
|
|
|
|
|
# Create read replic
|
|
```
|
|
pgo scale mycluster
|
|
```
|
|
|
|
# manually failover
|
|
```
|
|
pgo failover mycluster --query
|
|
pgo failover mycluster --target=mycluster-xxx
|
|
kubectl get pgtasks mycluster-failover -o yaml
|
|
```
|