Cordium documentation · Latest
Cluster Configuration
The ClusterConfig is the single source of truth for the Cluster-wide configuration of Cordium. It controls which Users can own Spaces, how Workspace and Volume storage is provisioned, the default and maximum resources and quotas, the inactivity timeouts, the Cluster-wide Linux capabilities and the Cordium Agent. There is exactly one ClusterConfig per Cluster. It is created automatically at installation time and it can only be read and updated by the Cluster administrators (read more here).
Applying the Configuration
You can get the current ClusterConfig as follows:
And you can apply a new configuration from a file, a directory, or stdin as follows:
The file must contain a resource with kind: ClusterConfig. Here is a minimal example:
Applying a ClusterConfig replaces its entire spec, which means that any section that is omitted from the applied file is reset to its default. Always start from your current configuration via cordium man get cc -o yaml, modify it and apply the result. Keeping the ClusterConfig in version control and applying it from your CI is the recommended way to manage it.
Space Ownership
The spec.space.ownership field controls which Users are allowed to create (i.e. own) Spaces. It contains a list of rules, each with an effect (ALLOW or DENY) and a condition that is evaluated against the requesting User (i.e. ctx.user) and the Space being created (i.e. ctx.space). The DENY rules are evaluated first. If none of them matches, the ALLOW rules are evaluated, and if none of them matches either, the request is denied.
If ownership is not set, no User can create Spaces. Every User still gets their automatically created default Space. Here is an example that lets every User create personal USER Spaces, while only the members of the platform Group can create ORGANIZATION Spaces, and contractors cannot create Spaces at all:
The conditions have exactly the same syntax as the conditions of Octelium Policies (i.e. match, matchAny, all, any, none, not and opa) (read more here).
Storage
The spec.workspace.storage field selects the Kubernetes StorageClass of the Workspaces' storage and the VolumeSnapshotClass of their snapshots via rules that are evaluated in order. The first matching rule wins. If no rule matches, the default StorageClass of the Kubernetes cluster and the default VolumeSnapshotClass of the CSI driver are used. Here is an example:
The storageClass rules are evaluated against the Workspace (i.e. ctx.workspace), while the volumeSnapshotClass rules are evaluated against the Workspace (i.e. ctx.workspace) and, for Template pre-builds, its Template (i.e. ctx.template).
Similarly, the spec.volume.storage.storageClass rules select the StorageClass of Volumes, and they are evaluated against the Volume (i.e. ctx.volume). This is how you route ACCESS_MODE_SHARED Volumes to a multi-writer storage backend:
You can read more about choosing and configuring storage backends here.
Limits
The spec.workspace.limit field defines the Cluster-wide compute resources and quotas of Workspaces. All the fields are optional. Here is an example:
The default limits only fill the fields that are not set by the Workspace, its Template or its Space, while the maximum limit caps the result (read more here). Without any configuration, Workspaces and pre-builds get 2 cores, 6000 MB of memory and 20000 MB of storage.
The spec.volume.limit field defines the limits of Volumes:
Timeout
The spec.workspace.timeout field defines the inactivity timeouts after which running Workspaces are automatically stopped (read more here). The timeout of a Workspace is the duration for its Space type if it is set, otherwise defaultDuration, otherwise 30 hours. Here is an example:
Runtime
The spec.workspace.runtime.capabilities field adds or drops Linux capabilities for all the Workspaces of the Cluster. They are merged with the capabilities of the Spaces and the Workspaces (read more here):
Agent
The spec.agent field configures the Cordium Agent for all the Users of the Cluster: whether it is enabled, its default Octelium LLM Service and model, its version, image, resources, and any additional agent configuration. Here is an example:
You can read the complete reference of the agent section here.