Interactions with Cloud Block Store

How to interact with Cloud Block Store via CLI or REST APIs

  1. Interaction from vbos-manager pod

    1. Find vbos-manager pod:
      $ kubectl get po --all-namespaces | grep vbos-manager
      vbos vbos-manager-699bbbbf49-rzb28 2/2 Running 0 3d15h
    2. Enter vbos-manager pod:
      $ kubectl exec -it -nvbos vbos-manager-699bbbbf49-rzb28 -c vbos-manager -- bash
    3. Execute vbosctl binary under root
      root@vbos-manager-699bbbbf49-rzb28:/# ./vbosctl status
      Bucket Usage:
      NAME USAGE VSET VENDOR TYPE
      ...
  2. Interaction from an operation node

    1. Expose application with services
      Reference: https://cloud.google.com/kubernetes-engine/docs/how-to/exposing-apps
    2. NodePort as an example
      $ kubectl get svc | grep vbos-manager
      vbos-manager ClusterIP 10.247.21.105 <none> 80/TCP 37m
      $ kubectl -n vbos patch svc vbos-manager -p '{"spec":{"type":"NodePort"}}'
      service/vbos-manager patched
      $ kubectl get svc | grep vbos-manager
      vbos-manager NodePort 10.247.21.105 <none> 80:31337/TCP 46m
    3. Obtain a copy of vbosctl from vbos-manager pod
      $ kubectl cp -c vbos-manager vbos-manager-699bbbbf49-rzb28:/vbosctl vbosctl
      tar: Removing leading `/' from member names
      $ chmod +x vbosctl
    4. Run vbosctl binary, login with NodePort
      $ ./vbosctl login 10.247.21.105:31337 -u$VBOS-USERNAME -p$VBOS-PASSWD

      # vbosctl credentials saved in yaml after login
      $ cat ~/.vbos.yaml
      Server: 10.247.21.105:31337
      Username: xxx
      Token: xxx...
  3. Interaction via REST APIs

    1. With Services exposed, for example via NodePort, visit http://10.247.30.130:31659/swagger/index.html from a browser.
    2. Configure Ingress to vbos-manager service
      Reference: https://cloud.google.com/kubernetes-engine/docs/how-to/load-balance-ingress