1e133ba51d
This updates the ensure-kubernetes testing to check the pod is actually running. This was hiding some issues on Jammy where the installation succeeded but the pod was not ready. The essence of the problem seems to be that the containernetworking-plugins tools are coming from upstream packages on Ubuntu Jammy. This native package places the networking tools in a different location to those from the Opensuse kubic repo. We need to update the cri-o path and the docker path for our jobs. For cri-o this is just an update to the config file, which is separated out into the crio-Ubuntu-22.04 include file. For docker things are bit harder, because you need the cri-docker shim now to use a docker runtime with kubernetes. Per the note inline, this shim has some hard-coded assumptions which mean we need to override the way it overrides (!). This works but does all feel a bit fragile; we should probably consider our overall support for the docker backend. With ensure-kubernetes working now, we can revert the non-voting jobs from the eariler change Id6ee7ed38fec254493a2abbfa076b9671c907c83. Change-Id: I5f02f4e056a0e731d74d00ebafa96390c06175cf
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
- hosts: all
|
|
name: Post testing
|
|
tasks:
|
|
- name: Run functionality tests
|
|
block:
|
|
# The default account is known to take a while to appear; see
|
|
# https://github.com/kubernetes/kubernetes/issues/66689
|
|
- name: Ensure default account created
|
|
command: kubectl -n default get serviceaccount default -o name
|
|
retries: 5
|
|
delay: 5
|
|
register: result
|
|
until: result.rc == 0
|
|
|
|
- name: Create a test pod definition
|
|
copy:
|
|
dest: test-pod.yaml
|
|
content: |
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: test
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: test
|
|
image: k8s.gcr.io/pause:3.1
|
|
|
|
- name: Start pod
|
|
command: kubectl apply -f test-pod.yaml
|
|
|
|
- name: Ensure pod is running
|
|
shell: sleep 5; kubectl get pods
|
|
register: _get_pods_output
|
|
until: "'Running' in _get_pods_output.stdout"
|
|
retries: 3
|
|
delay: 5
|
|
|
|
always:
|
|
- name: Collect container logs
|
|
import_role:
|
|
name: collect-container-logs
|
|
|
|
- name: Collect kubernetes logs
|
|
import_role:
|
|
name: collect-kubernetes-logs
|
|
|
|
- name: Get minikube logs
|
|
become: true
|
|
shell: "/tmp/minikube logs > {{ ansible_user_dir }}/zuul-output/logs/minikube.txt"
|
|
environment:
|
|
MINIKUBE_HOME: "{{ ansible_user_dir }}"
|