text stringlengths 0 59.1k |
|---|
[backups](http://vitess.io/user-guide/backup-and-restore.html) in |
[Google Cloud Storage](https://cloud.google.com/storage/). |
If you're using GCS, fill in the fields requested by the configure script. |
Note that your Kubernetes cluster must be running on instances with the |
`storage-rw` scope for this to work. With Container Engine, you can do this by |
passing `--scopes storage-rw` to the `glcoud container clusters create` command. |
For other platforms, you'll need to choose the `file` backup storage plugin, |
and mount a read-write network volume into the `vttablet` and `vtctld` pods. |
For example, you can mount any storage service accessible through NFS into a |
Kubernetes volume. Then provide the mount path to the configure script here. |
If you prefer to skip setting up a backup volume for the purpose of this example, |
you can choose `file` mode and set the path to `/tmp`. |
### Start Vitess |
``` console |
./vitess-up.sh |
``` |
This will run through the steps to bring up Vitess. At the end, you should see |
something like this: |
``` console |
**************************** |
* Complete! |
* Use the following line to make an alias to kvtctl: |
* alias kvtctl='$GOPATH/bin/vtctlclient -server 104.197.47.173:30001' |
* See the vtctld UI at: http://104.197.47.173:30000 |
**************************** |
``` |
### Start the Guestbook app |
``` console |
./guestbook-up.sh |
``` |
The guestbook service is configured with `type: LoadBalancer` to tell Kubernetes |
to expose it on an external IP. It may take a minute to set up, but you should |
soon see the external IP show up under the internal one like this: |
``` console |
$ kubectl get service guestbook |
NAME LABELS SELECTOR IP(S) PORT(S) |
guestbook <none> name=guestbook 10.67.253.173 80/TCP |
104.197.151.132 |
``` |
Visit the external IP in your browser to view the guestbook. Note that in this |
modified guestbook, there are multiple pages to demonstrate range-based sharding |
in Vitess. Each page number is assigned to one of the shards using a |
[consistent hashing](https://en.wikipedia.org/wiki/Consistent_hashing) scheme. |
### Tear down |
``` console |
./guestbook-down.sh |
./vitess-down.sh |
``` |
You may also want to remove any firewall rules you created. |
<|endoftext|> |
# source: k8s_examples/_archived/storage/vitess/vtgate-controller-template.yaml type: yaml |
kind: ReplicationController |
apiVersion: v1 |
metadata: |
name: vtgate |
spec: |
replicas: {{replicas}} |
template: |
metadata: |
labels: |
component: vtgate |
app: vitess |
spec: |
containers: |
- name: vtgate |
image: vitess/lite:v2.0.0-alpha5 |
volumeMounts: |
- name: syslog |
mountPath: /dev/log |
- name: vtdataroot |
mountPath: /vt/vtdataroot |
resources: |
limits: |
memory: "512Mi" |
cpu: "500m" |
command: |
- sh |
- "-c" |
- >- |
mkdir -p $VTDATAROOT/tmp && |
chown -R vitess /vt && |
su -p -c "/vt/bin/vtgate |
-topo_implementation etcd |
-etcd_global_addrs http://$ETCD_GLOBAL_SERVICE_HOST:$ETCD_GLOBAL_SERVICE_PORT |
-log_dir $VTDATAROOT/tmp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.