diff --git a/.github/workflows/docker-build-push-master.yml b/.github/workflows/docker-build-push-master.yml index 9da4b8703..d3ea7a735 100644 --- a/.github/workflows/docker-build-push-master.yml +++ b/.github/workflows/docker-build-push-master.yml @@ -14,40 +14,40 @@ jobs: REPOSITORY: nfvpe/multus REPOSITORY_USER: nfvperobot steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build latest-amd64 - run: docker build -t ${REPOSITORY}:latest-amd64 . - - - name: Build latest-ppc64le - run: docker build -t ${REPOSITORY}:latest-ppc64le -f Dockerfile.ppc64le . - - - name: Build latest-origin - run: docker build -t ${REPOSITORY}:latest-origin -f Dockerfile.openshift . - - - name: Tag snapshot - run: | - docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:snapshot-amd64 - docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:snapshot-ppc64le - - - name: Login to registry - run: docker login -u ${REPOSITORY_USER} -p ${{ secrets. REPOSITORY_PASS }} - - - name: Push latest/snapshot images - run: | - docker push ${REPOSITORY}:latest-amd64 - docker push ${REPOSITORY}:latest-ppc64le - docker push ${REPOSITORY}:snapshot-amd64 - docker push ${REPOSITORY}:snapshot-ppc64le - - - name: Create manifest for multi-arch images - run: | - docker manifest create ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 ${REPOSITORY}:snapshot-ppc64le - docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 --arch amd64 - docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-ppc64le --arch ppc64le - docker manifest push ${REPOSITORY}:snapshot - docker manifest create ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 ${REPOSITORY}:latest-ppc64le - docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 --arch amd64 - docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-ppc64le --arch ppc64le - docker manifest push ${REPOSITORY}:latest + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build latest-amd64 + run: docker build -t ${REPOSITORY}:latest-amd64 . + + - name: Build latest-ppc64le + run: docker build -t ${REPOSITORY}:latest-ppc64le -f Dockerfile.ppc64le . + + - name: Build latest-origin + run: docker build -t ${REPOSITORY}:latest-origin -f Dockerfile.openshift . + + - name: Tag snapshot + run: | + docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:snapshot-amd64 + docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:snapshot-ppc64le + + - name: Login to registry + run: docker login -u ${REPOSITORY_USER} -p ${{ secrets. REPOSITORY_PASS }} + + - name: Push latest/snapshot images + run: | + docker push ${REPOSITORY}:latest-amd64 + docker push ${REPOSITORY}:latest-ppc64le + docker push ${REPOSITORY}:snapshot-amd64 + docker push ${REPOSITORY}:snapshot-ppc64le + + - name: Create manifest for multi-arch images + run: | + docker manifest create ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 ${REPOSITORY}:snapshot-ppc64le + docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 --arch amd64 + docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-ppc64le --arch ppc64le + docker manifest push ${REPOSITORY}:snapshot + docker manifest create ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 ${REPOSITORY}:latest-ppc64le + docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 --arch amd64 + docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-ppc64le --arch ppc64le + docker manifest push ${REPOSITORY}:latest diff --git a/.github/workflows/docker-build-push-release.yml b/.github/workflows/docker-build-push-release.yml index 03ecd4316..bc46ce77b 100644 --- a/.github/workflows/docker-build-push-release.yml +++ b/.github/workflows/docker-build-push-release.yml @@ -14,48 +14,48 @@ jobs: REPOSITORY: nfvpe/multus REPOSITORY_USER: nfvperobot steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build latest-amd64 - run: docker build -t ${REPOSITORY}:latest-amd64 . - - - name: Build latest-ppc64le - run: docker build -t ${REPOSITORY}:latest-ppc64le -f Dockerfile.ppc64le . - - - name: Build latest-origin - run: docker build -t ${REPOSITORY}:latest-origin -f Dockerfile.openshift . - - - name: Tag stable - run: | - docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:stable-amd64 - docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:stable-ppc64le - docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:${GITHUB_REF##*/}-amd64 - docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le - - - name: Login to registry - run: docker login -u ${REPOSITORY_USER} -p ${{ secrets. REPOSITORY_PASS }} - - - name: Push latest/snapshot images - run: | - docker push ${REPOSITORY}:latest-amd64 - docker push ${REPOSITORY}:latest-ppc64le - docker push ${REPOSITORY}:stable-amd64 - docker push ${REPOSITORY}:stable-ppc64le - docker push ${REPOSITORY}:${GITHUB_REF##*/}-amd64 - docker push ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le - - - name: Create manifest for multi-arch images - run: | - docker manifest create ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 ${REPOSITORY}:stable-ppc64le - docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 --arch amd64 - docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-ppc64le --arch ppc64le - docker manifest push ${REPOSITORY}:stable - docker manifest create ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 ${REPOSITORY}:latest-ppc64le - docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 --arch amd64 - docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-ppc64le --arch ppc64le - docker manifest push ${REPOSITORY}:latest - docker manifest create ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-amd64 ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le - docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-amd64 --arch amd64 - docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le --arch ppc64le - docker manifest push ${REPOSITORY}:${GITHUB_REF##*/} + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build latest-amd64 + run: docker build -t ${REPOSITORY}:latest-amd64 . + + - name: Build latest-ppc64le + run: docker build -t ${REPOSITORY}:latest-ppc64le -f Dockerfile.ppc64le . + + - name: Build latest-origin + run: docker build -t ${REPOSITORY}:latest-origin -f Dockerfile.openshift . + + - name: Tag stable + run: | + docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:stable-amd64 + docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:stable-ppc64le + docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:${GITHUB_REF##*/}-amd64 + docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le + + - name: Login to registry + run: docker login -u ${REPOSITORY_USER} -p ${{ secrets. REPOSITORY_PASS }} + + - name: Push latest/snapshot images + run: | + docker push ${REPOSITORY}:latest-amd64 + docker push ${REPOSITORY}:latest-ppc64le + docker push ${REPOSITORY}:stable-amd64 + docker push ${REPOSITORY}:stable-ppc64le + docker push ${REPOSITORY}:${GITHUB_REF##*/}-amd64 + docker push ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le + + - name: Create manifest for multi-arch images + run: | + docker manifest create ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 ${REPOSITORY}:stable-ppc64le + docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 --arch amd64 + docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-ppc64le --arch ppc64le + docker manifest push ${REPOSITORY}:stable + docker manifest create ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 ${REPOSITORY}:latest-ppc64le + docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 --arch amd64 + docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-ppc64le --arch ppc64le + docker manifest push ${REPOSITORY}:latest + docker manifest create ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-amd64 ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le + docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-amd64 --arch amd64 + docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le --arch ppc64le + docker manifest push ${REPOSITORY}:${GITHUB_REF##*/} diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d3ce45a37..d83e8a348 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -9,14 +9,14 @@ jobs: GO111MODULE: on REPOSITORY: nfvpe/multus steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build latest-amd64 - run: docker build -t ${REPOSITORY}:latest-amd64 . - - - name: Build latest-ppc64le - run: docker build -t ${REPOSITORY}:latest-ppc64le -f Dockerfile.ppc64le . - - - name: Build latest-origin - run: docker build -t ${REPOSITORY}:latest-origin -f Dockerfile.openshift . + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build latest-amd64 + run: docker build -t ${REPOSITORY}:latest-amd64 . + + - name: Build latest-ppc64le + run: docker build -t ${REPOSITORY}:latest-ppc64le -f Dockerfile.ppc64le . + + - name: Build latest-origin + run: docker build -t ${REPOSITORY}:latest-origin -f Dockerfile.openshift . diff --git a/.github/workflows/go-build-ppc64.yml b/.github/workflows/go-build-ppc64.yml index f7519737c..a185a1672 100644 --- a/.github/workflows/go-build-ppc64.yml +++ b/.github/workflows/go-build-ppc64.yml @@ -12,14 +12,14 @@ jobs: GO111MODULE: on TARGET: ppc64le steps: - - name: Set up Go 1.13 - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build - run: GOARCH="${TARGET}" ./build + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build + run: GOARCH="${TARGET}" ./build diff --git a/.github/workflows/go-build-test-amd64.yml b/.github/workflows/go-build-test-amd64.yml index bd566780b..c17b0996d 100644 --- a/.github/workflows/go-build-test-amd64.yml +++ b/.github/workflows/go-build-test-amd64.yml @@ -12,16 +12,6 @@ jobs: GO111MODULE: on TARGET: amd64 steps: - - name: Dump GitHub login - env: - GITHUB_LOGIN: ${{ github.event.pull_request.head.repo.owner.login }} - run: echo "$GITHUB_LOGIN" - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Set up Go 1.13 uses: actions/setup-go@v1 with: diff --git a/.github/workflows/kind-e2e.yml b/.github/workflows/kind-e2e.yml new file mode 100644 index 000000000..f0171b1b2 --- /dev/null +++ b/.github/workflows/kind-e2e.yml @@ -0,0 +1,40 @@ +name: e2e-kind +on: [push, pull_request] +jobs: + + build: + name: Build and test + runs-on: ubuntu-latest + if: > + (( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) && + github.event_name == 'pull_request' ) || (github.event_name == 'push' && github.event.commits != '[]' ) + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Setup registry + run: docker run -d --restart=always -p "5000:5000" --name "kind-registry" registry:2 + + - name: Build latest-amd64 + run: docker build -t localhost:5000/multus:e2e . + + - name: Push to local registry + run: docker push localhost:5000/multus:e2e + + - name: Get kind/kubectl/koko + working-directory: ./e2e + run: ./get_tools.sh + + - name: Setup cluster + working-directory: ./e2e + run: ./setup_cluster.sh + + - name: Test macvlan1 + working-directory: ./e2e + run: ./test-simple-macvlan1.sh + + - name: cleanup cluster and registry + run: | + kind delete cluster + docker kill kind-registry + docker rm kind-registry diff --git a/.github/workflows/relase-binary.yml b/.github/workflows/release-binary.yml similarity index 77% rename from .github/workflows/relase-binary.yml rename to .github/workflows/release-binary.yml index 55cbc4d6b..951a82850 100644 --- a/.github/workflows/relase-binary.yml +++ b/.github/workflows/release-binary.yml @@ -9,19 +9,18 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v2 - - - name: Unshallow + + - name: Unshallow run: git fetch --prune --unshallow - - - name: Set up Go + + - name: Set up Go uses: actions/setup-go@v1 with: go-version: 1.13.x - - - name: Run GoReleaser + + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v1 with: version: latest diff --git a/e2e/README.md b/e2e/README.md new file mode 100644 index 000000000..f6ee410da --- /dev/null +++ b/e2e/README.md @@ -0,0 +1,12 @@ +## Multus e2e test with kind + +### How to test e2e + + +``` +$ git clone https://github.com/intel/multus-cni.git +$ cd multus-cni/e2e +$ ./get_tools.sh +$ ./setup_cluster.sh +$ ./test-simple-macvlan1.sh +``` diff --git a/e2e/cni-install.yml b/e2e/cni-install.yml new file mode 100644 index 000000000..90aa5f839 --- /dev/null +++ b/e2e/cni-install.yml @@ -0,0 +1,64 @@ +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: cni-install-sh + namespace: kube-system +data: + install_cni.sh: | + cd /tmp + wget https://github.com/containernetworking/plugins/releases/download/v0.8.5/cni-plugins-linux-amd64-v0.8.5.tgz + cd /host/opt/cni/bin + tar xvfzp /tmp/cni-plugins-linux-amd64-v0.8.5.tgz + sleep infinite +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: install-cni-plugins + namespace: kube-system + labels: + name: cni-plugins +spec: + selector: + matchLabels: + name: cni-plugins + template: + metadata: + labels: + name: cni-plugins + spec: + hostNetwork: true + nodeSelector: + kubernetes.io/arch: amd64 + tolerations: + - operator: Exists + effect: NoSchedule + containers: + - name: install-cni-plugins + image: alpine + command: ["/bin/sh", "/scripts/install_cni.sh"] + resources: + requests: + cpu: "100m" + memory: "50Mi" + limits: + cpu: "100m" + memory: "50Mi" + securityContext: + privileged: true + volumeMounts: + - name: cni-bin + mountPath: /host/opt/cni/bin + - name: scripts + mountPath: /scripts + volumes: + - name: cni-bin + hostPath: + path: /opt/cni/bin + - name: scripts + configMap: + name: cni-install-sh + items: + - key: install_cni.sh + path: install_cni.sh diff --git a/e2e/get_tools.sh b/e2e/get_tools.sh new file mode 100755 index 000000000..32f4e48d3 --- /dev/null +++ b/e2e/get_tools.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -o errexit + +if [ ! -d bin ]; then + mkdir bin +fi + +curl -Lo ./bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64" +chmod +x ./bin/kind +curl -Lo ./bin/kubectl https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl +chmod +x ./bin/kubectl +curl -Lo ./bin/koko https://github.com/redhat-nfvpe/koko/releases/download/v0.82/koko_0.82_linux_amd64 +chmod +x ./bin/koko +curl -Lo ./bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 +chmod +x ./bin/jq diff --git a/e2e/macvlan1.yml b/e2e/macvlan1.yml new file mode 100644 index 000000000..4597b2fff --- /dev/null +++ b/e2e/macvlan1.yml @@ -0,0 +1,63 @@ +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: macvlan1-config +spec: + config: '{ + "cniVersion": "0.3.1", + "plugins": [ + { + "type": "macvlan", + "capabilities": { "ips": true }, + "master": "eth1", + "mode": "bridge", + "ipam": { + "type": "static" + } + }, { + "type": "tuning" + } ] + }' +--- +apiVersion: v1 +kind: Pod +metadata: + name: macvlan1-worker1 + annotations: + k8s.v1.cni.cncf.io/networks: '[ + { "name": "macvlan1-config", + "ips": [ "10.1.1.11/24" ] } + ]' + labels: + app: macvlan +spec: + containers: + - name: macvlan-worker1 + image: centos:8 + command: ["/bin/sleep", "10000"] + securityContext: + privileged: true + nodeSelector: + kubernetes.io/hostname: kind-worker +--- +apiVersion: v1 +kind: Pod +metadata: + name: macvlan1-worker2 + annotations: + k8s.v1.cni.cncf.io/networks: '[ + { "name": "macvlan1-config", + "ips": [ "10.1.1.12/24" ] } + ]' + labels: + app: macvlan +spec: + containers: + - name: macvlan-worker2 + image: centos:8 + command: ["/bin/sleep", "10000"] + securityContext: + privileged: true + nodeSelector: + kubernetes.io/hostname: kind-worker2 diff --git a/e2e/multus-daemonset.yml b/e2e/multus-daemonset.yml new file mode 100644 index 000000000..ff3050c9c --- /dev/null +++ b/e2e/multus-daemonset.yml @@ -0,0 +1,247 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: network-attachment-definitions.k8s.cni.cncf.io +spec: + group: k8s.cni.cncf.io + scope: Namespaced + names: + plural: network-attachment-definitions + singular: network-attachment-definition + kind: NetworkAttachmentDefinition + shortNames: + - net-attach-def + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + config: + type: string +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: multus +rules: + - apiGroups: ["k8s.cni.cncf.io"] + resources: + - '*' + verbs: + - '*' + - apiGroups: + - "" + resources: + - pods + - pods/status + verbs: + - get + - update +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: multus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: multus +subjects: +- kind: ServiceAccount + name: multus + namespace: kube-system +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: multus + namespace: kube-system +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: multus-cni-config + namespace: kube-system + labels: + tier: node + app: multus +data: + # NOTE: If you'd prefer to manually apply a configuration file, you may create one here. + # In the case you'd like to customize the Multus installation, you should change the arguments to the Multus pod + # change the "args" line below from + # - "--multus-conf-file=auto" + # to: + # "--multus-conf-file=/tmp/multus-conf/70-multus.conf" + # Additionally -- you should ensure that the name "70-multus.conf" is the alphabetically first name in the + # /etc/cni/net.d/ directory on each node, otherwise, it will not be used by the Kubelet. + cni-conf.json: | + { + "name": "multus-cni-network", + "type": "multus", + "capabilities": { + "portMappings": true + }, + "delegates": [ + { + "cniVersion": "0.3.1", + "name": "default-cni-network", + "plugins": [ + { + "type": "flannel", + "name": "flannel.1", + "delegate": { + "isDefaultGateway": true, + "hairpinMode": true + } + }, + { + "type": "portmap", + "capabilities": { + "portMappings": true + } + } + ] + } + ], + "kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig" + } +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: kube-multus-ds-amd64 + namespace: kube-system + labels: + tier: node + app: multus + name: multus +spec: + selector: + matchLabels: + name: multus + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + tier: node + app: multus + name: multus + spec: + hostNetwork: true + nodeSelector: + kubernetes.io/arch: amd64 + tolerations: + - operator: Exists + effect: NoSchedule + serviceAccountName: multus + containers: + - name: kube-multus + image: localhost:5000/multus:e2e + command: ["/entrypoint.sh"] + args: + - "--multus-conf-file=auto" + - "--cni-version=0.3.1" + resources: + requests: + cpu: "100m" + memory: "50Mi" + limits: + cpu: "100m" + memory: "50Mi" + securityContext: + privileged: true + volumeMounts: + - name: cni + mountPath: /host/etc/cni/net.d + - name: cnibin + mountPath: /host/opt/cni/bin + - name: multus-cfg + mountPath: /tmp/multus-conf + volumes: + - name: cni + hostPath: + path: /etc/cni/net.d + - name: cnibin + hostPath: + path: /opt/cni/bin + - name: multus-cfg + configMap: + name: multus-cni-config + items: + - key: cni-conf.json + path: 70-multus.conf +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: kube-multus-ds-ppc64le + namespace: kube-system + labels: + tier: node + app: multus + name: multus +spec: + selector: + matchLabels: + name: multus + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + tier: node + app: multus + name: multus + spec: + hostNetwork: true + nodeSelector: + kubernetes.io/arch: ppc64le + tolerations: + - operator: Exists + effect: NoSchedule + serviceAccountName: multus + containers: + - name: kube-multus + # ppc64le support requires multus:latest for now. support 3.3 or later. + image: nfvpe/multus:latest-ppc64le + command: ["/entrypoint.sh"] + args: + - "--multus-conf-file=auto" + - "--cni-version=0.3.1" + resources: + requests: + cpu: "100m" + memory: "90Mi" + limits: + cpu: "100m" + memory: "90Mi" + securityContext: + privileged: true + volumeMounts: + - name: cni + mountPath: /host/etc/cni/net.d + - name: cnibin + mountPath: /host/opt/cni/bin + - name: multus-cfg + mountPath: /tmp/multus-conf + volumes: + - name: cni + hostPath: + path: /etc/cni/net.d + - name: cnibin + hostPath: + path: /opt/cni/bin + - name: multus-cfg + configMap: + name: multus-cni-config + items: + - key: cni-conf.json + path: 70-multus.conf diff --git a/e2e/setup_cluster.sh b/e2e/setup_cluster.sh new file mode 100755 index 000000000..152b38700 --- /dev/null +++ b/e2e/setup_cluster.sh @@ -0,0 +1,36 @@ +#!/bin/sh +set -o errexit + +export PATH=${PATH}:./bin + +reg_name='kind-registry' +reg_port='5000' +running="$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" +if [ "${running}" != 'true' ]; then + docker run -d --restart=always -p "${reg_port}:5000" --name "${reg_name}" registry:2 +fi +reg_ip="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' "${reg_name}")" + +cat <