Documentation
¶
Overview ¶
Package controller contains Kubernetes controllers for coder-k8s resources.
Package controller contains Kubernetes controllers for coder-k8s resources.
Package controller contains Kubernetes controllers for coder-k8s resources.
Index ¶
- type CleanupRecordReconciler
- type CoderAIGatewayKeyReconciler
- type CoderAIProviderReconciler
- type CoderControlPlaneReconciler
- type CoderMCPServerReconciler
- type CoderProvisionerReconciler
- type CoderTemplateTestReconciler
- type CoderWorkspacePoolMemberReconciler
- type CoderWorkspacePoolReconciler
- type CoderWorkspaceProxyReconciler
- type EntitlementsInspector
- type LicenseUploader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupRecordReconciler ¶ added in v0.1.5
type CleanupRecordReconciler struct {
client.Client
// APIReader reads the object of a record live, so a stale cache never
// makes a living object look gone.
APIReader client.Reader
OperatorNamespace string
Clock clock.Clock
Recorder events.EventRecorder
// contains filtered or unexported fields
}
CleanupRecordReconciler sweeps the cleanup records of objects that went without a confirmed delete in Coder (#353). It acts only through a ready control plane whose current Coder deployment ID equals the record's, and it deletes only the recorded provider ID, the provider with the recorded nonce, or the AI Gateway keys whose names start with the recorded prefix.
func (*CleanupRecordReconciler) Reconcile ¶ added in v0.1.5
func (r *CleanupRecordReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile sweeps one record.
func (*CleanupRecordReconciler) SetupWithManager ¶ added in v0.1.5
func (r *CleanupRecordReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager watches the records in the operator namespace. It wakes a record when its CoderAIProvider or CoderAIGatewayKey is deleted, and every record when a control plane gets operator access, since that control plane can match them.
type CoderAIGatewayKeyReconciler ¶ added in v0.1.4
type CoderAIGatewayKeyReconciler struct {
client.Client
// APIReader reads the output Secret and the objects of the reserved-name
// check live, not from the cache.
APIReader client.Reader
Scheme *runtime.Scheme
Clock clock.PassiveClock
// OperatorNamespace holds the cleanup records (#353).
OperatorNamespace string
// contains filtered or unexported fields
}
CoderAIGatewayKeyReconciler reconciles CoderAIGatewayKey objects (#156). It issues a Coder AI Gateway key into an owned Secret, rotates it, retires replaced keys, and deletes every key of the object when the object goes.
func (*CoderAIGatewayKeyReconciler) Reconcile ¶ added in v0.1.4
func (r *CoderAIGatewayKeyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile handles deletion first, stores the finalizer before any Coder call, then runs the observe step and at most one action.
func (*CoderAIGatewayKeyReconciler) SetupWithManager ¶ added in v0.1.4
func (r *CoderAIGatewayKeyReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into controller-runtime. A change of the output Secret, or of any control plane in the namespace (any of them can reserve the Secret name), requeues the object at once.
type CoderAIProviderReconciler ¶ added in v0.1.4
type CoderAIProviderReconciler struct {
client.Client
Scheme *runtime.Scheme
// OperatorNamespace holds the cleanup records (#353): the operator's own
// namespace, which only the operator can write ConfigMaps in.
OperatorNamespace string
// APIReader reads the cleanup records live: a record written moments ago
// can be missing from the cache.
APIReader client.Reader
// contains filtered or unexported fields
}
CoderAIProviderReconciler reconciles CoderAIProvider objects (#154). It checks the spec, the credential Secret and the control plane, creates the Coder provider when the name is free, and sets the spec values on the provider that it created. It never changes a provider that it did not create.
func (*CoderAIProviderReconciler) Reconcile ¶ added in v0.1.4
func (r *CoderAIProviderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile runs the checks in order and reports the first one that fails.
func (*CoderAIProviderReconciler) SetupWithManager ¶ added in v0.1.4
func (r *CoderAIProviderReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into controller-runtime. A change of the referenced control plane or of the key Secret requeues the provider.
type CoderControlPlaneReconciler ¶
type CoderControlPlaneReconciler struct {
client.Client
APIReader client.Reader
Scheme *runtime.Scheme
OperatorAccessProvisioner coderbootstrap.OperatorAccessProvisioner
LicenseUploader LicenseUploader
EntitlementsInspector EntitlementsInspector
// Clock is optional (nil: the real clock). Tests set it to move the
// dependent hold of a deleted control plane.
Clock clock.PassiveClock
}
CoderControlPlaneReconciler reconciles a CoderControlPlane object.
func (*CoderControlPlaneReconciler) Reconcile ¶
func (r *CoderControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile converges the desired CoderControlPlane spec into Deployment and Service resources.
func (*CoderControlPlaneReconciler) SetupWithManager ¶
func (r *CoderControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into controller-runtime.
type CoderMCPServerReconciler ¶ added in v0.1.4
type CoderMCPServerReconciler struct {
client.Client
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
CoderMCPServerReconciler reconciles CoderMCPServer objects (#155). It checks the control plane, the organization and its opt-in, and the credential Secrets, reports a slug that a config of someone else holds, creates the config, and syncs it on every reconcile.
func (*CoderMCPServerReconciler) Reconcile ¶ added in v0.1.4
func (r *CoderMCPServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile runs the checks in order and reports the first one that fails.
func (*CoderMCPServerReconciler) SetupWithManager ¶ added in v0.1.4
func (r *CoderMCPServerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into controller-runtime. The controller watches its own kind without a generation predicate, so an annotation change also triggers a reconcile. A change of the referenced control plane or of a credential Secret requeues the object.
type CoderProvisionerReconciler ¶
type CoderProvisionerReconciler struct {
client.Client
Scheme *runtime.Scheme
BootstrapClient coderbootstrap.Client
}
CoderProvisionerReconciler reconciles a CoderProvisioner object.
func (*CoderProvisionerReconciler) Reconcile ¶
func (r *CoderProvisionerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error)
Reconcile converges the desired CoderProvisioner spec into Deployment, RBAC, and Secret resources.
func (*CoderProvisionerReconciler) SetupWithManager ¶
func (r *CoderProvisionerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into controller-runtime.
type CoderTemplateTestReconciler ¶ added in v0.1.3
type CoderTemplateTestReconciler struct {
client.Client
Scheme *runtime.Scheme
Clock clock.PassiveClock
// contains filtered or unexported fields
}
CoderTemplateTestReconciler runs CoderTemplateTest objects (#152): it creates a throwaway workspace from a template version, waits until every agent is ready, records the result, and deletes the workspace.
func (*CoderTemplateTestReconciler) Reconcile ¶ added in v0.1.3
func (r *CoderTemplateTestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile runs the first step of the test that applies, then returns.
func (*CoderTemplateTestReconciler) SetupWithManager ¶ added in v0.1.3
func (r *CoderTemplateTestReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into controller-runtime. Nothing calls it until activation (#152). A change of a control plane requeues the tests that use it, so cleanup that waits for Coder resumes at once.
type CoderWorkspacePoolMemberReconciler ¶ added in v0.1.4
type CoderWorkspacePoolMemberReconciler struct {
client.Client
// APIReader reads the pool and the control plane's consent without the
// cache right before the create request.
APIReader client.Reader
Scheme *runtime.Scheme
Clock clock.PassiveClock
// contains filtered or unexported fields
}
CoderWorkspacePoolMemberReconciler makes the Coder workspace of one CoderWorkspacePoolMember (#153 plan 6.2). Nothing registers it yet. This version runs the steps up to the create request: readiness, the watch rules, and cleanup follow before activation.
type CoderWorkspacePoolReconciler ¶ added in v0.1.5
type CoderWorkspacePoolReconciler struct {
client.Client
// APIReader reads members without the cache, so a stale cache never
// makes the pool count too few members.
APIReader client.Reader
Scheme *runtime.Scheme
Clock clock.PassiveClock
}
CoderWorkspacePoolReconciler resolves the inputs of one CoderWorkspacePool, creates its members, and reports them (#153 plan 6.3). Nothing registers it yet.
type CoderWorkspaceProxyReconciler ¶
type CoderWorkspaceProxyReconciler struct {
client.Client
Scheme *runtime.Scheme
BootstrapClient coderbootstrap.Client
}
CoderWorkspaceProxyReconciler reconciles a CoderWorkspaceProxy object.
func (*CoderWorkspaceProxyReconciler) Reconcile ¶
func (r *CoderWorkspaceProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile converges the desired CoderWorkspaceProxy spec into Deployment and Service resources.
func (*CoderWorkspaceProxyReconciler) SetupWithManager ¶
func (r *CoderWorkspaceProxyReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into controller-runtime.
type EntitlementsInspector ¶
type EntitlementsInspector interface {
Entitlements(ctx context.Context, coderURL, sessionToken string) (codersdk.Entitlements, error)
}
EntitlementsInspector inspects coderd entitlements.
func NewSDKEntitlementsInspector ¶
func NewSDKEntitlementsInspector() EntitlementsInspector
NewSDKEntitlementsInspector returns an EntitlementsInspector backed by codersdk.
type LicenseUploader ¶
type LicenseUploader interface {
AddLicense(ctx context.Context, coderURL, sessionToken, licenseJWT string) error
HasAnyLicense(ctx context.Context, coderURL, sessionToken string) (bool, error)
}
LicenseUploader uploads and inspects Coder Enterprise licenses in a coderd instance.
func NewSDKLicenseUploader ¶
func NewSDKLicenseUploader() LicenseUploader
NewSDKLicenseUploader returns a LicenseUploader backed by codersdk.
Source Files
¶
- cleanup_record.go
- cleanup_sweep.go
- coder_access.go
- coder_workspace_steps.go
- coderaigatewaykey_controller.go
- coderaigatewaykey_delete.go
- coderaigatewaykey_issue.go
- coderaigatewaykey_record.go
- coderaigatewaykey_recover.go
- coderaigatewaykey_retire.go
- coderaigatewaykey_rotate.go
- coderaiprovider_controller.go
- coderaiprovider_create.go
- coderaiprovider_delete.go
- coderaiprovider_disable.go
- coderaiprovider_env.go
- coderaiprovider_record.go
- coderaiprovider_sync.go
- codercontrolplane_controller.go
- codermcpserver_acl.go
- codermcpserver_apply.go
- codermcpserver_controller.go
- codermcpserver_create.go
- codermcpserver_delete.go
- codermcpserver_disable.go
- coderprovisioner_controller.go
- codertemplatetest_cleanup.go
- codertemplatetest_confirm.go
- codertemplatetest_controller.go
- codertemplatetest_create.go
- codertemplatetest_delete.go
- codertemplatetest_readiness.go
- coderworkspacepool_controller.go
- coderworkspacepoolmember_cleanup.go
- coderworkspacepoolmember_controller.go
- coderworkspacepoolmember_extend.go
- coderworkspacepoolmember_ready.go
- coderworkspacepoolmember_watch.go
- coderworkspaceproxy_controller.go
- controlplane_access.go
- controlplane_hold.go
- credential_checks.go
- owned_secret.go
- reserved_secret_names.go
- rollout_restart.go