Files
homelab-frontend/k8s/crd-serviceadapter.yaml
T

162 lines
5.7 KiB
YAML

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: serviceadapters.gateway.riotpiao.com
spec:
group: gateway.riotpiao.com
names:
kind: ServiceAdapter
plural: serviceadapters
singular: serviceadapter
scope: Namespaced
versions:
- name: v1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
description: ServiceAdapter describes a service exposed through the gateway.
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
type: object
description: ServiceAdapterSpec defines the desired state of ServiceAdapter.
required:
- serviceName
- upstream
- auth
- resources
properties:
serviceName:
type: string
description: ServiceName is the unique identifier for this service.
minLength: 1
maxLength: 63
upstream:
type: object
description: Upstream defines where to forward requests.
required:
- url
- timeoutSeconds
properties:
url:
type: string
description: URL is the upstream service endpoint.
minLength: 1
timeoutSeconds:
type: integer
description: TimeoutSeconds is the request timeout in seconds.
minimum: 1
maximum: 3600
auth:
type: object
description: Auth defines default authentication for this adapter.
required:
- required
properties:
required:
type: boolean
description: Required indicates if authentication is needed.
capability:
type: string
description: Capability is the required capability name.
retryable:
type: boolean
description: Retryable indicates if requests can be retried on 5xx.
default: false
resources:
type: array
description: Resources are the endpoints exposed by this adapter.
minItems: 1
items:
type: object
description: ServiceAdapterResource defines a resource.
required:
- name
- methods
properties:
name:
type: string
description: Name is the resource identifier.
minLength: 1
methods:
type: array
description: Methods are the HTTP methods available.
minItems: 1
items:
type: object
description: ServiceAdapterMethod defines a single method.
required:
- verb
- upstreamPath
properties:
verb:
type: string
description: Verb is the HTTP method.
enum:
- GET
- POST
- PUT
- DELETE
- PATCH
- HEAD
- OPTIONS
upstreamPath:
type: string
description: UpstreamPath is the path on upstream.
minLength: 1
requestSchema:
type: string
description: RequestSchema validation DSL.
responseSchema:
type: string
description: ResponseSchema validation DSL.
auth:
type: object
description: Auth overrides resource-level auth.
properties:
required:
type: boolean
capability:
type: string
auth:
type: object
description: Auth applies to all methods unless overridden.
properties:
required:
type: boolean
capability:
type: string
status:
type: object
description: ServiceAdapterStatus defines observed state.
properties:
ready:
type: boolean
description: Ready indicates if adapter is loaded.
error:
type: string
description: Error message if adapter failed to load.
lastSyncTime:
type: string
format: date-time
description: LastSyncTime is when adapter was last synced.
additionalPrinterColumns:
- name: Service
type: string
jsonPath: .spec.serviceName
- name: Ready
type: boolean
jsonPath: .status.ready
- name: Age
type: date
jsonPath: .metadata.creationTimestamp