Skip to content

Commit fef4ddd

Browse files
author
Eric Ernst
committed
pull in latest from kata packaging repo
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
1 parent 6938b6e commit fef4ddd

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

kata-deploy/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ yum install -y bzip2 jq && \
1111
curl -sOL ${KATA_URL}/${KATA_FILE} && \
1212
mkdir -p /opt/kata-artifacts && \
1313
tar xvf ${KATA_FILE} -C /opt/kata-artifacts/ && \
14+
chown -R root:root /opt/kata-artifacts/ && \
1415
rm ${KATA_FILE}
1516

1617
RUN \

kata-deploy/README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- [Kata deploy](#kata-deploy)
1616
- [Kata cleanup](#kata-cleanup)
1717

18-
[kata-deploy](kata-deploy) provides a Dockerfile, which contains all of the binaries
18+
[kata-deploy](.) provides a Dockerfile, which contains all of the binaries
1919
and artifacts required to run Kata Containers, as well as reference daemonsets, which can
2020
be utilized to install Kata Containers for both Docker and on a running Kubernetes cluster.
2121

@@ -80,6 +80,29 @@ Workloads which utilize Kata can node-select based on ```katacontainers.io/kata-
8080
run through an applicable runtime if they are marked with the appropriate runtimeClass annotation.
8181

8282

83+
In order to use a workload Kata with QEMU, first add a `RuntimeClass` as:
84+
- For k8s 1.14:
85+
```
86+
kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.14/kata-qemu-runtimeClass.yaml
87+
```
88+
89+
- For k8s 1.13:
90+
```
91+
kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.13/kata-qemu-runtimeClass.yaml
92+
```
93+
94+
95+
In order to use a workload Kata with Firecracker, first add a `RuntimeClass` as:
96+
- For k8s 1.14:
97+
```
98+
kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.14/kata-fc-runtimeClass.yaml
99+
```
100+
101+
- For k8s 1.13:
102+
```
103+
kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.13/kata-fc-runtimeClass.yaml
104+
```
105+
83106
The following YAML snippet shows how to specify a workload should use Kata with QEMU:
84107
```
85108
spec:
@@ -96,7 +119,6 @@ spec:
96119
runtimeClassName: kata-fc
97120
```
98121

99-
100122
To run an example with kata-qemu:
101123

102124
```
@@ -128,7 +150,7 @@ kubectl delete -f kata-rbac.yaml
128150

129151
### Dockerfile
130152

131-
The [Dockerfile](kata-deploy/Dockerfile) used to create the container image deployed in the DaemonSet is provided here.
153+
The [Dockerfile](Dockerfile) used to create the container image deployed in the DaemonSet is provided here.
132154
This image contains all the necessary artifacts for running Kata Containers, all of which are pulled
133155
from the [Kata Containers release page](https://github.com/kata-containers/runtime/releases).
134156

kata-deploy/action/trigger

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=1.7.0-alpha1
1+
VERSION=1.5.4
22
git tag --delete $VERSION
33
git push origin :$VERSION
44
git tag -a $VERSION -m "test tag - $VERSION" && git push origin $VERSION

kata-deploy/scripts/kata-deploy-docker.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ function configure_docker() {
3939
"kata-qemu": {
4040
"path": "/opt/kata/bin/kata-runtime",
4141
"runtimeArgs": [ "--kata-config", "/opt/kata/share/defaults/kata-containers/configuration-qemu.toml" ]
42+
},
43+
"kata-nemu": {
44+
"path": "/opt/kata/bin/kata-runtime",
45+
"runtimeArgs": [ "--kata-config", "/opt/kata/share/defaults/kata-containers/configuration-nemu.toml" ]
4246
},
4347
"kata-fc": {
4448
"path": "/opt/kata/bin/kata-runtime",

kata-deploy/scripts/kata-deploy.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ function configure_crio() {
6262
cp -n "$crio_conf_file" "$crio_conf_file_backup"
6363

6464
local kata_qemu_path="/opt/kata/bin/kata-qemu"
65+
local kata_nemu_path="/opt/kata/bin/kata-nemu"
6566
local kata_fc_path="/opt/kata/bin/kata-fc"
6667
local kata_qemu_conf="crio.runtime.runtimes.kata-qemu"
68+
local kata_qemu_conf="crio.runtime.runtimes.kata-nemu"
6769
local kata_fc_conf="crio.runtime.runtimes.kata-fc"
6870

71+
# add kata-qemu config
6972
if grep -q "^\[$kata_qemu_conf\]" $crio_conf_file; then
7073
echo "Configuration exists $kata_qemu_conf, overwriting"
7174
sed -i "/^\[$kata_qemu_conf\]/,+1s#runtime_path.*#runtime_path = \"${kata_qemu_path}\"#" $crio_conf_file
@@ -78,6 +81,20 @@ function configure_crio() {
7881
EOT
7982
fi
8083

84+
# add kata-nemu config
85+
if grep -q "^\[$kata_nemu_conf\]" $crio_conf_file; then
86+
echo "Configuration exists $kata_nemu_conf, overwriting"
87+
sed -i "/^\[$kata_nemu_conf\]/,+1s#runtime_path.*#runtime_path = \"${kata_nemu_path}\"#" $crio_conf_file
88+
else
89+
cat <<EOT | tee -a "$crio_conf_file"
90+
91+
# Path to the Kata Containers runtime binary that uses the NEMU hypervisor.
92+
[$kata_nemu_conf]
93+
runtime_path = "${kata_nemu_path}"
94+
EOT
95+
fi
96+
97+
# add kata-fc config
8198
if grep -q "^\[$kata_fc_conf\]" $crio_conf_file; then
8299
echo "Configuration exists for $kata_fc_conf, overwriting"
83100
sed -i "/^\[$kata_fc_conf\]/,+1s#runtime_path.*#runtime_path = \"${kata_fc_path}\"#" $crio_conf_file
@@ -180,6 +197,7 @@ function reset_runtime() {
180197
kubectl label node $NODE_NAME katacontainers.io/kata-runtime-
181198
systemctl daemon-reload
182199
systemctl restart $1
200+
systemctl restart kubelet
183201
}
184202

185203
function main() {
@@ -210,7 +228,7 @@ function main() {
210228

211229
install_artifacts
212230
configure_cri_runtime $runtime
213-
kubectl label node $NODE_NAME katacontainers.io/kata-runtime=true
231+
kubectl label node $NODE_NAME --overwrite katacontainers.io/kata-runtime=true
214232
;;
215233
cleanup)
216234
cleanup_cri_runtime $runtime

0 commit comments

Comments
 (0)