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": "3784cc84-4bbc-4d87-86b2-0bc73563e5b2",
        "creation_timestamp": "2022-09-23T13:11:43.489547195Z",
        "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,
        "header_transformation_type": 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-build243329498_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, 23 Sep 2022 13:11:43 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "productpage-cluster",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "3784cc84-4bbc-4d87-86b2-0bc73563e5b2",
    "creation_timestamp": "2022-09-23T13:11:43.489547195Z",
    "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,
    "header_transformation_type": null
  }
}