ves-io-schema-views-cdn_loadbalancer-API-Create

Examples of creating cdn_loadbalancer

Usecase:

Create "productpage" CDN loadbalancer which supports HTTPS

Request using vesctl:

vesctl configuration create cdn_loadbalancer -i cdn_loadbalancer.yaml

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

metadata:
  labels:
    ves.io/app_type: bookinfo
  name: productpage
  namespace: documentation
spec:
  autoHostRewrite: {}
  defaultRoutePools:
  - pool:
      name: ppage-route
  domains:
  - www.bookinfo.com
  https:
    enablePathNormalize: {}
    tlsParameters:
      noMtls: {}
      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:
  autoHostRewrite: {}
  defaultRoutePools:
  - endpointSubsets: {}
    pool:
      name: ppage-route
      namespace: documentation
      tenant: acmecorp
  domains:
  - www.bookinfo.com
  https:
    enablePathNormalize: {}
    tlsParameters:
      noMtls: {}
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
      tlsConfig:
        defaultSecurity: {}
systemMetadata:
  creationTimestamp: "2022-01-12T14:51:42.166634600Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: d741dc68-fb09-4300-b454-98dd3b954cb0

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"}}}],"noMtls":{}},"enablePathNormalize":{}},"defaultRoutePools":[{"pool":{"name":"ppage-route"}}],"autoHostRewrite":{}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build038462651_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/cdn_loadbalancers'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 12 Jan 2022 14:51:42 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "productpage",
    "namespace": "documentation",
    "labels": {
      "ves.io/app_type": "bookinfo"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d741dc68-fb09-4300-b454-98dd3b954cb0",
    "creation_timestamp": "2022-01-12T14:51:42.166634600Z",
    "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"
              },
              "blindfold_secret_info_internal": null,
              "secret_encoding_type": "EncodingNone"
            },
            "description": ""
          }
        ],
        "no_mtls": {

        }
      },
      "enable_path_normalize": {

      }
    },
    "default_route_pools": [
      {
        "pool": {
          "tenant": "acmecorp",
          "namespace": "documentation",
          "name": "ppage-route"
        },
        "weight": 0,
        "priority": 0,
        "endpoint_subsets": {
        }
      }
    ],
    "auto_host_rewrite": {

    },
    "add_location": false,
    "cdn_service": null
  }
}