mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 22:53:43 +00:00
kata-deploy: add nemu support
Fixes: #416 Signed-off-by: Eric Ernst <eric.ernst@intel.com>
This commit is contained in:
parent
f13416129c
commit
beea7d9f64
42
kata-deploy/examples/test-deploy-kata-nemu.yaml
Normal file
42
kata-deploy/examples/test-deploy-kata-nemu.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
run: php-apache-kata-nemu
|
||||
name: php-apache-kata-nemu
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
run: php-apache-kata-nemu
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
run: php-apache-kata-nemu
|
||||
spec:
|
||||
runtimeClassName: kata-nemu
|
||||
containers:
|
||||
- image: k8s.gcr.io/hpa-example
|
||||
imagePullPolicy: Always
|
||||
name: php-apache
|
||||
ports:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
restartPolicy: Always
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: php-apache-kata-nemu
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
run: php-apache-kata-nemu
|
||||
sessionAffinity: None
|
||||
type: ClusterIP
|
6
kata-deploy/k8s-1.13/kata-nemu-runtimeClass.yaml
Normal file
6
kata-deploy/k8s-1.13/kata-nemu-runtimeClass.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
kind: RuntimeClass
|
||||
apiVersion: node.k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: kata-nemu
|
||||
handler: kata-nemu
|
6
kata-deploy/k8s-1.14/kata-nemu-runtimeClass.yaml
Normal file
6
kata-deploy/k8s-1.14/kata-nemu-runtimeClass.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
kind: RuntimeClass
|
||||
apiVersion: node.k8s.io/v1beta1
|
||||
metadata:
|
||||
name: kata-nemu
|
||||
handler: kata-nemu
|
@ -39,6 +39,10 @@ function configure_docker() {
|
||||
"kata-qemu": {
|
||||
"path": "/opt/kata/bin/kata-runtime",
|
||||
"runtimeArgs": [ "--kata-config", "/opt/kata/share/defaults/kata-containers/configuration-qemu.toml" ]
|
||||
},
|
||||
"kata-nemu": {
|
||||
"path": "/opt/kata/bin/kata-runtime",
|
||||
"runtimeArgs": [ "--kata-config", "/opt/kata/share/defaults/kata-containers/configuration-nemu.toml" ]
|
||||
},
|
||||
"kata-fc": {
|
||||
"path": "/opt/kata/bin/kata-runtime",
|
||||
|
@ -62,10 +62,13 @@ function configure_crio() {
|
||||
cp -n "$crio_conf_file" "$crio_conf_file_backup"
|
||||
|
||||
local kata_qemu_path="/opt/kata/bin/kata-qemu"
|
||||
local kata_nemu_path="/opt/kata/bin/kata-nemu"
|
||||
local kata_fc_path="/opt/kata/bin/kata-fc"
|
||||
local kata_qemu_conf="crio.runtime.runtimes.kata-qemu"
|
||||
local kata_nemu_conf="crio.runtime.runtimes.kata-nemu"
|
||||
local kata_fc_conf="crio.runtime.runtimes.kata-fc"
|
||||
|
||||
# add kata-qemu config
|
||||
if grep -q "^\[$kata_qemu_conf\]" $crio_conf_file; then
|
||||
echo "Configuration exists $kata_qemu_conf, overwriting"
|
||||
sed -i "/^\[$kata_qemu_conf\]/,+1s#runtime_path.*#runtime_path = \"${kata_qemu_path}\"#" $crio_conf_file
|
||||
@ -78,6 +81,20 @@ function configure_crio() {
|
||||
EOT
|
||||
fi
|
||||
|
||||
# add kata-nemu config
|
||||
if grep -q "^\[$kata_nemu_conf\]" $crio_conf_file; then
|
||||
echo "Configuration exists $kata_nemu_conf, overwriting"
|
||||
sed -i "/^\[$kata_nemu_conf\]/,+1s#runtime_path.*#runtime_path = \"${kata_nemu_path}\"#" $crio_conf_file
|
||||
else
|
||||
cat <<EOT | tee -a "$crio_conf_file"
|
||||
|
||||
# Path to the Kata Containers runtime binary that uses the NEMU hypervisor.
|
||||
[$kata_nemu_conf]
|
||||
runtime_path = "${kata_nemu_path}"
|
||||
EOT
|
||||
fi
|
||||
|
||||
# add kata-fc config
|
||||
if grep -q "^\[$kata_fc_conf\]" $crio_conf_file; then
|
||||
echo "Configuration exists for $kata_fc_conf, overwriting"
|
||||
sed -i "/^\[$kata_fc_conf\]/,+1s#runtime_path.*#runtime_path = \"${kata_fc_path}\"#" $crio_conf_file
|
||||
|
Loading…
Reference in New Issue
Block a user