ves-io-schema-views-http_loadbalancer-API-Create

Examples of creating http_loadbalancer

Usecase:

Create "productpage" HTTP loadbalancer which supports HTTPS

Request using vesctl:

vesctl configuration create http_loadbalancer -i http_loadbalancer.yaml

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

metadata:
  labels:
    ves.io/app_type: bookinfo
  name: productpage
  namespace: documentation
spec:
  advertiseOnPublicDefaultVip: {}
  defaultRoutePools:
  - pool:
      name: ppage-route
  domains:
  - www.bookinfo.com
  https:
    tlsParameters:
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
      tlsConfig:
        defaultSecurity: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels:
    ves.io/app_type: bookinfo
  name: productpage
  namespace: documentation
spec:
  advertiseOnPublicDefaultVip: {}
  defaultRoutePools:
  - pool:
      name: ppage-route
      namespace: documentation
      tenant: acmecorp
  dnsInfo: []
  domains:
  - www.bookinfo.com
  https:
    tlsParameters:
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
      tlsConfig:
        defaultSecurity: {}
  routes: []
  wafExclusionRules: []
systemMetadata:
  creationTimestamp: "2020-09-23T09:54:13.415638Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 72382390-9a5a-4eae-b8fa-58dd67e01749

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"productpage","namespace":"documentation","labels":{"ves.io/app_type":"bookinfo"}},"spec":{"domains":["www.bookinfo.com"],"https":{"tlsParameters":{"tlsConfig":{"defaultSecurity":{}},"tlsCertificates":[{"certificateUrl":"string:///\u003cBase64\u003e","privateKey":{"blindfoldSecretInfo":{"location":"string:///\u003cBase64\u003e"}}}]}},"advertiseOnPublicDefaultVip":{},"defaultRoutePools":[{"pool":{"name":"ppage-route"}}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build823219857_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/http_loadbalancers'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:54:13 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "productpage",
    "namespace": "documentation",
    "labels": {
      "ves.io/app_type": "bookinfo"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "72382390-9a5a-4eae-b8fa-58dd67e01749",
    "creation_timestamp": "2020-09-23T09:54:13.415638Z",
    "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"
    ],
    "https": {
      "http_redirect": false,
      "add_hsts": false,
      "tls_parameters": {
        "tls_config": {
          "default_security": {

          }
        },
        "tls_certificates": [
          {
            "certificate_url": "string:///\u003cBase64\u003e",
            "private_key": {
              "blindfold_secret_info": {
                "decryption_provider": "",
                "store_provider": "",
                "location": "string:///\u003cBase64\u003e"
              },
              "secret_encoding_type": "EncodingNone"
            },
            "description": ""
          }
        ]
      }
    },
    "advertise_on_public_default_vip": {

    },
    "default_route_pools": [
      {
        "pool": {
          "tenant": "acmecorp",
          "namespace": "documentation",
          "name": "ppage-route"
        },
        "weight": 0
      }
    ],
    "routes": [
    ],
    "cors_policy": null,
    "add_location": false,
    "more_option": null,
    "user_identification": null,
    "malicious_user_mitigation": null,
    "waf_exclusion_rules": [
    ],
    "host_name": "",
    "dns_info": [
    ],
    "state": "VIRTUAL_HOST_READY",
    "auto_cert_state": "AutoCertDisabled",
    "auto_cert_info": null
  }
}