From 610443d04bee6c7d9475a7b0bd75ef179b4b7098 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 8 Dec 2022 16:34:24 +1100 Subject: [PATCH] nodepool-functional-k8s: switch to microk8s Switch this job to use microk8s, which should be more stable than minikube on our Ubuntu testing hosts. Depends-on: https://review.opendev.org/c/zuul/zuul-jobs/+/866953 Change-Id: I8e76581ea5cf4a4241aec48bc59086d7f17cd72a --- .zuul.yaml | 1 - .../tests/fixtures/functional/kubernetes/basic.yaml | 6 +++--- playbooks/nodepool-functional-k8s/post.yaml | 10 ---------- playbooks/nodepool-functional-k8s/pre.yaml | 6 +++++- tox.ini | 3 --- 5 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 playbooks/nodepool-functional-k8s/post.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 14c1e3f54..d982b6509 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -4,7 +4,6 @@ name: nodepool-functional-k8s pre-run: playbooks/nodepool-functional-k8s/pre.yaml run: playbooks/nodepool-functional-k8s/run.yaml - post-run: playbooks/nodepool-functional-k8s/post.yaml required-projects: - zuul/nodepool nodeset: ubuntu-jammy diff --git a/nodepool/tests/fixtures/functional/kubernetes/basic.yaml b/nodepool/tests/fixtures/functional/kubernetes/basic.yaml index b368a4236..66a504c89 100644 --- a/nodepool/tests/fixtures/functional/kubernetes/basic.yaml +++ b/nodepool/tests/fixtures/functional/kubernetes/basic.yaml @@ -15,9 +15,9 @@ labels: min-ready: 1 providers: - - name: minikube + - name: microk8s driver: kubernetes - context: minikube + context: microk8s pools: - name: main max-servers: 2 @@ -26,4 +26,4 @@ providers: type: namespace - name: pod-fedora type: pod - image: quay.io/fedora/fedora:34-x86_64 + image: quay.io/fedora/fedora:37-x86_64 diff --git a/playbooks/nodepool-functional-k8s/post.yaml b/playbooks/nodepool-functional-k8s/post.yaml deleted file mode 100644 index a760972b0..000000000 --- a/playbooks/nodepool-functional-k8s/post.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- hosts: all - vars: - minikube_log: '{{ ansible_user_dir }}/zuul-output/logs/minikube.txt' - - tasks: - - name: Produce minikube log - become: yes - shell: '/tmp/minikube logs > {{ minikube_log }}' - environment: - MINIKUBE_HOME: "{{ ansible_user_dir }}" diff --git a/playbooks/nodepool-functional-k8s/pre.yaml b/playbooks/nodepool-functional-k8s/pre.yaml index 26e14d8fe..d43133bc6 100644 --- a/playbooks/nodepool-functional-k8s/pre.yaml +++ b/playbooks/nodepool-functional-k8s/pre.yaml @@ -5,4 +5,8 @@ zookeeper_use_tls: true - role: ensure-tox - role: ensure-kubernetes - docker_version: 18.06.1~ce~3-0~ubuntu + ensure_kubernetes_type: microk8s + # k8s > 1.23 changed the way the service account tokens + # are auto-generated; see + # https://storyboard.openstack.org/#!/story/2010224 + ensure_kubernetes_microk8s_channel: '1.23/stable' diff --git a/tox.ini b/tox.ini index 22f8ed3e7..d9519bafd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,9 @@ [tox] minversion = 3.1 -skipsdist = True envlist = pep8,py3 ignore_basepython_conflict = True [testenv] -basepython = python3 # Set STATSD env variables so that statsd code paths are tested. setenv = STATSD_HOST=localhost STATSD_PORT=8125 @@ -60,7 +58,6 @@ commands = stestr --test-path ./nodepool/tests/functional/kubernetes run --no-su stestr slowest [testenv:functional_openshift] -basepython = python3 commands = stestr --test-path ./nodepool/tests/functional/openshift run --no-subunit-trace {posargs} stestr slowest