Skip to content
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

fix: custom configuration of crio in testing cluster #542

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,13 @@ export KUBEVIRT_VERSION=$(latest_version "kubevirt")
# Latest released CDI version
export CDI_VERSION=$(latest_version "containerized-data-importer")

# switch to faster storage class for widows tests (slower storage class is causing timeouts due
# to not able to copy whole windows disk into cluster)
if [[ ! "$(oc get storageclass | grep -q 'ssd-csi (default)')" ]] && [[ $TARGET =~ windows.* ]]; then
oc annotate storageclass ssd-csi storageclass.kubernetes.io/is-default-class=true --overwrite
oc annotate storageclass standard-csi storageclass.kubernetes.io/is-default-class- --overwrite
fi

oc annotate storageclass ssd-csi storageclass.kubernetes.io/is-default-class=true --overwrite
oc annotate storageclass standard-csi storageclass.kubernetes.io/is-default-class- --overwrite


# Start CPU manager only for templates which require it.
if [[ $TARGET =~ rhel7.* ]] || [[ $TARGET =~ rhel8.* ]] || [[ $TARGET =~ fedora.* ]] || [[ $TARGET =~ windows2.* ]]; then
if [[ $TARGET =~ rhel.* ]] || [[ $TARGET =~ fedora.* ]] || [[ $TARGET =~ windows2.* ]]; then
oc label machineconfigpool worker custom-kubelet=enabled
oc create -f - <<EOF
---
Expand All @@ -102,6 +100,21 @@ EOF
oc wait --for=condition=Updated --timeout=900s machineconfigpool worker
fi

DEBUG_NS=debug-ns
oc create ns ${DEBUG_NS}
oc label ns ${DEBUG_NS} security.openshift.io/scc.podSecurityLabelSync=false --overwrite
oc label ns ${DEBUG_NS} pod-security.kubernetes.io/enforce=privileged --overwrite

NODES=$(oc get nodes -o json | jq -r .items[].metadata.name)

while IFS= read -r node
do
echo "setting device_ownership_from_security_context for ${node}.."
oc debug node/${node} --to-namespace ${DEBUG_NS} -- chroot /host sed -i '/^\[crio\.runtime\]/a device_ownership_from_security_context = true' /etc/crio/crio.conf
echo "restarting crio service on ${node}"
oc debug node/${node} --to-namespace ${DEBUG_NS} -- chroot /host systemctl restart crio
done <<< "${NODES}"

namespace="kubevirt"

_curl() {
Expand Down Expand Up @@ -173,7 +186,7 @@ echo "Deploying CDI"
oc apply -f https://github.com/kubevirt/containerized-data-importer/releases/download/$CDI_VERSION/cdi-operator.yaml
oc apply -f https://github.com/kubevirt/containerized-data-importer/releases/download/$CDI_VERSION/cdi-cr.yaml

oc patch cdi cdi -n cdi --patch '{"spec": {"config": {"dataVolumeTTLSeconds": -1}}}' --type merge
oc patch cdi cdi -n cdi --patch '{"spec":{"config":{"podResourceRequirements": {"limits": {"cpu": "2000m", "memory": "2000M"}, "requests": {"cpu": "600m", "memory": "300M"}}}}}' --type merge

oc wait --for=condition=Available --timeout=${timeout}s CDI/cdi -n cdi

Expand Down
Loading