ves-io-schema-cluster-API-Create

Examples of creating cluster

Usecase:

Create productpage-cluster pointing productpage endpoint and productpage healthcheck

Request using vesctl:

vesctl configuration create cluster -i cluster.yaml

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

metadata:
  name: productpage-cluster
  namespace: documentation
spec:
  endpoints:
  - kind: endpoint
    name: productpage-endpoint
    namespace: documentation
    tenant: acmecorp
  healthChecks:
  - kind: healthcheck
    name: productpage-healthcheck
    namespace: documentation
    tenant: acmecorp
  loadbalancerAlgorithm: RANDOM
  tlsParameters:
    commonParams:
      cipherSuites: []
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
    sni: productpage.internal.bookinfo.com

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: productpage-cluster
  namespace: documentation
spec:
  defaultSubset: {}
  endpointSubsets: []
  endpoints:
  - kind: endpoint
    name: productpage-endpoint
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
  healthChecks:
  - kind: healthcheck
    name: productpage-healthcheck
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
  loadbalancerAlgorithm: RANDOM
  tlsParameters:
    commonParams:
      cipherSuites: []
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
    sni: productpage.internal.bookinfo.com
systemMetadata:
  creationTimestamp: "2020-07-31T12:54:04.041252500Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 85ff5cb7-a055-421b-8c41-773581c59d58

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"productpage-cluster","namespace":"documentation"},"spec":{"endpoints":[{"kind":"endpoint","tenant":"acmecorp","namespace":"documentation","name":"productpage-endpoint"}],"healthChecks":[{"kind":"healthcheck","tenant":"acmecorp","namespace":"documentation","name":"productpage-healthcheck"}],"loadbalancerAlgorithm":"RANDOM","tlsParameters":{"commonParams":{"cipherSuites":[],"tlsCertificates":[{"certificateUrl":"string:///\u003cBase64\u003e","privateKey":{"blindfoldSecretInfo":{"location":"string:///\u003cBase64\u003e"}}}]},"sni":"productpage.internal.bookinfo.com"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build896999001_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/clusters'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Fri, 31 Jul 2020 12:54:04 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "productpage-cluster",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "85ff5cb7-a055-421b-8c41-773581c59d58",
    "creation_timestamp": "2020-07-31T12:54:04.041252500Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "endpoints": [
      {
        "kind": "endpoint",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "productpage-endpoint"
      }
    ],
    "health_checks": [
      {
        "kind": "healthcheck",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "productpage-healthcheck"
      }
    ],
    "loadbalancer_algorithm": "RANDOM",
    "circuit_breaker": null,
    "endpoint_subsets": [
    ],
    "default_subset": {
    },
    "fallback_policy": "NO_FALLBACK",
    "tls_parameters": {
      "common_params": {
        "minimum_protocol_version": "TLS_AUTO",
        "maximum_protocol_version": "TLS_AUTO",
        "cipher_suites": [
        ],
        "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": ""
          }
        ],
        "trusted_ca_url": "",
        "validation_params": null
      },
      "sni": "productpage.internal.bookinfo.com"
    },
    "connection_timeout": 0,
    "http_idle_timeout": 0,
    "outlier_detection": null,
    "endpoint_selection": "DISTRIBUTED",
    "http2_options": null
  }
}