Merge "Add nodepool kubernetes pod label to integration test"
This commit is contained in:
commit
27f9126874
|
@ -16,6 +16,29 @@
|
||||||
command: cat id_rsa
|
command: cat id_rsa
|
||||||
register: _ssh_key
|
register: _ssh_key
|
||||||
|
|
||||||
|
- name: Read generated kubectl configuration
|
||||||
|
command: |
|
||||||
|
sed -e 's#/home/zuul/.minikube/profiles/minikube/#/etc/nodepool-kubernetes/#g'
|
||||||
|
-e 's#/home/zuul/.minikube/#/etc/nodepool-kubernetes/#g'
|
||||||
|
~/.kube/config
|
||||||
|
register: _kube_config
|
||||||
|
|
||||||
|
- name: Read client cert
|
||||||
|
command: cat ~/.minikube/profiles/minikube/client.crt
|
||||||
|
register: _kube_cert
|
||||||
|
|
||||||
|
- name: Read client key
|
||||||
|
command: cat ~/.minikube/profiles/minikube/client.key
|
||||||
|
register: _kube_key
|
||||||
|
|
||||||
|
- name: Read ca cert
|
||||||
|
command: cat ~/.minikube/ca.crt
|
||||||
|
register: _kube_ca
|
||||||
|
|
||||||
|
- name: Read current context name
|
||||||
|
command: kubectl config current-context
|
||||||
|
register: _kube_context
|
||||||
|
|
||||||
- name: Setup user provided secrets
|
- name: Setup user provided secrets
|
||||||
k8s:
|
k8s:
|
||||||
namespace: "{{ namespace }}"
|
namespace: "{{ namespace }}"
|
||||||
|
@ -46,42 +69,27 @@
|
||||||
data:
|
data:
|
||||||
nodepool.yaml: |
|
nodepool.yaml: |
|
||||||
labels:
|
labels:
|
||||||
- name: pod-centos
|
- name: pod-fedora-31
|
||||||
min-ready: 1
|
min-ready: 1
|
||||||
providers:
|
providers:
|
||||||
- name: kube-cluster
|
- name: kube-cluster
|
||||||
driver: openshiftpods
|
driver: kubernetes
|
||||||
context: local
|
context: {{ _kube_context.stdout }}
|
||||||
max-pods: 15
|
max-pods: 15
|
||||||
pools:
|
pools:
|
||||||
- name: default
|
- name: default
|
||||||
labels:
|
labels:
|
||||||
- name: pod-centos
|
- name: pod-fedora-31
|
||||||
image: quay.io/software-factory/pod-centos-7
|
type: pod
|
||||||
python-path: /bin/python2
|
image: docker.io/fedora:31
|
||||||
|
python-path: /bin/python3
|
||||||
|
|
||||||
- name: nodepool-kube-config
|
- name: nodepool-kube-config
|
||||||
data:
|
data:
|
||||||
kube.config: |
|
kube.config: "{{ _kube_config.stdout }}"
|
||||||
apiVersion: v1
|
client.crt: "{{ _kube_cert.stdout }}"
|
||||||
kind: Config
|
client.key: "{{ _kube_key.stdout }}"
|
||||||
preferences: {}
|
ca.crt: "{{ _kube_ca.stdout }}"
|
||||||
clusters:
|
|
||||||
- cluster:
|
|
||||||
server: https://10.43.0.1:8043
|
|
||||||
insecure-skip-tls-verify: true
|
|
||||||
name: local
|
|
||||||
users:
|
|
||||||
- name: nodepool
|
|
||||||
user:
|
|
||||||
token: test-token
|
|
||||||
contexts:
|
|
||||||
- context:
|
|
||||||
cluster: local
|
|
||||||
user: nodepool
|
|
||||||
namespace: default
|
|
||||||
name: local
|
|
||||||
current-context: local
|
|
||||||
|
|
||||||
- name: Deploy CR
|
- name: Deploy CR
|
||||||
include_tasks: tasks/apply_cr.yaml
|
include_tasks: tasks/apply_cr.yaml
|
||||||
|
|
|
@ -24,13 +24,19 @@
|
||||||
sql:
|
sql:
|
||||||
|
|
||||||
- nodeset:
|
- nodeset:
|
||||||
name: localhost
|
name: pod-fedora
|
||||||
nodes: []
|
nodes:
|
||||||
|
- name: container
|
||||||
|
label: pod-fedora-31
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: test-job
|
name: test-job
|
||||||
run: test.yaml
|
run: test.yaml
|
||||||
nodeset: localhost
|
# skip zuul-base-jobs for now as it doesn't work with kubectl
|
||||||
|
roles:
|
||||||
|
- zuul: zuul/zuul-jobs
|
||||||
|
parent: null
|
||||||
|
nodeset: pod-fedora
|
||||||
|
|
||||||
- project:
|
- project:
|
||||||
periodic:
|
periodic:
|
||||||
|
@ -41,6 +47,8 @@
|
||||||
content: |
|
content: |
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
tasks:
|
tasks:
|
||||||
|
- include_role:
|
||||||
|
name: start-zuul-console
|
||||||
- debug: msg='Demo job is running'
|
- debug: msg='Demo job is running'
|
||||||
- pause: seconds=30
|
- pause: seconds=30
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,10 @@
|
||||||
name: opendev.org
|
name: opendev.org
|
||||||
- baseurl: "git://{{ ansible_all_ipv4_addresses[0] }}/"
|
- baseurl: "git://{{ ansible_all_ipv4_addresses[0] }}/"
|
||||||
name: local-git
|
name: local-git
|
||||||
|
external_config:
|
||||||
|
kubernetes:
|
||||||
|
secretName: nodepool-kube-config
|
||||||
|
key: kube.config
|
||||||
|
|
||||||
- name: ensure a job is running
|
- name: ensure a job is running
|
||||||
when: skip_check is not defined
|
when: skip_check is not defined
|
||||||
|
@ -110,6 +114,10 @@
|
||||||
shell: |
|
shell: |
|
||||||
curl -s {{ zuul_web_url }}/api/tenant/local/status | jq -r '.pipelines[].change_queues[].heads[][].jobs[].uuid'
|
curl -s {{ zuul_web_url }}/api/tenant/local/status | jq -r '.pipelines[].change_queues[].heads[][].jobs[].uuid'
|
||||||
register: _job_uuid
|
register: _job_uuid
|
||||||
|
# Wait until the executor start the job
|
||||||
|
until: _job_uuid.stdout != "" and _job_uuid.stdout != "null"
|
||||||
|
retries: 60
|
||||||
|
delay: 1
|
||||||
|
|
||||||
- name: connect to console-stream
|
- name: connect to console-stream
|
||||||
command: |
|
command: |
|
||||||
|
|
Loading…
Reference in New Issue