chore: add current provisioning state before migration
This commit is contained in:
parent
a9703b4748
commit
50745b0f22
660 changed files with 88126 additions and 0 deletions
3
taskservs/crio/default/crictl.yaml
Normal file
3
taskservs/crio/default/crictl.yaml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
runtime-endpoint: "unix:///var/run/crio/crio.sock"
|
||||
timeout: 0
|
||||
debug: false
|
||||
34
taskservs/crio/default/crio.conf.j2
Normal file
34
taskservs/crio/default/crio.conf.j2
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[crio.image]
|
||||
signature_policy = "/etc/crio/policy.json"
|
||||
|
||||
[crio.runtime]
|
||||
{% if taskserv.default_runtime -%}
|
||||
default_runtime = "{{taskserv.default_runtime}}"
|
||||
{% else -%}
|
||||
default_runtime = "crun"
|
||||
{% endif -%}
|
||||
|
||||
{% if taskserv.runtimes is containing("crun") -%}
|
||||
[crio.runtime.runtimes.crun]
|
||||
runtime_path = "/usr/local/bin/crio-crun"
|
||||
monitor_path = "/usr/local/bin/crio-conmon"
|
||||
allowed_annotations = [
|
||||
"io.containers.trace-syscall",
|
||||
]
|
||||
{% endif -%}
|
||||
|
||||
{% if taskserv.runtimes is containing("runc") -%}
|
||||
[crio.runtime.runtimes.runc]
|
||||
runtime_path = "/usr/local/bin/crio-runc"
|
||||
monitor_path = "/usr/local/bin/crio-conmon"
|
||||
{% endif -%}
|
||||
|
||||
{% if taskserv.runtimes is containing("youki") -%}
|
||||
[crio.runtime.runtimes.youki]
|
||||
runtime_path = "/usr/local/bin/youki"
|
||||
monitor_path = "/usr/local/bin/crio-conmon"
|
||||
runtime_type ="oci"
|
||||
runtime_root = "/run/youki"
|
||||
cgroup_manager = "cgroupfs"
|
||||
conmon_cgroup = "pod"
|
||||
{% endif -%}
|
||||
2
taskservs/crio/default/env-crio.j2
Normal file
2
taskservs/crio/default/env-crio.j2
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
CRIO_VERSION="{{taskserv.version}}"
|
||||
CRI_SOCKET="unix:///var/run/crio/crio.sock"
|
||||
140
taskservs/crio/default/install-crio.sh
Executable file
140
taskservs/crio/default/install-crio.sh
Executable file
|
|
@ -0,0 +1,140 @@
|
|||
#!/bin/bash
|
||||
# Info: Script to install/create/delete/update crio from file settings
|
||||
# Author: JesusPerezLorenzo
|
||||
# Release: 1.0
|
||||
# Date: 12-10-2024
|
||||
|
||||
USAGE="install-crio.sh install | update | remvoe"
|
||||
[ "$1" == "-h" ] && echo "$USAGE" && exit 1
|
||||
|
||||
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')"
|
||||
OS="$(uname | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
[ -r "env-crio" ] && . ./env-crio
|
||||
|
||||
CRIO_VERSION="${CRIO_VERSION:-1.28.1}"
|
||||
#CRIO_URL=https://raw.githubusercontent.com/cri-o/cri-o/master/scripts/get
|
||||
CRIO_URL=https://storage.googleapis.com/cri-o/artifacts/cri-o.${ARCH}.v$CRIO_VERSION.tar.gz
|
||||
|
||||
CRICTL_VERSION="${CRICTL_VERSION:-1.28.0}"
|
||||
CRICTL_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/"
|
||||
|
||||
CRIO_SYSTEMCTL_MODE=enabled
|
||||
|
||||
CMD_TSKSRVC=${1:-install}
|
||||
|
||||
export LC_CTYPE=C.UTF-8
|
||||
export LANG=C.UTF-8
|
||||
|
||||
ORG=$(pwd)
|
||||
|
||||
_clean_others() {
|
||||
[ -d "/etc/cni" ] && sudo rm -r /etc/cni
|
||||
[ -d "/var/lib/containers" ] && sudo rm -r /var/lib/containers
|
||||
sudo rm -f /etc/systemd/system/podman* 2>/dev/null
|
||||
}
|
||||
_init() {
|
||||
[ -z "$CRIO_VERSION" ] && exit 1 # || [ -z "$CRIO_ARCH" ] || [ -z "$CRIO_URL" ] || [ -z "$CRIO_FILE" ] && exit 1
|
||||
local curr_vers
|
||||
local has_crio
|
||||
has_crio=$(type crio 2>/dev/null)
|
||||
if [ -n "$has_crio" ] ; then
|
||||
curr_vers=$(crio --version | grep "^Version" | awk '{print $2}')
|
||||
else
|
||||
_clean_others
|
||||
fi
|
||||
if [ "$curr_vers" != "$CRIO_VERSION" ] ; then
|
||||
if ! curl -fsSL "$CRIO_URL" -o /tmp/crio.tar.gz ; then
|
||||
echo "error downloading crio "
|
||||
return 1
|
||||
fi
|
||||
tar xzf /tmp/crio.tar.gz
|
||||
if [ -r "cri-o/install" ] ; then
|
||||
cd cri-o || exit 1
|
||||
[ -n "$has_crio" ] && sudo timeout -k 10 20 systemctl stop crio
|
||||
sudo bash ./install
|
||||
cd "$ORG" || exit 1
|
||||
else
|
||||
echo "error installing crio"
|
||||
ret=1
|
||||
fi
|
||||
rm -fr cri-o
|
||||
rm -f /tmp/crio_installer.sh
|
||||
[ "$ret" == 1 ] && return 1
|
||||
fi
|
||||
curr_vers=$(crictl --version | awk '{print $3}' | sed 's/v//g')
|
||||
if [ "$curr_vers" != "$CRICTL_VERSION" ] ; then
|
||||
if ! curl -fsSL "${CRICTL_URL}/v${CRICTL_VERSION}/crictl-v${CRICTL_VERSION}-${OS}-${ARCH}.tar.gz" -o /tmp/crictl.tar.gz ; then
|
||||
echo "error downloading crictl installer"
|
||||
return 1
|
||||
fi
|
||||
tar xzf /tmp/crictl.tar.gz
|
||||
if [ -r "crictl" ] ; then
|
||||
chmod +x crictl
|
||||
sudo mv crictl /usr/local/bin
|
||||
fi
|
||||
rm -f /tmp/crictl.tar.gz
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
_config_crio() {
|
||||
[ ! -d "/etc/crio" ] && mkdir -p /etc/crio
|
||||
if [ -r "crio_config.toml" ] && [ ! -r "/etc/crio/config.toml" ] ; then
|
||||
sudo cp crio_config.toml /etc/crio/config.toml
|
||||
fi
|
||||
if [ -r "crio.conf" ] && [ -d "/etc/crio/crio.conf.d" ] ; then
|
||||
sudo cp crio.conf /etc/crio/crio.conf.d/10-crio.conf
|
||||
fi
|
||||
[ -r "crio" ] && mkdir -p /etc/crio
|
||||
if [ -r "crictl.yaml" ] && [ ! -r "/etc/crio-crictl.yaml" ] ; then
|
||||
sudo cp crictl.yaml /etc/crio-crictl.yaml
|
||||
sudo cp crictl.yaml /etc/crictl.yaml
|
||||
fi
|
||||
|
||||
if [ -r "crio.service" ] && [ ! -r "/lib/systemd/crio.service" ] ; then
|
||||
sudo cp crio.service /lib/systemd/system
|
||||
[ ! -L "/etc/systemd/system/crio.service" ] && sudo ln -s /lib/systemd/system/crio.service /etc/systemd/system
|
||||
sudo timeout -k 10 20 systemctl daemon-reload
|
||||
fi
|
||||
TARGET=/etc/modules-load.d/crio.conf
|
||||
ITEMS="overlay br_netfilter"
|
||||
for it in $ITEMS
|
||||
do
|
||||
has_item=$(sudo grep ^"$it" $TARGET 2>/dev/null)
|
||||
[ -z "$has_item" ] && echo "$it" | sudo tee -a /etc/modules-load.d/crio.conf
|
||||
done
|
||||
_start_crio
|
||||
}
|
||||
|
||||
_remove_crio() {
|
||||
sudo timeout -k 10 20 systemctl stop crio
|
||||
sudo timeout -k 10 20 systemctl disable crio
|
||||
}
|
||||
|
||||
_start_crio() {
|
||||
if [ "$CRIO_SYSTEMCTL_MODE" == "enabled" ] ; then
|
||||
sudo timeout -k 10 20 systemctl enable crio
|
||||
else
|
||||
sudo timeout -k 10 20 systemctl disable crio
|
||||
fi
|
||||
sudo timeout -k 10 20 systemctl start crio
|
||||
}
|
||||
|
||||
_restart_crio() {
|
||||
sudo timeout -k 10 20 systemctl restart crio
|
||||
}
|
||||
[ "$CMD_TSKSRVC" == "remove" ] && _remove_crio && exit 0
|
||||
if ! _init ; then
|
||||
echo "error crio install"
|
||||
exit 1
|
||||
fi
|
||||
[ "$CMD_TSKSRVC" == "update" ] && _restart_crio && exit 0
|
||||
if ! _config_crio ; then
|
||||
echo "error crio config"
|
||||
exit 1
|
||||
fi
|
||||
if ! _start_crio ; then
|
||||
echo "error crio start"
|
||||
exit 1
|
||||
fi
|
||||
2
taskservs/crio/default/provisioning.toml
Normal file
2
taskservs/crio/default/provisioning.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
info = "crio"
|
||||
release = "1.0"
|
||||
Loading…
Add table
Add a link
Reference in a new issue