From dc020cd433e8907f42e79af1420e8ba13606c4aa Mon Sep 17 00:00:00 2001 From: leecalcote Date: Wed, 2 Nov 2022 00:56:44 +0000 Subject: [PATCH] [Patterns] Pattern components generated from latest Nginx Service Mesh Helm chart Signed-off-by: l5io --- ...ery.layer5.io.meshery.layer5io.schema.json | 64 +++++++++++++ ...tbreaker.meshery.layer5.io_definition.json | 20 ++++ ...ery.layer5.io.meshery.layer5io.schema.json | 39 ++++++++ ...utegroup.meshery.layer5.io_definition.json | 20 ++++ .../nginxmesh.meshery.layer5io.schema.json | 6 ++ .../workloads/1.6.0/nginxmesh_definition.json | 1 + ...ery.layer5.io.meshery.layer5io.schema.json | 81 ++++++++++++++++ ...atelimit.meshery.layer5.io_definition.json | 20 ++++ ...ery.layer5.io.meshery.layer5io.schema.json | 85 +++++++++++++++++ ...spiffeid.meshery.layer5.io_definition.json | 20 ++++ ...ery.layer5.io.meshery.layer5io.schema.json | 5 + ...tcproute.meshery.layer5.io_definition.json | 20 ++++ ...ery.layer5.io.meshery.layer5io.schema.json | 64 +++++++++++++ ...ficsplit.meshery.layer5.io_definition.json | 20 ++++ ...ery.layer5.io.meshery.layer5io.schema.json | 95 +++++++++++++++++++ ...ictarget.meshery.layer5.io_definition.json | 20 ++++ 16 files changed, 580 insertions(+) create mode 100644 templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io_definition.json create mode 100644 templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io_definition.json create mode 100644 templates/oam/workloads/1.6.0/nginxmesh.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/nginxmesh_definition.json create mode 100644 templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io_definition.json create mode 100644 templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io_definition.json create mode 100644 templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io_definition.json create mode 100644 templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io_definition.json create mode 100644 templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io.meshery.layer5io.schema.json create mode 100644 templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io_definition.json diff --git a/templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io.meshery.layer5io.schema.json new file mode 100644 index 0000000..4cd1482 --- /dev/null +++ b/templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io.meshery.layer5io.schema.json @@ -0,0 +1,64 @@ +{ + "description": "Specifications of this circuit breaker.", + "properties": { + "destination": { + "description": "The destination of this circuit breaker.", + "properties": { + "kind": { + "description": "Kind of the destination.", + "enum": [ + "Service" + ], + "type": "string" + }, + "name": { + "description": "Name of the destination.", + "minLength": 1, + "type": "string" + }, + "namespace": { + "description": "Namespace of the destination.", + "type": "string" + } + }, + "required": [ + "name", + "kind" + ], + "type": "object" + }, + "errors": { + "description": "The number of errors allowed within the timeout before tripping the circuit.", + "minimum": 0, + "type": "integer" + }, + "fallback": { + "description": "The fallback Service to send traffic to when the circuit is tripped.", + "properties": { + "port": { + "description": "The port of the fallback Service.", + "maximum": 65535, + "minimum": 0, + "type": "integer" + }, + "service": { + "description": "The fallback Service to send traffic to when the circuit is tripped.", + "type": "string" + } + }, + "type": "object" + }, + "timeoutSeconds": { + "description": "The timeout window for errors to occur, and the amount of time to wait before closing the circuit.", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "destination", + "errors", + "timeoutSeconds" + ], + "title": "Circuit Breaker", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io_definition.json b/templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io_definition.json new file mode 100644 index 0000000..addafb0 --- /dev/null +++ b/templates/oam/workloads/1.6.0/circuitbreaker.meshery.layer5.io_definition.json @@ -0,0 +1,20 @@ +{ + "kind": "WorkloadDefinition", + "apiVersion": "core.oam.dev/v1alpha1", + "metadata": { + "name": "CircuitBreaker", + "creationTimestamp": null + }, + "spec": { + "definitionRef": { + "name": "circuitbreaker.meshery.layer5.io" + }, + "metadata": { + "@type": "pattern.meshery.io/mesh/workload", + "k8sAPIVersion": "specs.smi.nginx.com/v1alpha1", + "k8sKind": "CircuitBreaker", + "meshName": "NGINX_SERVICE_MESH", + "meshVersion": "1.6.0" + } + } +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io.meshery.layer5io.schema.json new file mode 100644 index 0000000..29d2d9d --- /dev/null +++ b/templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io.meshery.layer5io.schema.json @@ -0,0 +1,39 @@ +{ + "description": "HTTPRouteGroupSpec defines the desired state of HTTPRouteGroup It is the specification for a HTTPRouteGroup", + "properties": { + "matches": { + "description": "Routes for inbound traffic", + "items": { + "description": "HTTPMatch defines an individual route for HTTP traffic", + "properties": { + "headers": { + "additionalProperties": { + "type": "string" + }, + "description": "Headers is a list of headers used to match HTTP traffic", + "type": "object" + }, + "methods": { + "description": "Methods for inbound traffic as defined in RFC 7231 https://tools.ietf.org/html/rfc7231#section-4", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Name is the name of the match for referencing in a TrafficTarget", + "type": "string" + }, + "pathRegex": { + "description": "PathRegex is a regular expression defining the route", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "title": "HTTP Route Group", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io_definition.json b/templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io_definition.json new file mode 100644 index 0000000..8f1675c --- /dev/null +++ b/templates/oam/workloads/1.6.0/httproutegroup.meshery.layer5.io_definition.json @@ -0,0 +1,20 @@ +{ + "kind": "WorkloadDefinition", + "apiVersion": "core.oam.dev/v1alpha1", + "metadata": { + "name": "HTTPRouteGroup", + "creationTimestamp": null + }, + "spec": { + "definitionRef": { + "name": "httproutegroup.meshery.layer5.io" + }, + "metadata": { + "@type": "pattern.meshery.io/mesh/workload", + "k8sAPIVersion": "specs.smi-spec.io/v1alpha3", + "k8sKind": "HTTPRouteGroup", + "meshName": "NGINX_SERVICE_MESH", + "meshVersion": "1.6.0" + } + } +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/nginxmesh.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/nginxmesh.meshery.layer5io.schema.json new file mode 100644 index 0000000..7222115 --- /dev/null +++ b/templates/oam/workloads/1.6.0/nginxmesh.meshery.layer5io.schema.json @@ -0,0 +1,6 @@ +{ + "$id": "http://meshery.layer5.io/definition/Workload/NginxMesh", + "$schema": "http://json-schema.org/draft-07/schema", + "title": "NginxMesh", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/nginxmesh_definition.json b/templates/oam/workloads/1.6.0/nginxmesh_definition.json new file mode 100644 index 0000000..be580e5 --- /dev/null +++ b/templates/oam/workloads/1.6.0/nginxmesh_definition.json @@ -0,0 +1 @@ +{"kind":"WorkloadDefinition","apiVersion":"core.oam.dev/v1alpha1","metadata":{"name":"NginxMesh","creationTimestamp":null},"spec":{"definitionRef":{"name":"nginxmesh.meshery.layer5.io"},"metadata":{"@type":"pattern.meshery.io/core","version":"1.6.0"}}} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io.meshery.layer5io.schema.json new file mode 100644 index 0000000..512f7a5 --- /dev/null +++ b/templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io.meshery.layer5io.schema.json @@ -0,0 +1,81 @@ +{ + "properties": { + "burst": { + "description": "The number of requests to allow beyond the given rate.", + "minimum": 0, + "type": "integer" + }, + "delay": { + "description": "The number of requests after which to delay requests.", + "x-kubernetes-int-or-string": true + }, + "destination": { + "description": "The destination of this rate limit.", + "properties": { + "kind": { + "description": "Kind of the destination.", + "minLength": 1, + "type": "string" + }, + "name": { + "description": "Name of the destination.", + "minLength": 1, + "type": "string" + }, + "namespace": { + "description": "Namespace of the destination.", + "type": "string" + } + }, + "required": [ + "name", + "kind" + ], + "type": "object" + }, + "name": { + "description": "Name of this rate limit spec.", + "minLength": 1, + "type": "string" + }, + "rate": { + "description": "The allowed rate of traffic.", + "pattern": "^[0-9]+r/[s,m]$", + "type": "string" + }, + "sources": { + "description": "Sources of this rate limit.", + "items": { + "properties": { + "kind": { + "description": "Kind of this source.", + "minLength": 1, + "type": "string" + }, + "name": { + "description": "Name of this source.", + "minLength": 1, + "type": "string" + }, + "namespace": { + "description": "Namespace of this source.", + "type": "string" + } + }, + "required": [ + "name", + "kind" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "destination", + "rate" + ], + "title": "Rate Limit", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io_definition.json b/templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io_definition.json new file mode 100644 index 0000000..2e39cdb --- /dev/null +++ b/templates/oam/workloads/1.6.0/ratelimit.meshery.layer5.io_definition.json @@ -0,0 +1,20 @@ +{ + "kind": "WorkloadDefinition", + "apiVersion": "core.oam.dev/v1alpha1", + "metadata": { + "name": "RateLimit", + "creationTimestamp": null + }, + "spec": { + "definitionRef": { + "name": "ratelimit.meshery.layer5.io" + }, + "metadata": { + "@type": "pattern.meshery.io/mesh/workload", + "k8sAPIVersion": "specs.smi.nginx.com/v1alpha1", + "k8sKind": "RateLimit", + "meshName": "NGINX_SERVICE_MESH", + "meshVersion": "1.6.0" + } + } +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io.meshery.layer5io.schema.json new file mode 100644 index 0000000..f8507d6 --- /dev/null +++ b/templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io.meshery.layer5io.schema.json @@ -0,0 +1,85 @@ +{ + "description": "SpiffeIDSpec defines the desired state of SpiffeID", + "properties": { + "dnsNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "federatesWith": { + "items": { + "type": "string" + }, + "type": "array" + }, + "parentId": { + "type": "string" + }, + "selector": { + "properties": { + "agent_node_uid": { + "description": "UID of the node", + "type": "string" + }, + "arbitrary": { + "description": "Arbitrary selectors", + "items": { + "type": "string" + }, + "type": "array" + }, + "cluster": { + "description": "The k8s_psat cluster name", + "type": "string" + }, + "containerImage": { + "description": "Container image to match for this spiffe ID", + "type": "string" + }, + "containerName": { + "description": "Container name to match for this spiffe ID", + "type": "string" + }, + "namespace": { + "description": "Namespace to match for this spiffe ID", + "type": "string" + }, + "nodeName": { + "description": "Node name to match for this spiffe ID", + "type": "string" + }, + "podLabel": { + "additionalProperties": { + "type": "string" + }, + "description": "Pod label name/value to match for this spiffe ID", + "type": "object" + }, + "podName": { + "description": "Pod name to match for this spiffe ID", + "type": "string" + }, + "podUid": { + "description": "Pod UID to match for this spiffe ID", + "type": "string" + }, + "serviceAccount": { + "description": "ServiceAccount to match for this spiffe ID", + "type": "string" + } + }, + "type": "object" + }, + "spiffeId": { + "type": "string" + } + }, + "required": [ + "parentId", + "selector", + "spiffeId" + ], + "title": "Spiffe ID", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io_definition.json b/templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io_definition.json new file mode 100644 index 0000000..28439f9 --- /dev/null +++ b/templates/oam/workloads/1.6.0/spiffeid.meshery.layer5.io_definition.json @@ -0,0 +1,20 @@ +{ + "kind": "WorkloadDefinition", + "apiVersion": "core.oam.dev/v1alpha1", + "metadata": { + "name": "SpiffeID", + "creationTimestamp": null + }, + "spec": { + "definitionRef": { + "name": "spiffeid.meshery.layer5.io" + }, + "metadata": { + "@type": "pattern.meshery.io/mesh/workload", + "k8sAPIVersion": "spiffeid.spiffe.io/v1beta1", + "k8sKind": "SpiffeID", + "meshName": "NGINX_SERVICE_MESH", + "meshVersion": "1.6.0" + } + } +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io.meshery.layer5io.schema.json new file mode 100644 index 0000000..5de492c --- /dev/null +++ b/templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io.meshery.layer5io.schema.json @@ -0,0 +1,5 @@ +{ + "description": "TCPRouteSpec defines the desired state of TCPRoute", + "title": "TCP Route", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io_definition.json b/templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io_definition.json new file mode 100644 index 0000000..36c68fb --- /dev/null +++ b/templates/oam/workloads/1.6.0/tcproute.meshery.layer5.io_definition.json @@ -0,0 +1,20 @@ +{ + "kind": "WorkloadDefinition", + "apiVersion": "core.oam.dev/v1alpha1", + "metadata": { + "name": "TCPRoute", + "creationTimestamp": null + }, + "spec": { + "definitionRef": { + "name": "tcproute.meshery.layer5.io" + }, + "metadata": { + "@type": "pattern.meshery.io/mesh/workload", + "k8sAPIVersion": "specs.smi-spec.io/v1alpha3", + "k8sKind": "TCPRoute", + "meshName": "NGINX_SERVICE_MESH", + "meshVersion": "1.6.0" + } + } +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io.meshery.layer5io.schema.json new file mode 100644 index 0000000..cbf92c0 --- /dev/null +++ b/templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io.meshery.layer5io.schema.json @@ -0,0 +1,64 @@ +{ + "description": "TrafficSplitSpec defines the desired state of TrafficSplit", + "properties": { + "backends": { + "description": "Backends defines a list of Kubernetes services used as the traffic split destination", + "items": { + "description": "TrafficSplitBackend defines a backend", + "properties": { + "service": { + "description": "Service is the name of a Kubernetes service", + "type": "string" + }, + "weight": { + "description": "Weight defines the traffic split percentage", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "service", + "weight" + ], + "type": "object" + }, + "type": "array" + }, + "matches": { + "description": "Matches allows defining a list of HTTP route groups that this traffic split object should match", + "items": { + "description": "TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.", + "properties": { + "apiGroup": { + "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "type": "string" + }, + "kind": { + "description": "Kind is the type of resource being referenced", + "type": "string" + }, + "name": { + "description": "Name is the name of resource being referenced", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "service": { + "description": "Service represents the apex service", + "type": "string" + } + }, + "required": [ + "backends", + "service" + ], + "title": "Traffic Split", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io_definition.json b/templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io_definition.json new file mode 100644 index 0000000..768605b --- /dev/null +++ b/templates/oam/workloads/1.6.0/trafficsplit.meshery.layer5.io_definition.json @@ -0,0 +1,20 @@ +{ + "kind": "WorkloadDefinition", + "apiVersion": "core.oam.dev/v1alpha1", + "metadata": { + "name": "TrafficSplit", + "creationTimestamp": null + }, + "spec": { + "definitionRef": { + "name": "trafficsplit.meshery.layer5.io" + }, + "metadata": { + "@type": "pattern.meshery.io/mesh/workload", + "k8sAPIVersion": "split.smi-spec.io/v1alpha3", + "k8sKind": "TrafficSplit", + "meshName": "NGINX_SERVICE_MESH", + "meshVersion": "1.6.0" + } + } +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io.meshery.layer5io.schema.json b/templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io.meshery.layer5io.schema.json new file mode 100644 index 0000000..a8d2b34 --- /dev/null +++ b/templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io.meshery.layer5io.schema.json @@ -0,0 +1,95 @@ +{ + "description": "TrafficTargetSpec is the specification of a TrafficTarget", + "properties": { + "destination": { + "description": "Selector is the pod or group of pods to allow ingress traffic", + "properties": { + "kind": { + "description": "Kind is the type of Subject to allow ingress (ServiceAccount | Group)", + "type": "string" + }, + "name": { + "description": "Name of the Subject, i.e. ServiceAccountName", + "type": "string" + }, + "namespace": { + "description": "Namespace where the Subject is deployed", + "type": "string" + }, + "port": { + "description": "Port defines a TCP port to apply the TrafficTarget to", + "type": "integer" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "rules": { + "description": "Rules are the traffic rules to allow (HTTPRoutes | TCPRoute)", + "items": { + "description": "TrafficTargetRule is the TrafficSpec to allow for a TrafficTarget", + "properties": { + "kind": { + "description": "Kind is the kind of TrafficSpec to allow", + "type": "string" + }, + "matches": { + "description": "Matches is a list of TrafficSpec routes to allow traffic for", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Name of the TrafficSpec to use", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "sources": { + "description": "Sources are the pod or group of pods to allow ingress traffic", + "items": { + "description": "IdentityBindingSubject is a Kubernetes objects which should be allowed access to the TrafficTarget", + "properties": { + "kind": { + "description": "Kind is the type of Subject to allow ingress (ServiceAccount | Group)", + "type": "string" + }, + "name": { + "description": "Name of the Subject, i.e. ServiceAccountName", + "type": "string" + }, + "namespace": { + "description": "Namespace where the Subject is deployed", + "type": "string" + }, + "port": { + "description": "Port defines a TCP port to apply the TrafficTarget to", + "type": "integer" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "destination" + ], + "title": "Traffic Target", + "type": "object" +} \ No newline at end of file diff --git a/templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io_definition.json b/templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io_definition.json new file mode 100644 index 0000000..f0eb912 --- /dev/null +++ b/templates/oam/workloads/1.6.0/traffictarget.meshery.layer5.io_definition.json @@ -0,0 +1,20 @@ +{ + "kind": "WorkloadDefinition", + "apiVersion": "core.oam.dev/v1alpha1", + "metadata": { + "name": "TrafficTarget", + "creationTimestamp": null + }, + "spec": { + "definitionRef": { + "name": "traffictarget.meshery.layer5.io" + }, + "metadata": { + "@type": "pattern.meshery.io/mesh/workload", + "k8sAPIVersion": "access.smi-spec.io/v1alpha2", + "k8sKind": "TrafficTarget", + "meshName": "NGINX_SERVICE_MESH", + "meshVersion": "1.6.0" + } + } +} \ No newline at end of file