Skip to content

CoderAIGatewayKey

API identity

  • Group/version: coder.com/v1alpha1
  • Kind: CoderAIGatewayKey
  • Resource: coderaigatewaykeys
  • Scope: namespaced

Spec

Field Type Description
controlPlaneRef CoderControlPlaneReference ControlPlaneRef names the CoderControlPlane in the same namespace. The controller creates and deletes keys with that control plane's operator token. The control plane must allow keys in spec.aiGateway.allowKeys.
secretName string SecretName is the Secret in the same namespace that receives the key, under the data key "key". The controller creates the Secret and owns it. It never writes a Secret that already exists and that this object does not own. To move the key to another Secret, delete and re-create this object.
rotation CoderAIGatewayKeyRotationSpec Rotation configures when the controller replaces the key and how long a replaced key stays valid.

Status

Field Type Description
observedGeneration integer ObservedGeneration is the generation the controller last processed.
appliedGeneration integer AppliedGeneration is the last generation that the controller fully applied. A spec change re-arms a stall that waits for one.
nextSerial integer NextSerial is the serial of the next key create request. It never decreases, so the controller never reuses a key name.
lastCreateAttemptTime Time LastCreateAttemptTime is when the controller last sent a key create request. Orphaned keys are deleted only after a settle window from this time.
pendingKey CoderAIGatewayKeyPending PendingKey is set before every key create request and cleared after it. While it is set, a create request can be in flight or already committed in Coder.
currentKey CoderAIGatewayKeyCurrent CurrentKey is the key that the output Secret holds.
retiringKeys CoderAIGatewayKeyRetiring array RetiringKeys are replaced keys that wait for deletion in Coder.
lastHandledTrigger string LastHandledTrigger is the spec.rotation.trigger value that the controller last acted on.
nextRotationTime Time NextRotationTime is when the next scheduled rotation is due.
consecutiveIssueFailures integer ConsecutiveIssueFailures counts create requests in a row whose outcome was uncertain, and failed Secret writes. A success resets it.
lastDriftReissueTime Time LastDriftReissueTime is when the controller last issued a key because the Secret no longer held the current key.
killSwitchGeneration integer KillSwitchGeneration is the generation in which the controller found the current key deleted in Coder. The controller creates no key until the generation changes. 0 means the kill switch is not active.
answerMismatchGeneration integer AnswerMismatchGeneration is the generation in which Coder answered a create with a key that did not match the request. The controller creates no key until the generation changes. 0 means no mismatch.
conditions Condition array Conditions are Ready, Reconciling, and Stalled.

Referenced types

CoderAIGatewayKeyCurrent

CoderAIGatewayKeyCurrent records the key that the output Secret holds. It holds no secret data and nothing derived from it.

Field Type Description
serial integer Serial is the key serial.
id string ID is the Coder key ID. It is not the key.
name string Name is the Coder key name.
issuedAt Time IssuedAt is when the controller wrote the key to the Secret.

CoderAIGatewayKeyPending

CoderAIGatewayKeyPending is the create marker. The controller writes it before every key create request. It holds no secret data.

Field Type Description
serial integer Serial is the key serial of the create request.
name string Name is the Coder key name of the create request.
createAttemptTime Time CreateAttemptTime is when the controller wrote this marker.

CoderAIGatewayKeyRetiring

CoderAIGatewayKeyRetiring records a replaced key that waits for deletion in Coder. It holds no secret data and nothing derived from it.

Field Type Description
serial integer Serial is the key serial.
id string ID is the Coder key ID. It is not the key.
name string Name is the Coder key name.
replacedAt Time ReplacedAt is when a newer key replaced this key in the Secret. The grace period counts from this time.

CoderAIGatewayKeyRotationSpec

CoderAIGatewayKeyRotationSpec configures key rotation. +kubebuilder:validation:XValidation:rule="!has(self.intervalSeconds) || !has(self.gracePeriodSeconds) || self.intervalSeconds == 0 || self.gracePeriodSeconds < self.intervalSeconds",message="gracePeriodSeconds must be shorter than intervalSeconds"

Field Type Description
intervalSeconds integer IntervalSeconds is the time between scheduled rotations, counted from the time the current key was written to the Secret. 0 turns scheduled rotation off. Otherwise it is between 1 day and 365 days. The default is 30 days, because Coder keys never expire.
gracePeriodSeconds integer GracePeriodSeconds is the minimum time between writing a new key to the Secret and deleting the replaced key in Coder. Consumers must reload within it. Between 10 minutes and 7 days, default 1 hour.
consumerWaitSeconds integer ConsumerWaitSeconds is how long after the grace period the controller keeps a replaced key while Coder still reports connections that use it. After that time the controller deletes the key, and gateways that still use it exit and restart with the key from the Secret. 0 deletes the key when the grace period ends. At most 7 days, default 1 day.
trigger string Trigger starts one rotation each time it changes to a new non-empty value. The value set when the object is created starts no rotation.

CoderControlPlaneReference

CoderControlPlaneReference names a CoderControlPlane in the same namespace.

Field Type Description
name string Name is the CoderControlPlane name.

Source

  • Go type: api/v1alpha1/coderaigatewaykey_types.go
  • Generated CRD: config/crd/bases/coder.com_coderaigatewaykeys.yaml