This change replaces the existing tasks with a dhall function to generates all the kubernetes objects. The operator nows converts the CR spec to a dhall `Input`, then it applies the function output to the cluster. Follow-up changes demonstrate how runtime operations can be performed around that function. This change updates the zuul-ci_v1alpha1_zuul_cr.yaml file with the actual CR defined in the zuul specification so that it can be used in the functional tests. Depends-On: https://review.opendev.org/702753 Change-Id: Iea51bccf90def6e827d2c5846ad6a7e4c86a5bc1
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
# Run operator role locally, without the operator-framework using:
|
|
# ansible-playbook playbooks/files/local.yaml
|
|
# Add '-e k8s_state=absent' to remove resources
|
|
|
|
- hosts: localhost
|
|
gather_facts: no
|
|
vars:
|
|
zuul_app_path: ../../conf/zuul
|
|
meta:
|
|
name: zuul
|
|
namespace: default
|
|
spec:
|
|
executor:
|
|
count: 1
|
|
ssh_key:
|
|
secretName: executor-ssh-key
|
|
merger:
|
|
count: 1
|
|
scheduler:
|
|
config:
|
|
secretName: zuul-yaml-conf
|
|
launcher:
|
|
config:
|
|
secretName: nodepool-yaml-conf
|
|
connections:
|
|
gits:
|
|
- baseurl: https://opendev.org
|
|
name: opendev.org
|
|
pre_tasks:
|
|
- name: "Create necessary secrets"
|
|
k8s:
|
|
namespace: "{{ meta.namespace }}"
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: "{{ item.name }}"
|
|
stringData:
|
|
id_rsa: "{{ item.content }}"
|
|
main.yaml: "{{ item.content }}"
|
|
nodepool.yaml: "{{ item.content }}"
|
|
loop:
|
|
- name: executor-ssh-key
|
|
file: id_rsa
|
|
content: "{{ lookup('file', '~/.ssh/id_rsa') }}"
|
|
- name: zuul-yaml-conf
|
|
file: main.yaml
|
|
content: |
|
|
- tenant:
|
|
name: local
|
|
source:
|
|
opendev.org:
|
|
config-projects:
|
|
- zuul/zuul-base-jobs
|
|
untrusted-projects:
|
|
- zuul/zuul-jobs
|
|
- name: nodepool-yaml-conf
|
|
file: nodepool.yaml
|
|
content: |
|
|
labels:
|
|
- name: pod-centos
|
|
min-ready: 1
|
|
providers:
|
|
- name: kube-cluster
|
|
driver: openshiftpods
|
|
context: local
|
|
max-pods: 15
|
|
pools:
|
|
- name: default
|
|
labels:
|
|
- name: pod-centos
|
|
image: quay.io/software-factory/pod-centos-7
|
|
python-path: /bin/python2
|
|
|
|
roles:
|
|
- zuul
|