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:
parent
33b70c9905
commit
aafaeab660
15
.zuul.yaml
15
.zuul.yaml
|
@ -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:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- noop
|
- zuul-operator-functional-k8s
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- noop
|
- zuul-operator-functional-k8s
|
||||||
|
|
|
@ -21,14 +21,14 @@ spec:
|
||||||
- /tmp/ansible-operator/runner
|
- /tmp/ansible-operator/runner
|
||||||
- stdout
|
- stdout
|
||||||
# TODO: use a public name
|
# TODO: use a public name
|
||||||
image: "172.30.1.1:5000/myproject/zuul-operator"
|
image: "zuul/zuul-operator"
|
||||||
imagePullPolicy: "Never"
|
imagePullPolicy: "Never"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /tmp/ansible-operator/runner
|
- mountPath: /tmp/ansible-operator/runner
|
||||||
name: runner
|
name: runner
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: operator
|
- name: operator
|
||||||
image: "172.30.1.1:5000/myproject/zuul-operator"
|
image: "zuul/zuul-operator"
|
||||||
imagePullPolicy: "Never"
|
imagePullPolicy: "Never"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /tmp/ansible-operator/runner
|
- mountPath: /tmp/ansible-operator/runner
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
- name: start kubernetes and install all dependencies
|
||||||
|
hosts: all
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Get pods
|
||||||
|
command: kubectl get pods
|
|
@ -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
|
|
@ -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 }}"
|
Loading…
Reference in New Issue