From cfdd5153f0b04bfabbcd07534be5f32441bf3e34 Mon Sep 17 00:00:00 2001 From: Enrique Llorente Date: Tue, 7 May 2024 11:36:47 +0200 Subject: [PATCH] dnm: Start ovn-kubernetes kind Signed-off-by: Enrique Llorente --- .../kubevirt/kubevirt-presubmits.yaml | 94 +++++++++++++++++++ hack/pj-on-kind.sh | 26 +++++ 2 files changed, 120 insertions(+) create mode 100755 hack/pj-on-kind.sh diff --git a/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-presubmits.yaml b/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-presubmits.yaml index 007d24e037..b364982f33 100644 --- a/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-presubmits.yaml +++ b/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-presubmits.yaml @@ -176,6 +176,100 @@ presubmits: path: /var/log/audit type: Directory name: audit + - always_run: false + run_before_merge: true + annotations: + fork-per-release: "true" + testgrid-dashboards: kubevirt-presubmits + cluster: kubevirt-prow-workloads + decorate: true + decoration_config: + grace_period: 30m0s + timeout: 4h0m0s + labels: + preset-bazel-unnested: "true" + preset-dind-enabled: "true" + preset-docker-mirror-proxy: "true" + preset-shared-images: "true" + rehearsal.allowed: "true" + max_concurrency: 10 + name: pull-kubevirt-e2e-kind-ovn-k + skip_branches: + - release-\d+\.\d+ + spec: + containers: + - command: + - /usr/local/bin/runner.sh + - /bin/bash + - -exc + - | + sysctl fs.inotify.max_user_watches=1048576 + sysctl fs.inotify.max_user_instances=512 + dnf install -y git which bison openssl + curl -L -O https://go.dev/dl/go1.22.3.linux-amd64.tar.gz + rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.3.linux-amd64.tar.gz + export PATH=$PATH:/usr/local/go/bin + git clone https://github.com/qinqon/ovn-kubernetes -b kubevirt-e2e-ipamclaim + ( + cd ovn-kubernetes + curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.19.0/kind-linux-amd64 + chmod +x ./kind + sudo mv ./kind /usr/local/bin/kind + mtu=$(expr $(cat /sys/class/net/eth0/mtu) - 58) + export KIND_IMAGE=kindest/node + export K8S_VERSION=v1.28.0@sha256:dad5a6238c5e41d7cac405fae3b5eda2ad1de6f1190fa8bfc64ff5bb86173213 + ./contrib/kind.sh --local-kind-registry -mtu $mtu -mne --enable-interconnect --num-workers 2 || true + ) + export KUBECONFIG=~/ovn.conf + export KUBEVIRT_PROVIDER=external + git clone https://github.com/oshoval/kubevirt -b ipam + ( + cd kubevirt + make cluster-sync + kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch '{"spec":{"configuration":{"developerConfiguration":{"featureGates":["PersistentIPs"]}}}}' + kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/ipamclaims/v0.4.0-alpha/artifacts/k8s.cni.cncf.io_ipamclaims.yaml + ) + echo "==== get pod ===" + kubectl get pod -n ovn-kubernetes + echo "==== describe pod ===" + kubectl describe pod -n ovn-kubernetes + echo "==== get event ===" + kubectl get event -n ovn-kubernetes + echo "==== logs ===" + for pod in $(kubectl get pod -n ovn-kubernetes -o name); do + echo "POD: $pod" + kubectl logs -n ovn-kubernetes $pod --all-containers + done + image: quay.io/kubevirtci/bootstrap-legacy:v20220810-a8f2e6c + #image: gcr.io/k8s-staging-test-infra/kubekins-e2e:latest-1.29 + #image: gcr.io/k8s-staging-test-infra/krte:v20240405-14b8bc2f76-experimental + name: "" + resources: + requests: + memory: 29Gi + securityContext: + privileged: true + volumeMounts: + - mountPath: /lib/modules + name: modules + readOnly: true + - mountPath: /sys/fs/cgroup + name: cgroup + - mountPath: /dev/vfio/ + name: vfio + volumes: + - hostPath: + path: /lib/modules + type: Directory + name: modules + - hostPath: + path: /sys/fs/cgroup + type: Directory + name: cgroup + - hostPath: + path: /dev/vfio/ + type: Directory + name: vfio - always_run: false run_before_merge: true annotations: diff --git a/hack/pj-on-kind.sh b/hack/pj-on-kind.sh new file mode 100755 index 0000000000..515c3901b1 --- /dev/null +++ b/hack/pj-on-kind.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Copyright 2019 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Runs sigs.k8s.io/prow/pkg/pj-on-kind.sh with config arguments specific to the prow.k8s.io instance. + +set -o errexit +set -o nounset +set -o pipefail + +root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +export CONFIG_PATH="${root}/github/ci/prow-deploy/files/config.yaml" +export JOB_CONFIG_PATH="${root}/github/ci/prow-deploy/files/jobs" + +bash <(curl -s https://raw.githubusercontent.com/kubernetes-sigs/prow/main/pkg/pj-on-kind.sh) "$@"