forked from cerc-io/stack-orchestrator
Add RuntimeClass support for unlimited RLIMIT_MEMLOCK
The previous approach of mounting cri-base.json into kind nodes failed because we didn't tell containerd to use it via containerdConfigPatches. RuntimeClass allows different stacks to have different rlimit profiles, which is essential since kind only supports one cluster per host and multiple stacks share the same cluster. Changes: - Add containerdConfigPatches to kind-config.yml to define runtime handlers - Create RuntimeClass resources after cluster creation - Add runtimeClassName to pod specs based on stack's security settings - Rename cri-base.json to high-memlock-spec.json for clarity - Add get_runtime_class() method to Spec that auto-derives from unlimited-memlock setting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
dd856af2d3
commit
87db167d7f
@@ -153,6 +153,29 @@ class Spec:
|
||||
).lower()
|
||||
)
|
||||
|
||||
def get_runtime_class(self):
|
||||
"""Get runtime class name from spec, or derive from security settings.
|
||||
|
||||
The runtime class determines which containerd runtime handler to use,
|
||||
allowing different pods to have different rlimit profiles (e.g., for
|
||||
unlimited RLIMIT_MEMLOCK).
|
||||
|
||||
Returns:
|
||||
Runtime class name string, or None to use default runtime.
|
||||
"""
|
||||
# Explicit runtime class takes precedence
|
||||
explicit = self.obj.get(constants.security_key, {}).get(
|
||||
constants.runtime_class_key, None
|
||||
)
|
||||
if explicit:
|
||||
return explicit
|
||||
|
||||
# Auto-derive from unlimited-memlock setting
|
||||
if self.get_unlimited_memlock():
|
||||
return constants.high_memlock_runtime
|
||||
|
||||
return None # Use default runtime
|
||||
|
||||
def get_deployment_type(self):
|
||||
return self.obj.get(constants.deploy_to_key)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user