Getting startedGuidesReferenceChangelog
Apoxy:// Docs / Reference / Service

Service

API reference for Services (compute.apoxy.dev/v1alpha1)

API Group: compute.apoxy.dev/v1alpha1

Operations

List Service

GET/apis/compute.apoxy.dev/v1alpha1/services

List Service

Response

  • 200: OK

Create Service

POST/apis/compute.apoxy.dev/v1alpha1/services

Create a Service

Request Body

Spec fields (ServiceSpec):

FieldTypeDescription
liveRevisionstringLiveRevision selects which ServiceRevision serves: - empty: auto — the latest ready revision is served (continuous deploy for push, auto-promote for git). The served name is reported in status.liveRevision; the controller never writes this field. - set: pinned — exactly the named revision is served (rollback, or manual git promotion). New revisions are still minted but do not go live until this is repointed. The target must still be retained (see RevisionHistoryLimit).
revisionHistoryLimitinteger (int32)RevisionHistoryLimit defaults to 10.
sourceServiceSourceSource is where the service's bundle comes from. Exactly one variant: a directly-pushed OCI bundle (oci) or a git/CI pipeline (git). The resolved digest always lands in the minted ServiceRevision.spec.bundle. (required)
templateServiceTemplateSpecTemplate is the desired serving config for the next minted revision. Always user-owned. A change to Template mints a ServiceRevision. (required)

Response

  • 200: OK
  • 201: Created
  • 202: Accepted

Delete All Service

DELETE/apis/compute.apoxy.dev/v1alpha1/services

Delete collection of Service

Response

  • 200: OK

Get Service

GET/apis/compute.apoxy.dev/v1alpha1/services/{name}

Get the specified Service

Response

  • 200: OK

Replace Service

PUT/apis/compute.apoxy.dev/v1alpha1/services/{name}

Replace the specified Service

Request Body

Spec fields (ServiceSpec):

FieldTypeDescription
liveRevisionstringLiveRevision selects which ServiceRevision serves: - empty: auto — the latest ready revision is served (continuous deploy for push, auto-promote for git). The served name is reported in status.liveRevision; the controller never writes this field. - set: pinned — exactly the named revision is served (rollback, or manual git promotion). New revisions are still minted but do not go live until this is repointed. The target must still be retained (see RevisionHistoryLimit).
revisionHistoryLimitinteger (int32)RevisionHistoryLimit defaults to 10.
sourceServiceSourceSource is where the service's bundle comes from. Exactly one variant: a directly-pushed OCI bundle (oci) or a git/CI pipeline (git). The resolved digest always lands in the minted ServiceRevision.spec.bundle. (required)
templateServiceTemplateSpecTemplate is the desired serving config for the next minted revision. Always user-owned. A change to Template mints a ServiceRevision. (required)

Response

  • 200: OK
  • 201: Created

Update Service

PATCH/apis/compute.apoxy.dev/v1alpha1/services/{name}

Partially update the specified Service

Response

  • 200: OK
  • 201: Created

Delete Service

DELETE/apis/compute.apoxy.dev/v1alpha1/services/{name}

Delete a Service

Response

  • 200: OK
  • 202: Accepted

Schema Reference

ServiceSource

FieldTypeDescription
gitGitSourceGit is a git/CI build pipeline (git model). Builds produce the digest and mint revisions.
ociBundleRefOCI is a directly-pushed OCI bundle (push model). The controller resolves its tag to a digest and mints a revision pinned to that digest.

GitSource

FieldTypeDescription
buildBuildConfig(required)
credentialsRefOCICredentialsRef
previewsPreviewPolicy
triggersTriggers(required)
urlstringURL of the git repository. (required)

BuildConfig

FieldTypeDescription
builderstringBuilder image used to produce the bundle (e.g. an image wrapping wrangler/esbuild).
commandstring[]Command overrides the builder default build command.
envEnvVar[]
outputBundleRefOutput is where built bundles are pushed. The per-build digest lands in Build.Status. (required)
rootDirstringRootDir within the repo, default ".".

EnvVar

FieldTypeDescription
namestring(required)
valuestring(required)

BundleRef

FieldTypeDescription
credentialsOCICredentialsOnly one of Credentials or CredentialsRef may be set.
credentialsRefOCICredentialsRef
digeststringDigest pins the exact artifact, e.g. "sha256:...". Strongly preferred: the serving path is digest-addressed and immutable.
repostringRepo is the OCI repository, e.g. "registry.apoxy.dev/acme/api". (required)
tagstringTag is resolved to a Digest by the controller if Digest is unset.

OCICredentials

FieldTypeDescription
accessTokenstringAccessToken is a registry bearer token sent as-is (Authorization: Bearer), skipping the token-service exchange.
passwordstringPassword is the write-only plain-text form; use PasswordData when authoring programmatically.
passwordDatastringPasswordData is the RAW password bytes. NOT base64 of the password (unlike the extensions API field of the same name) — JSON's []byte encoding already handles the transport encoding. Takes precedence over Password when both are set.
refreshTokenstringRefreshToken is an OAuth2 refresh token (docker's "identity token") exchanged with the registry's token service for access tokens.
usernamestring

OCICredentialsRef

FieldTypeDescription
groupstring(required)
namestring(required)
namespacestring(required)

PreviewPolicy

FieldTypeDescription
enabledbooleanEnabled spawns ephemeral preview Services (owned by this Service) per non-production branch / PR. (required)
ttlDurationTTL after which idle previews are garbage-collected.

Triggers

FieldTypeDescription
onPullRequestbooleanOnPullRequest enables preview builds for PR branches.
pathsstring[]Paths, if set, restricts triggering to changes under these globs.
productionBranchstringProductionBranch is built+promoted on push. Default "main".

ServiceTemplateSpec

FieldTypeDescription
specServiceConfigSpec(required)

ServiceConfigSpec

FieldTypeDescription
backendBackendConfigBackend selects backend mode and its settings; this is the default mode when neither member is set.
bindingsBinding[]
egressServiceEgressEgress selects how outbound network traffic is mediated. Absent means the project "default" egress gateway (egress on by default); see ServiceEgress for the full semantics and the disabled opt-out.
envEnvVar[]
filterFilterConfigFilter selects filter mode and its settings.
runtimeServiceRuntime

BackendConfig

FieldTypeDescription
portinteger (int32)Port is only meaningful for tcp/udp; ignored for http1/http2.
protocolstring

Binding

FieldTypeDescription
kvKVBinding
namestringName is the identifier exposed to service code (env.<Name>). (required)
secretSecretBinding
serviceServiceBinding
typestring(required)

KVBinding

FieldTypeDescription
namespacestringNamespace identifies the KV store partition (a store name, not a k8s namespace). (required)

SecretBinding

FieldTypeDescription
keystringKey within the store's values map. (required)
storestringStore names the SecretStore (cluster-scoped, same project). (required)

ServiceBinding

FieldTypeDescription
serviceRefstring(required)

ServiceEgress

FieldTypeDescription
disabledbooleanDisabled hard-denies all egress for this service (globalOutbound is unset in workerd and the sandbox netstack resets any outbound attempt). Mutually exclusive with a non-empty gatewayRef.
gatewayRefstringGatewayRef names the compute.apoxy.dev EgressGateway that mediates this service's outbound traffic. Empty means the project "default" gateway. Existence is not validated at admission; a dangling ref surfaces as the EgressReady=False condition on Service status.

FilterConfig

FieldTypeDescription
failureModestring
phasestring

ServiceRuntime

FieldTypeDescription
compatibilityDatestringCompatibilityDate is required by workerd; pinned per revision. (required)
compatibilityFlagsstring[]
limitsServiceLimits
timeoutDurationTimeout is the wall-clock request timeout. Default 30s.

ServiceLimits

FieldTypeDescription
cpuTimeDurationCPUTime is the per-request CPU budget (workerd-style), e.g. "50ms".
memorystringMemory cap, e.g. "128Mi".