ves-io-schema-views-tcp_loadbalancer-API-Create

Examples of creating tcp_loadbalancer

Usecase:

Create "productpage" TCP loadbalancer

Request using vesctl:

vesctl configuration create tcp_loadbalancer -i tcp_loadbalancer.yaml

where file tcploadbalancer.yaml has following contents (tcploadbalancer.CreateRequest):

metadata:
  labels:
    ves.io/app_type: bookinfo
  name: productpage
  namespace: documentation
spec:
  advertiseOnPublicDefaultVip: {}
  domains:
  - www.bookinfo.com
  listenPort: 80
  originPoolsWeights:
  - pool:
      name: ppage-route

vesctl yaml response:

metadata:
  annotations: {}
  labels:
    ves.io/app_type: bookinfo
  name: productpage
  namespace: documentation
spec:
  advertiseOnPublicDefaultVip: {}
  dnsInfo: []
  domains:
  - www.bookinfo.com
  listenPort: 80
  originPools: []
  originPoolsWeights:
  - pool:
      name: ppage-route
      namespace: documentation
      tenant: acmecorp
systemMetadata:
  creationTimestamp: "2020-09-16T10:51:05.621834700Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 9c045be3-ae85-4e03-a1fd-38c86581e346

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"productpage","namespace":"documentation","labels":{"ves.io/app_type":"bookinfo"}},"spec":{"domains":["www.bookinfo.com"],"listenPort":80,"originPoolsWeights":[{"pool":{"name":"ppage-route"}}],"advertiseOnPublicDefaultVip":{}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/tcp_loadbalancers'

curl response:

HTTP/1.1 200 OK
Content-Length: 1055
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:51:05 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "productpage",
    "namespace": "documentation",
    "labels": {
      "ves.io/app_type": "bookinfo"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "9c045be3-ae85-4e03-a1fd-38c86581e346",
    "creation_timestamp": "2020-09-16T10:51:05.621834700Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "domains": [
      "www.bookinfo.com"
    ],
    "listen_port": 80,
    "with_sni": false,
    "origin_pools": [
    ],
    "origin_pools_weights": [
      {
        "pool": {
          "tenant": "acmecorp",
          "namespace": "documentation",
          "name": "ppage-route"
        },
        "weight": 0
      }
    ],
    "advertise_on_public_default_vip": {

    },
    "host_name": "",
    "dns_info": [
    ]
  }
}