Add Kubernetes Operator Functional Test Job

A job that will run playbooks which start kubernetes, and verify that the
zuul-operator builds properly. This will be added to check and gate and
is the first step to https://review.opendev.org/#/c/659180/

Change-Id: Idf677621cf178b3af9975bbd22fbfe0d30df7ee5
This commit is contained in:
Jeff Liu 2019-06-27 15:11:26 -04:00
parent 33b70c9905
commit aafaeab660
5 changed files with 62 additions and 4 deletions

View File

@ -1,7 +1,18 @@
- job:
description: |
Test that zuul-operator works in Kubernetes (currently debugging use)
name: zuul-operator-functional-k8s
pre-run: playbooks/zuul-operator-functional-k8s/pre.yaml
run: playbooks/zuul-operator-functional-k8s/run.yaml
post-run: playbooks/zuul-operator-functional-k8s/post.yaml
nodeset: ubuntu-xenial
required-projects:
- zuul/zuul-operator
- project:
check:
jobs:
- noop
- zuul-operator-functional-k8s
gate:
jobs:
- noop
- zuul-operator-functional-k8s

View File

@ -21,14 +21,14 @@ spec:
- /tmp/ansible-operator/runner
- stdout
# TODO: use a public name
image: "172.30.1.1:5000/myproject/zuul-operator"
image: "zuul/zuul-operator"
imagePullPolicy: "Never"
volumeMounts:
- mountPath: /tmp/ansible-operator/runner
name: runner
readOnly: true
- name: operator
image: "172.30.1.1:5000/myproject/zuul-operator"
image: "zuul/zuul-operator"
imagePullPolicy: "Never"
volumeMounts:
- mountPath: /tmp/ansible-operator/runner

View File

@ -0,0 +1,6 @@
- name: start kubernetes and install all dependencies
hosts: all
tasks:
- name: Get pods
command: kubectl get pods

View File

@ -0,0 +1,7 @@
- name: start kubernetes and install all dependencies
hosts: all
roles:
- role: bindep
- role: install-kubernetes
docker_version: 18.06.1~ce~3-0~ubuntu

View File

@ -0,0 +1,34 @@
- name: install and start zuul operator
hosts: all
tasks:
- name: Set Operator SDK Release Version fact
set_fact:
RELEASE_VERSION: v0.8.1
- name: Download Operator SDK Binary Release to Path
become: yes
get_url:
url: https://github.com/operator-framework/operator-sdk/releases/download/{{ RELEASE_VERSION }}/operator-sdk-{{ RELEASE_VERSION }}-x86_64-linux-gnu
dest: /usr/local/bin/operator-sdk
mode: a+x
- name: Build operator
command: operator-sdk build zuul/zuul-operator
args:
chdir: "{{ zuul.projects['opendev.org/zuul/zuul-operator'].src_dir }}"
- name: Setup CRD
command: kubectl create -f deploy/crds/zuul-ci_v1alpha1_zuul_crd.yaml
args:
chdir: "{{ zuul.projects['opendev.org/zuul/zuul-operator'].src_dir }}"
- name: Setup rbac
command: kubectl create -f deploy/rbac.yaml
args:
chdir: "{{ zuul.projects['opendev.org/zuul/zuul-operator'].src_dir }}"
- name: Setup Operator
command: kubectl create -f deploy/operator.yaml
args:
chdir: "{{ zuul.projects['opendev.org/zuul/zuul-operator'].src_dir }}"