Skip to main content
Version: Next

Service

A Service represents a long-running service component in OpenChoreo. It defines the deployment configuration for service-type components by referencing a Workload and optionally a ServiceClass for platform-defined policies. Services can expose APIs with different access levels and integrate with OpenChoreo's API management capabilities.

API Version

openchoreo.dev/v1alpha1

Resource Definition

Metadata

Services are namespace-scoped resources that must be created within an Organization's namespace and belong to a Component through the owner field.

apiVersion: openchoreo.dev/v1alpha1
kind: Service
metadata:
name: <service-name>
namespace: <org-namespace> # Organization namespace

Spec Fields

FieldTypeRequiredDefaultDescription
ownerServiceOwnerYes-Ownership information linking the service to a project and component
workloadNamestringYes-Name of the workload that this service references
classNamestringNo"default"Name of the ServiceClass that provides deployment configuration
apismap[string]ServiceAPINoAPI configuration for endpoints. Keys must match endpoint keys in the workload

ServiceOwner

FieldTypeRequiredDefaultDescription
projectNamestringYes-Name of the project that owns this service (min: 1)
componentNamestringYes-Name of the component that owns this service (min: 1)

ServiceAPI

FieldTypeRequiredDefaultDescription
classNamestringNo"default"API class name for management policies
typeEndpointTypeYes-Type of the API endpoint
restRESTEndpointNo-REST-specific endpoint configuration

EndpointType

ValueDescription
HTTPStandard HTTP endpoint
RESTRESTful API endpoint
gRPCgRPC service endpoint
GraphQLGraphQL API endpoint
WebsocketWebSocket endpoint
TCPRaw TCP endpoint
UDPUDP endpoint

RESTEndpoint

FieldTypeRequiredDefaultDescription
backendHTTPBackendNo-Backend configuration for the REST endpoint
exposeLevels[RESTOperationExposeLevel]No[]Access levels for the REST API

HTTPBackend

FieldTypeRequiredDefaultDescription
portint32Yes-Port number where the backend service is listening
basePathstringNo""Base path for the API (e.g., "/api/v1")

RESTOperationExposeLevel

ValueDescription
ProjectAPI accessible only within the same project
OrganizationAPI accessible within the organization
PublicAPI publicly accessible (subject to authentication/authorization)

Examples

Basic Service

apiVersion: openchoreo.dev/v1alpha1
kind: Service
metadata:
name: customer-service
namespace: default
spec:
owner:
projectName: my-project
componentName: customer-service
workloadName: customer-service-workload
className: default

Service with API Configuration

apiVersion: openchoreo.dev/v1alpha1
kind: Service
metadata:
name: order-service
namespace: default
spec:
owner:
projectName: my-project
componentName: order-service
workloadName: order-service-workload # References workload with endpoint "order-api"
className: production-service
apis:
order-api: # Must match endpoint key "order-api" in the workload
className: default
type: REST
rest:
backend:
port: 8080
basePath: /api/v1
exposeLevels:
- Organization
- Public

Annotations

Services support the following annotations:

AnnotationDescription
openchoreo.dev/display-nameHuman-readable name for UI display
openchoreo.dev/descriptionDetailed description of the service