
We have several tests that were using debian:testing from docker hub as a base image to deploy some content that would validate execution of container runtimes. Docker hub has some pretty strict rate limits in place these days so we'd like to use an image on quay.io instead. The opendevmirror org is already mirroring the httpd:alpine image there which is a smal relatively simple image that we can use for this purpose. Note we switch from debian with bash to alpine with a busybox sh. But the tools we rely on (touch, echo, sleep) all appear to be present. Change-Id: I9bb5db416e3b9601c67de1c053162fd30a977bbd
56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
- hosts: all
|
|
roles:
|
|
- role: clear-firewall
|
|
- role: ensure-kubernetes
|
|
vars:
|
|
ensure_kubernetes_type: microk8s
|
|
- role: use-buildset-registry
|
|
buildset_registry_docker_user: root
|
|
tasks:
|
|
- name: Wait for cluster to come up
|
|
command: kubectl cluster-info
|
|
register: result
|
|
until: result.rc == 0
|
|
retries: 5
|
|
delay: 30
|
|
|
|
- name: Run a local test pod
|
|
command: kubectl run --image=quay.io/zuul/quay-testimage quaytest
|
|
|
|
- name: Pause
|
|
pause:
|
|
seconds: 60
|
|
|
|
- name: Describe pod
|
|
command: kubectl describe pods quaytest
|
|
|
|
- name: Wait for the pod to be ready
|
|
command: kubectl wait --for=condition=Ready pod/quaytest --timeout=60s
|
|
|
|
- name: Check the output of the pod
|
|
shell: |
|
|
set -o pipefail
|
|
kubectl logs pod/quaytest | grep 'Zuul container test'
|
|
args:
|
|
executable: /bin/bash
|
|
|
|
- name: Run a remote test pod
|
|
command: kubectl run --image=quay.io/opendevmirror/httpd:alpine upstream-quaytest --command -- /bin/sh -c 'echo Upstream; sleep infinity'
|
|
|
|
- name: Pause
|
|
pause:
|
|
seconds: 60
|
|
|
|
- name: Describe pod
|
|
command: kubectl describe pods upstream-quaytest
|
|
|
|
- name: Wait for the pod to be ready
|
|
command: kubectl wait --for=condition=Ready pod/upstream-quaytest --timeout=60s
|
|
|
|
- name: Check the output of the pod
|
|
shell: |
|
|
set -o pipefail
|
|
kubectl logs pod/upstream-quaytest | grep 'Upstream'
|
|
args:
|
|
executable: /bin/bash
|