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):

RequestJSON:

{"metadata":{"name":"productpage-cluster","namespace":"documentation"},"spec":{"endpoints":[{"kind":"endpoint","tenant":"acmecorp","namespace":"documentation","name":"productpage-endpoint"}],"health_checks":[{"kind":"healthcheck","tenant":"acmecorp","namespace":"documentation","name":"productpage-healthcheck"}],"loadbalancer_algorithm":"RANDOM","tls_parameters":{"common_params":{"cipher_suites":[],"tls_certificates":[{"certificate_url":"string:///\u003cBase64\u003e","private_key":{"blindfold_secret_info":{"location":"string:///\u003cBase64\u003e"}}}]},"sni":"productpage.internal.bookinfo.com"}}} `

vesctl yaml response:

ResponseJSON:

  "metadata": {
    "name": "productpage-cluster",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "adbe352e-3497-4cf8-881f-74b7ae950279",
    "creation_timestamp": "2022-07-28T12:09:47.605772955Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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"
              },
              "blindfold_secret_info_internal": null,
              "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
  }
}```
`

Request using curl:

    


curl -X 'POST' -d '{"metadata":{"name":"productpage-cluster","namespace":"documentation"},"spec":{"endpoints":[{"kind":"endpoint","tenant":"acmecorp","namespace":"documentation","name":"productpage-endpoint"}],"health_checks":[{"kind":"healthcheck","tenant":"acmecorp","namespace":"documentation","name":"productpage-healthcheck"}],"loadbalancer_algorithm":"RANDOM","tls_parameters":{"common_params":{"cipher_suites":[],"tls_certificates":[{"certificate_url":"string:///\u003cBase64\u003e","private_key":{"blindfold_secret_info":{"location":"string:///\u003cBase64\u003e"}}}]},"sni":"productpage.internal.bookinfo.com"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build1372770011_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: Thu, 28 Jul 2022 12:09:47 GMT Vary: Accept-Encoding

{ "metadata": { "name": "productpage-cluster", "namespace": "documentation", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "adbe352e-3497-4cf8-881f-74b7ae950279", "creation_timestamp": "2022-07-28T12:09:47.605772955Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [ ], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": { } }, "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" }, "blindfold_secret_info_internal": null, "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 } }