-
Notifications
You must be signed in to change notification settings - Fork 1.1k
runtimeVM: Allow the admin to specify the path of the runtime configuration file #5035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtimeVM: Allow the admin to specify the path of the runtime configuration file #5035
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fidencio The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cc @littlejawa and @fgiudici for giving it a try, as it's very much kata-containers specific. |
5971aed to
1dbd286
Compare
|
/hold till I get the unit tests running as planned |
1dbd286 to
4cf7305
Compare
|
/unhold |
Codecov Report
@@ Coverage Diff @@
## master #5035 +/- ##
=======================================
Coverage 41.67% 41.67%
=======================================
Files 108 108
Lines 10169 10195 +26
=======================================
+ Hits 4238 4249 +11
- Misses 5482 5496 +14
- Partials 449 450 +1 |
|
/retest |
|
LGTM |
4cf7305 to
6b48e65
Compare
|
I will need to rebase mine after #5054 gets merged and while reviewing @littlejawa's work I've noticed that I missed adding the runtime config path option to the helpers.bash. |
6b48e65 to
6cb6e2f
Compare
|
@haircommander, this one is rebased/ |
`runtime_config_path` is a "VM" runtime type specific entry, which allows the admin to set an arbitrary configuration file to be used to spawn a container runtime. This will help to simplify how kata-deploy currently sets different configuration files for kata-containers*, and also give us the ability to easily provide any special configuration to a customer or so. *: In case you're interested, it's currently done by a shell script wrapping the call to the containerd-shim-v2, setting the configuration file via an environment variable. Definitely not the best case scenario. Signed-off-by: Fabiano Fidêncio <[email protected]>
Now that admins have a way to specify a runtime_config_path for a runtime, let's honor this information as pass it down to the containerd-shim-v2 binary as part of the CreateTask request. Here you can see what's the current behaviour, without this patch: ``` [fidencio@crio ~]$ kubectl get pods No resources found in default namespace. [fidencio@crio ~]$ cat /etc/crio/crio.conf.d/99-runtimes [crio.runtime.runtimes.kata] runtime_path = "/usr/local/bin/containerd-shim-kata-v2" runtime_root = "/run/vc" runtime_type = "vm" privileged_without_host_devices = true [fidencio@crio ~]$ kubectl apply -f ~/simple.yaml pod/simple created [fidencio@crio ~]$ kubectl describe pod simple Name: simple Namespace: default ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 8s default-scheduler Successfully assigned default/simple to crio Warning FailedCreatePodSandBox 8s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = CreateContainer failed: Cannot find usable config file (config file "/etc/kata-containers/configuration.toml" unresolvable: file /etc/kata-containers/configuration.toml does not exist, config file "/usr/share/defaults/kata-containers/configuration.toml" unresolvable: file /usr/share/defaults/kata-containers/configuration.toml does not exist): not found ``` And the changes with this patch applied: ``` [fidencio@crio ~]$ kubectl get pods No resources found in default namespace. [fidencio@crio ~]$ cat /etc/crio/crio.conf.d/99-runtimes [crio.runtime.runtimes.kata] runtime_path = "/usr/local/bin/containerd-shim-kata-v2" runtime_root = "/run/vc" runtime_type = "vm" privileged_without_host_devices = true runtime_config_path = "/tmp/config.toml" [fidencio@crio ~]$ kubectl apply -f ~/simple.yaml pod/simple created [fidencio@crio ~]$ kubectl describe pod Name: simple Namespace: default ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 7s default-scheduler Successfully assigned default/simple to crio Normal Pulling 6s kubelet Pulling image "quay.io/prometheus/busybox:latest" Normal Pulled 4s kubelet Successfully pulled image "quay.io/prometheus/busybox:latest" in 1.990972055s Normal Created 3s kubelet Created container basic Normal Started 3s kubelet Started container basic [fidencio@crio ~]$ kubectl get pods NAME READY STATUS RESTARTS AGE simple 1/1 Running 0 10s ``` Fixes: cri-o#4591 Signed-off-by: Fabiano Fidêncio <[email protected]>
6cb6e2f to
52810ee
Compare
|
Nice feature for kata deployments Fabiano! |
|
@fidencio: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/retest |
|
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds the possibility for the admin to specify the path of the runtime configuration file, when using the VM runtime type.
This will help to simplify how kata-deploy currently sets different configuration files for kata-containers*, and also give us the ability to easily provide any special configuration to a customer or so.
Which issue(s) this PR fixes:
Fixes #4591
Special notes for your reviewer:
Here you can see what's the current behaviour, without this patch:
And the changes with this patch applied:
Does this PR introduce a user-facing change?