Documentation
¶
Index ¶
- Constants
- Variables
- func CreateConfigMap(ctx context.Context, client k8sClient.Client, restore *velerov1.Restore) error
- func DevboxProbeConfigMapName(runner string, revision int64) string
- func ExtractResourceRequests(obj *unstructured.Unstructured) map[string]*ResourceRequests
- func GenerateAPIConstraint(instance *unstructured.Unstructured) (*console.PolicyConstraintAttributes, error)
- func GetObjectFromOwnerReference(ctx context.Context, client k8sClient.Client, ref v1.OwnerReference, ...) (*unstructured.Unstructured, error)
- func IsJobStatusConditionPresentAndEqual(conditions []batchv1.JobCondition, conditionType batchv1.JobConditionType, ...) bool
- func IsJobStatusConditionTrue(conditions []batchv1.JobCondition, conditionType batchv1.JobConditionType) bool
- func Job(ctx context.Context, r runtimeclient.Client, job *batchv1.Job, log logr.Logger) (*batchv1.Job, error)
- func LogOverriddenCRDValues(ctx context.Context, spec v1alpha1.AgentConfigurationSpec)
- type AgentConfigurationReconciler
- type AgentRunReconciler
- type AgentRuntimeReconciler
- func (r *AgentRuntimeReconciler) ListAgentRuntimePendingRuns(ctx context.Context, id string) ...
- func (r *AgentRuntimeReconciler) Publish(runID string, kick bool)
- func (r *AgentRuntimeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, retErr error)
- func (r *AgentRuntimeReconciler) SetupWithManager(mgr ctrl.Manager) error
- type ArgoRolloutReconciler
- type BackupReconciler
- type BundleData
- type CloudProvider
- type ClusterDrainReconciler
- type ClusterSubstrateClients
- type ConfigMapProbeClient
- func (c *ConfigMapProbeClient) Cleanup(ctx context.Context, runner string, revision int64) error
- func (c *ConfigMapProbeClient) ReleaseToken(ctx context.Context, runner string, revision int64) error
- func (c *ConfigMapProbeClient) Request(ctx context.Context, req DevboxProbeRequest) error
- func (c *ConfigMapProbeClient) Result(ctx context.Context, runner string, revision int64) (*DevboxProbeResult, error)
- type ConfigurationFetcher
- type ConstraintReconciler
- func (r *ConstraintReconciler) ConstraintPodStatusToUnstructured(ctx context.Context, cps *constraintstatusv1beta1.ConstraintPodStatus) (*unstructured.Unstructured, error)
- func (r *ConstraintReconciler) Reconcile(ctx context.Context, req ctrl.Request) (reconcile.Result, error)
- func (r *ConstraintReconciler) SetupWithManager(mgr ctrl.Manager) error
- type CrdRegisterControllerReconciler
- type CustomHealthReconciler
- type CustomInsightPriorityReconciler
- type DebounceReconciler
- type DefaultScope
- type DevboxConfig
- type DevboxConsoleClient
- type DevboxGuestAgentSpec
- type DevboxImageContractResult
- type DevboxImageResolver
- type DevboxProbeClient
- type DevboxProbeEvaluation
- type DevboxProbeRequest
- type DevboxProbeResult
- type DevboxProbeTokenMinter
- type DevboxRunnerGuestConfig
- type DevboxRunnerReconciler
- type EKSCloudProvider
- type GraphQLDevboxConsoleClient
- func (c *GraphQLDevboxConsoleClient) DeleteDevbox(ctx context.Context, id string) error
- func (c *GraphQLDevboxConsoleClient) GetDevboxByName(ctx context.Context, name string) (*console.DevboxFragment, error)
- func (c *GraphQLDevboxConsoleClient) HeartbeatDevbox(ctx context.Context, id string, attrs console.DevboxHeartbeatAttributes) error
- func (c *GraphQLDevboxConsoleClient) MintDevboxProbeToken(ctx context.Context, devboxID string) (probe.Token, error)
- func (c *GraphQLDevboxConsoleClient) UpsertDevbox(ctx context.Context, attrs console.DevboxAttributes) (*console.DevboxFragment, error)
- type HelmReleaseReconciler
- type ImageWarmerReconciler
- type IngressReplicaReconciler
- type K8sObjectIdentifier
- type KubecostExtractorReconciler
- func (r *KubecostExtractorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
- func (r *KubecostExtractorReconciler) RunOnInterval(ctx context.Context, key string, interval time.Duration, ...)
- func (r *KubecostExtractorReconciler) SetupWithManager(mgr ctrl.Manager) error
- type MetricsAggregateReconciler
- type PipelineGateReconciler
- type PluralCAPIClusterController
- type RegistryImageResolver
- type ResolvedDevboxImage
- type ResourceRequests
- type RestoreReconciler
- type Scope
- type SentinelRunJobReconciler
- func (r *SentinelRunJobReconciler) GenerateRunJob(run *console.SentinelRunJobFragment, jobSpec *batchv1.JobSpec, ...) (*batchv1.Job, error)
- func (r *SentinelRunJobReconciler) GetRunResourceName(run *console.SentinelRunJobFragment) string
- func (r *SentinelRunJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, retErr error)
- func (r *SentinelRunJobReconciler) SetupWithManager(mgr ctrl.Manager) error
- type ServiceIDCache
- type SetupWithManager
- type StackRunJobReconciler
- func (r *StackRunJobReconciler) GenerateRunJob(run *console.StackRunMinimalFragment, jobSpec *batchv1.JobSpec, ...) (*batchv1.Job, error)
- func (r *StackRunJobReconciler) GetRunResourceName(run *console.StackRunMinimalFragment) string
- func (r *StackRunJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, retErr error)
- func (r *StackRunJobReconciler) SetupWithManager(mgr ctrl.Manager) error
- type StatusViolation
- type SubstrateClients
- type UpgradeInsightsController
- type VirtualClusterController
- type VulnerabilityReportReconciler
Constants ¶
const ( AgentRunFinalizer = "deployments.plural.sh/agentrun-protection" EnvConsoleURL = "PLRL_CONSOLE_URL" EnvDeployToken = "PLRL_DEPLOY_TOKEN" EnvAgentRunID = "PLRL_AGENT_RUN_ID" EnvOpenCodeProvider = "PLRL_OPENCODE_PROVIDER" EnvOpenCodeEndpoint = "PLRL_OPENCODE_ENDPOINT" EnvOpenCodeModel = "PLRL_OPENCODE_MODEL" EnvOpenCodeMethod = "PLRL_OPENCODE_METHOD" EnvOpenCodeToken = "PLRL_OPENCODE_TOKEN" EnvOpenCodeOpenAICompatible = "PLRL_OPENCODE_OPENAI_COMPATIBLE" EnvClaudeModel = "PLRL_CLAUDE_MODEL" EnvClaudeToken = "PLRL_CLAUDE_TOKEN" EnvClaudeArgs = "PLRL_CLAUDE_ARGS" EnvClaudeBashDefaultTimeout = "PLRL_CLAUDE_BASH_DEFAULT_TIMEOUT" EnvClaudeBashMaxTimeout = "PLRL_CLAUDE_BASH_MAX_TIMEOUT" EnvClaudeEndpoint = "PLRL_CLAUDE_ENDPOINT" EnvGeminiModel = "PLRL_GEMINI_MODEL" EnvGeminiAPIKey = "PLRL_GEMINI_API_KEY" EnvGeminiInactivityTimeout = "PLRL_GEMINI_INACTIVITY_TIMEOUT" EnvGeminiEndpoint = "PLRL_GEMINI_ENDPOINT" EnvCodexModel = "PLRL_CODEX_MODEL" EnvCodexAPIKey = "PLRL_CODEX_API_KEY" EnvCodexEndpoint = "PLRL_CODEX_ENDPOINT" EnvCodexMethod = "PLRL_CODEX_METHOD" EnvPiModel = "PLRL_PI_MODEL" EnvPiAPIKey = "PLRL_PI_API_KEY" EnvPiProvider = "PLRL_PI_PROVIDER" EnvPiEndpoint = "PLRL_PI_ENDPOINT" EnvPiMethod = "PLRL_PI_METHOD" EnvDindEnabled = "PLRL_DIND_ENABLED" EnvBrowserEnabled = "PLRL_BROWSER_ENABLED" EnvMemoryEnabled = "PLRL_MEMORY_ENABLED" EnvMiseBootstrap = "PLRL_MISE_BOOTSTRAP" EnvExecTimeout = "PLRL_EXEC_TIMEOUT" EnvMiseGlobalConfigFile = "MISE_GLOBAL_CONFIG_FILE" EnvMiseDataDir = "MISE_DATA_DIR" EnvMiseErlangCompile = "MISE_ERLANG_COMPILE" EnvMiseErlangPrecompiledOS = "MISE_ERLANG_PRECOMPILED_OS" EnvGitProxy = "PLRL_GIT_PROXY" EnvExaConnection = "PLRL_EXA_CONNECTION" EnvMcpExcludeTools = "PLRL_EXCLUDE_TOOLS" EnvStreamingProxy = "PLRL_STREAMING_PROXY" EnvMCPServers = "PLRL_MCP_SERVERS" EnvWorkbenchMCPURL = "PLRL_WORKBENCH_MCP_URL" )
const ( DevboxProbeLabel = probe.Label DevboxProbeLabelRequest = probe.LabelRequest DevboxProbeRevisionLabel = probe.RevisionLabel DevboxProbeStateAnnotation = probe.StateAnnotation DevboxProbeStateDone = probe.StateDone DevboxProbeStateFailed = probe.StateFailed DevboxProbeRequestKey = probe.RequestKey DevboxProbeResultKey = probe.ResultKey DevboxProbeErrorKey = probe.ErrorKey DevboxProbeTokenSecretName = probe.TokenSecretName )
Agent probe handoff between the operator and the devbox gateway; the contract is documented in pkg/devbox/probe. The operator writes the request ConfigMap and the probe token, minted with console's mintDevboxProbeToken. It fails the revision if any declared agent is MISSING, or the probe failed or timed out, so the previous revision keeps serving. An agent whose probe is FAILED is surfaced as an AgentProbe warning. The result of the serving revision is kept as the agent catalog upserted to console, and deleted with the revision.
const (
AgentRuntimeFinalizer = "deployments.plural.sh/agent-runtime-protection"
)
const (
DevboxRunnerFinalizer = "deployments.plural.sh/devbox-runner-protection"
)
const PluralCAPIClusterFinalizer = "deployments.plural.sh/plural-capi-cluster-protection"
const (
SentinelRunJobFinalizer = "deployments.plural.sh/sentinel-run-job-protection"
)
const StackRunJobFinalizer = "deployments.plural.sh/stack-run-job-protection"
const (
VirtualClusterFinalizer = "deployments.plural.sh/virtualcluster-protection"
)
Variables ¶
var ErrDevboxSnapshotsRemain = errors.New("devbox snapshots remain")
Functions ¶
func CreateConfigMap ¶
func DevboxProbeConfigMapName ¶ added in v0.6.76
func ExtractResourceRequests ¶
func ExtractResourceRequests(obj *unstructured.Unstructured) map[string]*ResourceRequests
ExtractResourceRequests fetches CPU and memory requests from an Unstructured Kubernetes workload object.
func GenerateAPIConstraint ¶
func GenerateAPIConstraint(instance *unstructured.Unstructured) (*console.PolicyConstraintAttributes, error)
func GetObjectFromOwnerReference ¶
func GetObjectFromOwnerReference(ctx context.Context, client k8sClient.Client, ref v1.OwnerReference, namespace string) (*unstructured.Unstructured, error)
func IsJobStatusConditionPresentAndEqual ¶
func IsJobStatusConditionPresentAndEqual(conditions []batchv1.JobCondition, conditionType batchv1.JobConditionType, status corev1.ConditionStatus) bool
IsJobStatusConditionPresentAndEqual returns true when conditionType is present and equal to status.
func IsJobStatusConditionTrue ¶
func IsJobStatusConditionTrue(conditions []batchv1.JobCondition, conditionType batchv1.JobConditionType) bool
IsJobStatusConditionTrue returns true when the conditionType is present and set to `metav1.ConditionTrue`
func Job ¶
func Job(ctx context.Context, r runtimeclient.Client, job *batchv1.Job, log logr.Logger) (*batchv1.Job, error)
Job reconciles a k8s job object.
func LogOverriddenCRDValues ¶
func LogOverriddenCRDValues(ctx context.Context, spec v1alpha1.AgentConfigurationSpec)
Types ¶
type AgentConfigurationReconciler ¶
func (*AgentConfigurationReconciler) Reconcile ¶
func (r *AgentConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
Reconcile AgentConfiguration custom resources to ensure that Console stays in sync with Kubernetes cluster.
func (*AgentConfigurationReconciler) SetupWithManager ¶
func (r *AgentConfigurationReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type AgentRunReconciler ¶
type AgentRunReconciler struct {
client.Client
Scheme *runtime.Scheme
ConsoleClient pluralclient.Client
ConsoleURL string
DeployToken string
CacheSyncTimeout time.Duration
}
AgentRunReconciler is a controller for the AgentRun custom resource. It manages the lifecycle of individual agent runs by: 1. Creating pods to execute agent tasks 2. Monitoring pod status and updating AgentRun status 3. Reporting status back to Console API
func (*AgentRunReconciler) SetupWithManager ¶
func (r *AgentRunReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager configures the controller with the manager.
type AgentRuntimeReconciler ¶
type AgentRuntimeReconciler struct {
client.Client
ConsoleClient consoleclient.Client
Scheme *runtime.Scheme
CacheSyncTimeout time.Duration
Ctx context.Context
ClusterID string
OperatorNamespace string
}
AgentRuntimeReconciler reconciles a AgentRuntime object
func (*AgentRuntimeReconciler) ListAgentRuntimePendingRuns ¶
func (r *AgentRuntimeReconciler) ListAgentRuntimePendingRuns(ctx context.Context, id string) *algorithms.Pager[*console.ListAgentRuntimePendingRuns_AgentRuntime_PendingRuns_Edges]
func (*AgentRuntimeReconciler) Publish ¶
func (r *AgentRuntimeReconciler) Publish(runID string, kick bool)
func (*AgentRuntimeReconciler) Reconcile ¶
func (r *AgentRuntimeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, retErr error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (*AgentRuntimeReconciler) SetupWithManager ¶
func (r *AgentRuntimeReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ArgoRolloutReconciler ¶
type ArgoRolloutReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleClient client.Client
ConsoleURL string
HttpClient *http.Client
ArgoClientSet roclientset.Interface
DynamicClient dynamic.Interface
KubeClient kubernetes.Interface
SvcReconciler v1.Reconciler
}
ArgoRolloutReconciler reconciles a Argo Rollout custom resource.
func (*ArgoRolloutReconciler) Reconcile ¶
func (r *ArgoRolloutReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile Argo Rollout custom resources to ensure that Console stays in sync with Kubernetes cluster.
func (*ArgoRolloutReconciler) SetupWithManager ¶
func (r *ArgoRolloutReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type BackupReconciler ¶
type BackupReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleClient client.Client
}
BackupReconciler reconciles a Velero Backup custom resource.
func (*BackupReconciler) Reconcile ¶
Reconcile Velero Backup custom resources to ensure that Console stays in sync with Kubernetes cluster.
func (*BackupReconciler) SetupWithManager ¶
func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type BundleData ¶
type BundleData struct {
Description string `json:"description" yaml:"description"`
Severity string `json:"severity" yaml:"severity"`
BundleName string `json:"bundleName" yaml:"bundleName"`
BundleDisplayName string `json:"bundleDisplayName" yaml:"bundleDisplayName"`
Remediation string `json:"remediation" yaml:"remediation"`
}
type CloudProvider ¶
type CloudProvider interface {
UpgradeInsights(context.Context, v1alpha1.UpgradeInsights) ([]console.UpgradeInsightAttributes, []console.CloudAddonAttributes, error)
}
func NewCloudProvider ¶
func NewCloudProvider(distro *console.ClusterDistro, kubeClient runtimeclient.Client, clusterName string) (CloudProvider, error)
type ClusterDrainReconciler ¶
ClusterDrainReconciler reconciles a ClusterDrain object
func (*ClusterDrainReconciler) Reconcile ¶
func (r *ClusterDrainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
Reconcile executes the drain logic once per ClusterDrain object
func (*ClusterDrainReconciler) SetupWithManager ¶
func (r *ClusterDrainReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the controller
type ClusterSubstrateClients ¶ added in v0.6.76
type ClusterSubstrateClients struct {
Client client.Client
// Reader lists ClusterTrustBundles uncached.
Reader client.Reader
// Namespace holds every ServiceAccount tokens are minted for.
Namespace string
DefaultAddress string
DefaultServiceAccount string
// contains filtered or unexported fields
}
ClusterSubstrateClients reaches Substrate with nothing mounted into the operator: it mints ServiceAccount tokens for Substrate's audience through the TokenRequest API and verifies ate-api-server against the live ClusterTrustBundles of its signer. Clients are cached per address, ServiceAccount and signer, and redialed when the CA bundle changes.
func (*ClusterSubstrateClients) For ¶ added in v0.6.76
func (c *ClusterSubstrateClients) For(ctx context.Context, runner *v1alpha1.DevboxRunner) (substrate.API, error)
type ConfigMapProbeClient ¶ added in v0.6.76
type ConfigMapProbeClient struct {
Client client.Client
// Reader reads probe ConfigMaps and the token Secret, normally the manager's uncached API reader.
Reader client.Reader
Namespace string
Timeout time.Duration
// Tokens mints probe tokens. Without it requests carry no token and the probe runs unauthenticated.
Tokens DevboxProbeTokenMinter
// Now is overridable in tests.
Now func() time.Time
}
ConfigMapProbeClient implements the pkg/devbox/probe contract.
func (*ConfigMapProbeClient) ReleaseToken ¶ added in v0.6.76
func (c *ConfigMapProbeClient) ReleaseToken(ctx context.Context, runner string, revision int64) error
ReleaseToken drops a revision's probe token once its probe finished.
func (*ConfigMapProbeClient) Request ¶ added in v0.6.76
func (c *ConfigMapProbeClient) Request(ctx context.Context, req DevboxProbeRequest) error
Request writes the probe token, then the request ConfigMap if it doesn't exist yet. While the request is pending it keeps the token valid, so a gateway that picks the request up late still gets a usable one.
func (*ConfigMapProbeClient) Result ¶ added in v0.6.76
func (c *ConfigMapProbeClient) Result(ctx context.Context, runner string, revision int64) (*DevboxProbeResult, error)
type ConfigurationFetcher ¶ added in v0.6.60
type ConfigurationFetcher interface {
GetSecret(ctx context.Context, selector corev1.SecretKeySelector) (*corev1.Secret, error)
GetConfigMap(ctx context.Context, selector corev1.ConfigMapKeySelector) (*corev1.ConfigMap, error)
}
ConfigurationFetcher loads Secrets and ConfigMaps referenced by AgentRuntime configuration.
type ConstraintReconciler ¶
type ConstraintReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleClient consoleclient.Client
Reader k8sClient.Reader
Constraints map[string]console.PolicyConstraintAttributes
}
func (*ConstraintReconciler) ConstraintPodStatusToUnstructured ¶
func (r *ConstraintReconciler) ConstraintPodStatusToUnstructured(ctx context.Context, cps *constraintstatusv1beta1.ConstraintPodStatus) (*unstructured.Unstructured, error)
func (*ConstraintReconciler) SetupWithManager ¶
func (r *ConstraintReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type CrdRegisterControllerReconciler ¶
type CrdRegisterControllerReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
ReconcilerGroups map[schema.GroupVersionKind]SetupWithManager
Mgr ctrl.Manager
DiscoveryCache discoverycache.Cache
// contains filtered or unexported fields
}
CrdRegisterControllerReconciler reconciles a custom resource.
func (*CrdRegisterControllerReconciler) Reconcile ¶
func (r *CrdRegisterControllerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile Custom resources to ensure that Console stays in sync with Kubernetes cluster.
func (*CrdRegisterControllerReconciler) SetupWithManager ¶
func (r *CrdRegisterControllerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type CustomHealthReconciler ¶
CustomHealthReconciler reconciles a LuaScript object
func (*CustomHealthReconciler) Reconcile ¶
func (r *CustomHealthReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (*CustomHealthReconciler) SetupWithManager ¶
func (r *CustomHealthReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type CustomInsightPriorityReconciler ¶ added in v0.6.72
type CustomInsightPriorityReconciler struct {
client.Client
Scheme *runtime.Scheme
Registry *insightpriority.Registry
Recorder events.EventRecorder
}
CustomInsightPriorityReconciler registers the scripts that decide the priority of failing objects in the cluster insights, and reports how they are doing. The scripts run when the cluster is pinged, not here.
func (*CustomInsightPriorityReconciler) Reconcile ¶ added in v0.6.72
func (r *CustomInsightPriorityReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
Reconcile compiles the script and registers it when it is valid, then copies the result of its last evaluation to the status.
func (*CustomInsightPriorityReconciler) SetupWithManager ¶ added in v0.6.72
func (r *CustomInsightPriorityReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DebounceReconciler ¶
DebounceReconciler is a Reconciler that debounces reconcile requests.
func NewDebounceReconciler ¶
func NewDebounceReconciler(client client.Client, duration time.Duration, actual reconcile.Reconciler) *DebounceReconciler
NewDebounceReconciler creates a new DebounceReconciler.
func (*DebounceReconciler) Reconcile ¶
func (r *DebounceReconciler) Reconcile(_ context.Context, req reconcile.Request) (reconcile.Result, error)
Reconcile implements the reconcile.Reconciler interface.
func (*DebounceReconciler) Start ¶
func (r *DebounceReconciler) Start(ctx context.Context)
Start begins the debouncing mechanism.
type DefaultScope ¶
func (*DefaultScope[T]) PatchObject ¶
func (in *DefaultScope[T]) PatchObject() error
PatchObject ignores not found errors, since removing the last finalizer deletes the object before the remaining (eg. status) patches are issued.
type DevboxConfig ¶ added in v0.6.76
type DevboxConfig struct {
// Enabled is DEVBOXES_ENABLED; the controller is only registered when it is true.
Enabled bool
// OperatorVersion is IMAGE_TAG, used for default images and the daemon compatibility check.
OperatorVersion string
// OperatorNamespace holds the gateway and, unless WorkerPoolNamespace is set, the WorkerPools.
OperatorNamespace string
// OperatorServiceAccount is the operator's own ServiceAccount, granted owner on each atespace.
OperatorServiceAccount string
// DefaultImage is DEVBOX_DEFAULT_IMAGE, the image for runners without spec.image. When unset, DevboxImage
// falls back to devbox-fat at OperatorVersion on the agent's base registry.
DefaultImage string
// GatewayImage is DEVBOX_GATEWAY_IMAGE. When unset, GatewayImageRef falls back like DefaultImage.
GatewayImage string
// GatewayReplicas is DEVBOX_GATEWAY_REPLICAS.
GatewayReplicas int32
// GatewayServiceAccountAnnotations is DEVBOX_GATEWAY_SA_ANNOTATIONS (k=v,k=v), e.g. workload identity.
GatewayServiceAccountAnnotations map[string]string
// WorkerImages maps a sandbox class to its Substrate worker image (DEVBOX_WORKER_IMAGE_GVISOR, DEVBOX_WORKER_IMAGE_MICROVM).
WorkerImages map[v1alpha1.DevboxSandboxClass]string
// WorkerPoolNamespace is DEVBOX_WORKERPOOL_NAMESPACE, defaults to OperatorNamespace.
WorkerPoolNamespace string
// SubstrateNamespace is SUBSTRATE_NAMESPACE, where atenet-egress and atenet-router run.
SubstrateNamespace string
// SubstrateAddress is ATE_API_ADDRESS, ate-api-server's address for runners without spec.substrate.address.
SubstrateAddress string
// RouterAddress is DEVBOX_ROUTER_ADDRESS, atenet-router's gRPC address; defaults to atenet-router.<SubstrateNamespace>.svc:443.
RouterAddress string
// ActorJWTIssuer is DEVBOX_ACTOR_JWT_ISSUER, Substrate's actor JWT issuer; defaults to the agent-substrate chart's https://idp.<SubstrateNamespace>.svc.
ActorJWTIssuer string
// ConsoleURL and DeployToken are the operator's own; the gateway gets the same.
ConsoleURL string
DeployToken string
// KasURL is KAS's devbox listener, which the gateway tunnels through.
KasURL string
ClusterID string
DrainTimeout time.Duration
HeartbeatInterval time.Duration
}
DevboxConfig is the operator-wide devbox configuration. It comes from environment variables the deployment-operator chart sets when devboxes.enabled is true, so cmd/agent's flag set stays untouched.
func LoadDevboxConfig ¶ added in v0.6.76
func LoadDevboxConfig(operatorNamespace, consoleURL, deployToken, clusterID string) DevboxConfig
func (DevboxConfig) DevboxImage ¶ added in v0.6.76
func (c DevboxConfig) DevboxImage() string
DevboxImage is the image for runners without spec.image. The base registry is read on every call since the agent configuration can change it at runtime.
func (DevboxConfig) GatewayImageRef ¶ added in v0.6.76
func (c DevboxConfig) GatewayImageRef() string
func (DevboxConfig) GatewayPrincipal ¶ added in v0.6.76
func (c DevboxConfig) GatewayPrincipal() string
GatewayPrincipal is the gateway's Substrate API principal, as an access policy member ("user:<id>").
func (DevboxConfig) GatewaySpiffeID ¶ added in v0.6.76
func (c DevboxConfig) GatewaySpiffeID() string
GatewaySpiffeID is the identity the gateway presents to atenet-router; it must be in --ingress-allowed-spiffe-ids.
func (DevboxConfig) OperatorPrincipal ¶ added in v0.6.76
func (c DevboxConfig) OperatorPrincipal() string
type DevboxConsoleClient ¶ added in v0.6.76
type DevboxConsoleClient interface {
UpsertDevbox(ctx context.Context, attrs console.DevboxAttributes) (*console.DevboxFragment, error)
HeartbeatDevbox(ctx context.Context, id string, attrs console.DevboxHeartbeatAttributes) error
// GetDevboxByName returns nil without error when this cluster has no Devbox with that name.
GetDevboxByName(ctx context.Context, name string) (*console.DevboxFragment, error)
// DeleteDevbox returns ErrDevboxSnapshotsRemain while workbench snapshots of the box exist.
DeleteDevbox(ctx context.Context, id string) error
}
DevboxConsoleClient is the console API the DevboxRunner controller uses. It is kept narrow and local so the shared consoleclient.Client interface (and its mocks) need not change.
type DevboxGuestAgentSpec ¶ added in v0.6.76
type DevboxImageContractResult ¶ added in v0.6.76
type DevboxImageContractResult struct {
// Violations make the image unusable; the template revision is not built.
Violations []string
// Outdated is set when the daemon is more than one minor release behind the operator.
Outdated string
DaemonVersion string
}
DevboxImageContractResult is the outcome of checking a resolved image against contract v1 (section 4.1a).
func CheckDevboxImageContract ¶ added in v0.6.76
func CheckDevboxImageContract(img *ResolvedDevboxImage, operatorVersion string) DevboxImageContractResult
CheckDevboxImageContract checks what can be checked from the image config without pulling layers: the contract label, the devbox-daemon entrypoint, UID 1000, the trust directory, and daemon/operator version compatibility. Agent presence and trust-store writability are verified in the guest by the golden-boot agent probe.
func (DevboxImageContractResult) OK ¶ added in v0.6.76
func (r DevboxImageContractResult) OK() bool
type DevboxImageResolver ¶ added in v0.6.76
type DevboxImageResolver interface {
Resolve(ctx context.Context, image string, pullSecrets []corev1.SecretReference) (*ResolvedDevboxImage, error)
}
DevboxImageResolver resolves an image reference to a digest and reads its config.
type DevboxProbeClient ¶ added in v0.6.76
type DevboxProbeClient interface {
// Request creates the probe request for a revision if it doesn't exist yet.
Request(ctx context.Context, req DevboxProbeRequest) error
// Result returns nil until the probe finished.
Result(ctx context.Context, runner string, revision int64) (*DevboxProbeResult, error)
// ReleaseToken drops the probe token of a finished revision, keeping its result.
ReleaseToken(ctx context.Context, runner string, revision int64) error
// Cleanup deletes the request, token and result of a revision.
Cleanup(ctx context.Context, runner string, revision int64) error
}
DevboxProbeClient hands a golden tag to whoever runs the agent probe and collects the result.
type DevboxProbeEvaluation ¶ added in v0.6.76
func EvaluateDevboxProbe ¶ added in v0.6.76
func EvaluateDevboxProbe(runner *v1alpha1.DevboxRunner, result *DevboxProbeResult) DevboxProbeEvaluation
EvaluateDevboxProbe checks the probe result against the declared agents.
func (DevboxProbeEvaluation) Message ¶ added in v0.6.76
func (e DevboxProbeEvaluation) Message() string
func (DevboxProbeEvaluation) OK ¶ added in v0.6.76
func (e DevboxProbeEvaluation) OK() bool
type DevboxProbeRequest ¶ added in v0.6.76
type DevboxProbeRequest struct {
probe.Request `json:",inline"`
// Agents are the declared agents; Probe carries the same as a ProbeAgentsRequest.
Agents []DevboxGuestAgentSpec `json:"agents"`
}
type DevboxProbeResult ¶ added in v0.6.76
type DevboxProbeResult struct {
Response *devboxv1.ProbeAgentsResponse
// Error is set when the probe could not run at all.
Error string
}
type DevboxProbeTokenMinter ¶ added in v0.6.76
type DevboxProbeTokenMinter interface {
MintDevboxProbeToken(ctx context.Context, devboxID string) (probe.Token, error)
}
DevboxProbeTokenMinter mints the box-scoped AI proxy token the probe runs with (console's mintDevboxProbeToken).
type DevboxRunnerGuestConfig ¶ added in v0.6.76
type DevboxRunnerGuestConfig struct {
Runner string `json:"runner"`
BootstrapScript string `json:"bootstrapScript,omitempty"`
Mise string `json:"mise,omitempty"`
Browser bool `json:"browser"`
Agents []DevboxGuestAgentSpec `json:"agents"`
}
DevboxRunnerGuestConfig is DEVBOX_RUNNER_CONFIG, the part of the runner spec the daemon applies inside the guest during the golden boot. Everything else (allowlist, identities, idle policy) is enforced by the gateway and console, so changing it does not roll a new template revision.
type DevboxRunnerReconciler ¶ added in v0.6.76
type DevboxRunnerReconciler struct {
client.Client
// APIReader reads ConfigMaps uncached, so the operator doesn't cache every ConfigMap in the cluster.
APIReader client.Reader
Scheme *runtime.Scheme
Config DevboxConfig
Console DevboxConsoleClient
Substrate SubstrateClients
Images DevboxImageResolver
Probe DevboxProbeClient
CacheSyncTimeout time.Duration
// WatchWorkerPools adds an Owns watch on WorkerPools; only possible when the Substrate CRDs are installed.
WatchWorkerPools bool
// contains filtered or unexported fields
}
DevboxRunnerReconciler reconciles a DevboxRunner: it resolves and checks the image, keeps the Substrate WorkerPool, atespace and ActorTemplate revisions in sync with the spec, hands golden tags to the gateway for the agent probe, upserts the Devbox (with the probed catalog) to console, and runs the per-cluster gateway.
func (*DevboxRunnerReconciler) SetupWithManager ¶ added in v0.6.76
func (r *DevboxRunnerReconciler) SetupWithManager(mgr ctrl.Manager) error
type EKSCloudProvider ¶
type EKSCloudProvider struct {
// contains filtered or unexported fields
}
func (*EKSCloudProvider) UpgradeInsights ¶
func (in *EKSCloudProvider) UpgradeInsights(ctx context.Context, ui v1alpha1.UpgradeInsights) ([]console.UpgradeInsightAttributes, []console.CloudAddonAttributes, error)
type GraphQLDevboxConsoleClient ¶ added in v0.6.76
type GraphQLDevboxConsoleClient struct {
// contains filtered or unexported fields
}
GraphQLDevboxConsoleClient implements DevboxConsoleClient with the generated go/client operations, authenticated with the cluster deploy token.
func NewGraphQLDevboxConsoleClient ¶ added in v0.6.76
func NewGraphQLDevboxConsoleClient(consoleURL, deployToken string) *GraphQLDevboxConsoleClient
func (*GraphQLDevboxConsoleClient) DeleteDevbox ¶ added in v0.6.76
func (c *GraphQLDevboxConsoleClient) DeleteDevbox(ctx context.Context, id string) error
func (*GraphQLDevboxConsoleClient) GetDevboxByName ¶ added in v0.6.76
func (c *GraphQLDevboxConsoleClient) GetDevboxByName(ctx context.Context, name string) (*console.DevboxFragment, error)
func (*GraphQLDevboxConsoleClient) HeartbeatDevbox ¶ added in v0.6.76
func (c *GraphQLDevboxConsoleClient) HeartbeatDevbox(ctx context.Context, id string, attrs console.DevboxHeartbeatAttributes) error
func (*GraphQLDevboxConsoleClient) MintDevboxProbeToken ¶ added in v0.6.76
func (*GraphQLDevboxConsoleClient) UpsertDevbox ¶ added in v0.6.76
func (c *GraphQLDevboxConsoleClient) UpsertDevbox(ctx context.Context, attrs console.DevboxAttributes) (*console.DevboxFragment, error)
type HelmReleaseReconciler ¶
type HelmReleaseReconciler struct {
client.Client
Scheme *runtime.Scheme
ClientSet kubernetes.Interface
}
func (*HelmReleaseReconciler) Reconcile ¶
func (r *HelmReleaseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile executes the drain logic once per HelmRelease object
func (*HelmReleaseReconciler) SetupWithManager ¶
func (r *HelmReleaseReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the controller
type ImageWarmerReconciler ¶ added in v0.6.67
ImageWarmerReconciler reconciles an ImageWarmer object.
func (*ImageWarmerReconciler) SetupWithManager ¶ added in v0.6.67
func (r *ImageWarmerReconciler) SetupWithManager(mgr ctrl.Manager) error
type IngressReplicaReconciler ¶
IngressReplicaReconciler reconciles a IngressReplica resource.
func (*IngressReplicaReconciler) Reconcile ¶
func (r *IngressReplicaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
Reconcile IngressReplica ensure that stays in sync with Kubernetes cluster.
func (*IngressReplicaReconciler) SetupWithManager ¶
func (r *IngressReplicaReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type K8sObjectIdentifier ¶
type K8sObjectIdentifier struct {
GVK schema.GroupVersionKind // Group, Version, Kind
Namespace string // Namespace (empty for cluster-scoped objects)
Name string // Name
}
func (K8sObjectIdentifier) String ¶
func (gvk K8sObjectIdentifier) String() string
type KubecostExtractorReconciler ¶
type KubecostExtractorReconciler struct {
client.Client
Scheme *runtime.Scheme
KubeClient kubernetes.Interface
ExtConsoleClient consoleclient.Client
Tasks cmap.ConcurrentMap[string, context.CancelFunc]
ServiceIDCache *ServiceIDCache
Proxy bool
}
KubecostExtractorReconciler reconciles a KubecostExtractor object
func (*KubecostExtractorReconciler) Reconcile ¶
func (r *KubecostExtractorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (*KubecostExtractorReconciler) RunOnInterval ¶
func (r *KubecostExtractorReconciler) RunOnInterval(ctx context.Context, key string, interval time.Duration, condition wait.ConditionWithContextFunc)
func (*KubecostExtractorReconciler) SetupWithManager ¶
func (r *KubecostExtractorReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MetricsAggregateReconciler ¶
type MetricsAggregateReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
DiscoveryCache discoverycache.Cache
}
MetricsAggregateReconciler reconciles a MetricsAggregate resource.
func (*MetricsAggregateReconciler) Reconcile ¶
func (r *MetricsAggregateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, reterr error)
Reconcile IngressReplica ensure that stays in sync with Kubernetes cluster.
func (*MetricsAggregateReconciler) SetupWithManager ¶
SetupWithManager sets up the controller with the Manager.
type PipelineGateReconciler ¶
type PipelineGateReconciler struct {
runtimeclient.Client
ConsoleClient consoleclient.Client
Scheme *runtime.Scheme
GateCache *cache.Cache[console.PipelineGateFragment]
}
PipelineGateReconciler reconciles a PipelineGate object
func (*PipelineGateReconciler) SetupWithManager ¶
func (r *PipelineGateReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type PluralCAPIClusterController ¶
type PluralCAPIClusterController struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleUrl string
UserGroupCache cache.UserGroupCache
// contains filtered or unexported fields
}
func (*PluralCAPIClusterController) SetupWithManager ¶
func (in *PluralCAPIClusterController) SetupWithManager(mgr ctrl.Manager) error
type RegistryImageResolver ¶ added in v0.6.76
type RegistryImageResolver struct {
Client client.Client
// SecretNamespace is used for pull secrets without a namespace.
SecretNamespace string
// Platform selects the config of multi-platform images, defaults to linux/amd64.
Platform *v1.Platform
// Options are extra remote options, e.g. a transport in tests.
Options []remote.Option
// contains filtered or unexported fields
}
RegistryImageResolver resolves through the registry with cloud workload-identity keychains (ECR, Artifact Registry/GCR, ACR) plus the runner's imagePullSecrets.
func (*RegistryImageResolver) Resolve ¶ added in v0.6.76
func (r *RegistryImageResolver) Resolve(ctx context.Context, image string, pullSecrets []corev1.SecretReference) (*ResolvedDevboxImage, error)
type ResolvedDevboxImage ¶ added in v0.6.76
type ResolvedDevboxImage struct {
// Reference is <repository>@<digest>; the digest is the index digest for multi-platform images.
Reference string
Digest string
Labels map[string]string
Entrypoint []string
User string
Env map[string]string
}
ResolvedDevboxImage is spec.image pinned by digest, plus the config fields the image contract checks.
type ResourceRequests ¶
type RestoreReconciler ¶
type RestoreReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleClient client.Client
}
RestoreReconciler reconciles a Velero Restore custom resource.
func (*RestoreReconciler) Reconcile ¶
Reconcile Velero Restore custom resources to ensure that Console stays in sync with Kubernetes cluster.
func (*RestoreReconciler) SetupWithManager ¶
func (r *RestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type SentinelRunJobReconciler ¶
type SentinelRunJobReconciler struct {
client.Client
ConsoleClient consoleclient.Client
Scheme *runtime.Scheme
ConsoleURL string
DeployToken string
}
func (*SentinelRunJobReconciler) GenerateRunJob ¶
func (r *SentinelRunJobReconciler) GenerateRunJob(run *console.SentinelRunJobFragment, jobSpec *batchv1.JobSpec, name, namespace string) (*batchv1.Job, error)
func (*SentinelRunJobReconciler) GetRunResourceName ¶
func (r *SentinelRunJobReconciler) GetRunResourceName(run *console.SentinelRunJobFragment) string
GetRunResourceName returns a resource name used for a job and a secret connected to a given run.
func (*SentinelRunJobReconciler) SetupWithManager ¶
func (r *SentinelRunJobReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager configures the controller with the manager.
type ServiceIDCache ¶
type ServiceIDCache struct {
// contains filtered or unexported fields
}
func NewServiceIDCache ¶
func NewServiceIDCache(clearAfter time.Duration) *ServiceIDCache
NewServiceIDCache self-cleaning cache
func (*ServiceIDCache) Get ¶
func (c *ServiceIDCache) Get(key K8sObjectIdentifier) (string, bool)
func (*ServiceIDCache) Set ¶
func (c *ServiceIDCache) Set(key K8sObjectIdentifier, value string)
type SetupWithManager ¶
type StackRunJobReconciler ¶
type StackRunJobReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleClient client.Client
ConsoleURL string
DeployToken string
}
StackRunJobReconciler reconciles a Job resource.
func (*StackRunJobReconciler) GenerateRunJob ¶
func (r *StackRunJobReconciler) GenerateRunJob(run *console.StackRunMinimalFragment, jobSpec *batchv1.JobSpec, name, namespace string) (*batchv1.Job, error)
func (*StackRunJobReconciler) GetRunResourceName ¶
func (r *StackRunJobReconciler) GetRunResourceName(run *console.StackRunMinimalFragment) string
GetRunResourceName returns a resource name used for a job and a secret connected to a given run.
func (*StackRunJobReconciler) Reconcile ¶
func (r *StackRunJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ reconcile.Result, retErr error)
Reconcile StackRun's Job ensure that Console stays in sync with Kubernetes cluster.
func (*StackRunJobReconciler) SetupWithManager ¶
func (r *StackRunJobReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type StatusViolation ¶
type SubstrateClients ¶ added in v0.6.76
type SubstrateClients interface {
For(ctx context.Context, runner *v1alpha1.DevboxRunner) (substrate.API, error)
}
SubstrateClients hands out the Substrate API client a runner is reconciled with.
type UpgradeInsightsController ¶
type UpgradeInsightsController struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleClient client.Client
// contains filtered or unexported fields
}
UpgradeInsightsController reconciler a v1alpha1.UpgradeInsights resource. Implements reconcile.Reconciler interface.
func (*UpgradeInsightsController) SetupWithManager ¶
func (in *UpgradeInsightsController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type VirtualClusterController ¶
type VirtualClusterController struct {
k8sClient.Client
Scheme *runtime.Scheme
ExtConsoleClient client.Client
ConsoleUrl string
UserGroupCache cache.UserGroupCache
// contains filtered or unexported fields
}
VirtualClusterController reconciler a v1alpha1.VirtualCluster resource. Implements reconcile.Reconciler interface.
func (*VirtualClusterController) SetupWithManager ¶
func (in *VirtualClusterController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type VulnerabilityReportReconciler ¶
type VulnerabilityReportReconciler struct {
k8sClient.Client
Scheme *runtime.Scheme
ConsoleClient client.Client
Ctx context.Context
// contains filtered or unexported fields
}
VulnerabilityReportReconciler reconciles a Trivy VulnerabilityReport resource.
func (*VulnerabilityReportReconciler) SetupWithManager ¶
func (r *VulnerabilityReportReconciler) SetupWithManager(mgr ctrl.Manager) error
Source Files
¶
- agentconfiguration_controller.go
- agentrun_controller.go
- agentrun_pod.go
- agentruntime_controller.go
- argorollout_controller.go
- backup_controller.go
- clusterdrain_controller.go
- common.go
- configuration_fetcher.go
- constraint_controller.go
- crd_controller.go
- customhealth_controller.go
- custominsightpriority_controller.go
- debounce_controller.go
- devboxrunner_autoscale.go
- devboxrunner_capacity.go
- devboxrunner_config.go
- devboxrunner_console.go
- devboxrunner_controller.go
- devboxrunner_env.go
- devboxrunner_gateway.go
- devboxrunner_image.go
- devboxrunner_probe.go
- devboxrunner_substrate.go
- devboxrunner_substrate_client.go
- helmrelease_controller.go
- imagewarmer_controller.go
- ingressreplica_controller.go
- kubecostextractor_controller.go
- mcp.go
- metricsaggregate.go
- pipelinegate_controller.go
- pluralcapicluster_controller.go
- requeue.go
- restore_controller.go
- scope.go
- sentinelrunjob_controller.go
- sentinelrunjob_errors.go
- sentinelrunjob_job.go
- sentinelrunjob_secret.go
- stackrunjob_controller.go
- stackrunjob_job.go
- stackrunjob_secret.go
- upgradeinsights_cloudprovider.go
- upgradeinsights_controller.go
- virtualcluster_controller.go
- virtualcluster_helm.go
- vulnerabilityreports_controller.go