Skip to content

Commit 943d09e

Browse files
committed
[zuul] Add a CloudKitty CI job to run tempest tests
Add a pre_deploy hook to install loki-operator for CloudKitty deployment Add a pre_deploy hook to create the oscp kustomization to enable cloudkitty * add s3storageConfig secret * Enable metricsStorage in telemetry to provide prometheus for storage * Configure storageClass for CloudKitty in configure-cloudkitty hook Set the storageClass to crc-csi-hostpath-provisioner for CloudKitty deployment in CRC-based CI jobs. This prevents the need to increase PVC allocations in install_yamls by using the default storage class available in CRC, which allocates storage as required.
1 parent 4dd28e2 commit 943d09e

File tree

5 files changed

+310
-19
lines changed

5 files changed

+310
-19
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
- name: "Install loki for cloudkitty"
3+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
4+
gather_facts: false
5+
environment:
6+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
7+
PATH: "{{ cifmw_path }}"
8+
tasks:
9+
- name: Deploy loki operator
10+
ansible.builtin.shell:
11+
cmd: |
12+
oc apply -f {{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/deploy-loki-for-ck.yaml
13+
14+
- name: Wait up to 5 minutes until the Loki CSV is Succeeded
15+
ansible.builtin.shell:
16+
cmd:
17+
oc get csv | grep loki-operator | grep Succeeded
18+
ignore_errors: true
19+
register: output
20+
until: output.stdout_lines | length == 1
21+
retries: 30
22+
delay: 10

ci/configure-cloudkitty.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
- name: "Create the kustomization for deploying CloudKitty"
3+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
4+
gather_facts: false
5+
environment:
6+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
7+
PATH: "{{ cifmw_path }}"
8+
tasks:
9+
- name: Copy controlplane kustomization
10+
ansible.builtin.copy:
11+
dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-kustomize-controlplane-cloudkitty.yaml"
12+
content: |-
13+
apiVersion: kustomize.config.k8s.io/v1beta1
14+
kind: Kustomization
15+
namespace: openstack
16+
patches:
17+
- patch: |-
18+
apiVersion: core.openstack.org/v1beta1
19+
kind: OpenStackControlPlane
20+
metadata:
21+
name: unused
22+
spec:
23+
# Set overall storage class so we don't need to increase the
24+
# number of PVCs that install_yamls creates
25+
# this is only applicable to crc-based jobs, it is not in
26+
# openshift by default, but is included in the crc distribution
27+
storageClass: crc-csi-hostpath-provisioner
28+
telemetry:
29+
enabled: true
30+
template:
31+
logging:
32+
enabled: false
33+
autoscaling:
34+
enabled: false
35+
cloudkitty:
36+
enabled: true
37+
s3StorageConfig:
38+
secret:
39+
type: "s3"
40+
name: "cloudkitty-loki-s3"
41+
metricStorage:
42+
enabled: true
43+
target:
44+
kind: OpenStackControlPlane

ci/deploy-loki-for-ck.yaml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: openshift-operators-redhat
6+
labels:
7+
name: openshift-operators-redhat
8+
---
9+
apiVersion: operators.coreos.com/v1
10+
kind: OperatorGroup
11+
metadata:
12+
name: loki-operator
13+
namespace: openshift-operators-redhat
14+
spec:
15+
upgradeStrategy: Default
16+
---
17+
apiVersion: operators.coreos.com/v1alpha1
18+
kind: Subscription
19+
metadata:
20+
name: loki-operator
21+
namespace: openshift-operators-redhat
22+
spec:
23+
channel: stable-6.3
24+
name: loki-operator
25+
source: redhat-operators
26+
sourceNamespace: openshift-marketplace
27+
---
28+
# Deploys a new Namespace for the MinIO Pod
29+
apiVersion: v1
30+
kind: Namespace
31+
metadata:
32+
name: minio-dev # Change this value if you want a different namespace name
33+
labels:
34+
name: minio-dev # Change this value to match metadata.name
35+
---
36+
# Deploys a new MinIO Pod into the metadata.namespace Kubernetes namespace
37+
#
38+
apiVersion: v1
39+
kind: Pod
40+
metadata:
41+
labels:
42+
app: minio
43+
name: minio
44+
namespace: minio-dev # Change this value to match the namespace metadata.name
45+
spec:
46+
containers:
47+
- name: minio
48+
image: quay.io/minio/minio:latest
49+
command:
50+
- /bin/bash
51+
- -c
52+
- |
53+
mkdir -p /data/loki && \
54+
minio server /data
55+
env:
56+
- name: MINIO_ACCESS_KEY
57+
value: minio
58+
- name: MINIO_SECRET_KEY
59+
value: minio123
60+
volumeMounts:
61+
- mountPath: /data
62+
name: storage # Corresponds to the `spec.volumes` Persistent Volume
63+
volumes:
64+
- name: storage
65+
persistentVolumeClaim:
66+
claimName: minio-pvc
67+
---
68+
apiVersion: v1
69+
kind: PersistentVolumeClaim
70+
metadata:
71+
name: minio-pvc
72+
namespace: minio-dev
73+
spec:
74+
accessModes:
75+
- ReadWriteOnce
76+
resources:
77+
requests:
78+
storage: 10Gi
79+
storageClassName: crc-csi-hostpath-provisioner
80+
---
81+
apiVersion: v1
82+
kind: Service
83+
metadata:
84+
name: minio
85+
namespace: minio-dev
86+
spec:
87+
selector:
88+
app: minio
89+
ports:
90+
- name: api
91+
protocol: TCP
92+
port: 9000
93+
- name: console
94+
protocol: TCP
95+
port: 9090
96+
---
97+
kind: Route
98+
apiVersion: route.openshift.io/v1
99+
metadata:
100+
name: minio-console
101+
namespace: minio-dev
102+
spec:
103+
host: console-minio-dev.apps-crc.testing
104+
to:
105+
kind: Service
106+
name: minio
107+
weight: 100
108+
port:
109+
targetPort: console
110+
wildcardPolicy: None
111+
---
112+
kind: Route
113+
apiVersion: route.openshift.io/v1
114+
metadata:
115+
name: minio-api
116+
namespace: minio-dev
117+
spec:
118+
host: api-minio-dev.apps-crc.testing
119+
to:
120+
kind: Service
121+
name: minio
122+
weight: 100
123+
port:
124+
targetPort: api
125+
wildcardPolicy: None
126+
---
127+
apiVersion: v1
128+
kind: Secret
129+
metadata:
130+
name: cloudkitty-loki-s3
131+
namespace: openstack
132+
stringData:
133+
access_key_id: minio
134+
access_key_secret: minio123
135+
bucketnames: loki
136+
endpoint: http://minio.minio-dev.svc.cluster.local:9000
137+

ci/vars-cloudkitty-tempest.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
cifmw_deploy_obs: true
3+
cifmw_openshift_obs_definition:
4+
apiVersion: operators.coreos.com/v1alpha1
5+
kind: Subscription
6+
metadata:
7+
name: observability-operator
8+
namespace: openshift-operators
9+
spec:
10+
channel: stable
11+
installPlanApproval: Automatic
12+
name: cluster-observability-operator
13+
source: redhat-operators
14+
sourceNamespace: openshift-marketplace
15+
16+
pre_deploy_kustomize_cloudkitty:
17+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/configure-cloudkitty.yml"
18+
type: playbook
19+
20+
pre_deploy_loki_setup:
21+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/cloudkitty-pre_deploy-install_loki.yml"
22+
type: playbook
23+
# test cloudkitty
24+
cifmw_run_tests: true
25+
cifmw_run_test_role: test_operator
26+
# TODO: Consider switching to podified-master-centos10 for features that patch master
27+
cifmw_test_operator_tempest_namespace: podified-antelope-centos9
28+
# cloudkitty tempest plugin is not part of the tempest rpm.
29+
# https://review.rdoproject.org/cgit/openstack/tempest-distgit/tree/openstack-tempest.spec
30+
# We need to add the cloudkitty-tempest-plugin package to RDO, same as TTTP
31+
# https://review.rdoproject.org/cgit/openstack/telemetry-tempest-plugin-distgit/#
32+
# For now, we can force install using the cifmw_test_operator_tempest_external_plugin below.
33+
cifmw_test_operator_tempest_container: openstack-tempest-all
34+
cifmw_test_operator_tempest_image_tag: 'current-podified'
35+
# This value is used to populate the `tempestconfRun` parameter of the Tempest CR: https://openstack-k8s-operators.github.io/test-operator/crds.html#tempest-custom-resource
36+
# https://github.com/openstack-k8s-operators/ci-framework/blob/main/roles/test_operator/defaults/main.yml
37+
# TODO: Refine this tempest config
38+
tempest_conf:
39+
overrides: |
40+
validation.run_validation true
41+
identity.v3_endpoint_type public
42+
service_available.ceilometer true
43+
service_available.sg_core true
44+
service_available.aodh true
45+
service_available.cinder false
46+
telemetry.sg_core_service_url "https://ceilometer-internal.openstack.svc.cluster.local:3000"
47+
telemetry.prometheus_service_url "https://metric-storage-prometheus.openstack.svc.cluster.local:9090"
48+
telemetry.ceilometer_polling_interval 120
49+
telemetry.prometheus_scrape_interval 30
50+
telemetry.alarm_threshold 50000000000
51+
cifmw_test_operator_tempest_tempestconf_config: "{{ tempest_conf }}"
52+
cifmw_test_operator_tempest_include_list: |
53+
^tempest.*\[.*\bsmoke\b.*\]
54+
cloudkitty_tempest_plugin.*
55+
telemetry_tempest_plugin.*
56+
# TODO: update this to allow multiple external plugins to be listed with Depends-On.
57+
# Potentially, this can be done via the meta content provider, by adding the tempest images to the list.
58+
external_plugin: "opendev.org/openstack/cloudkitty-tempest-plugin"
59+
change_item: "{{ zuul['items'] | selectattr('project.canonical_name', 'equalto', external_plugin) }}"
60+
# WORKAROUND: CloudKitty tempest is not packaged in RDO. Typically, the default would be [], since we would not require an external installation.
61+
cifmw_test_operator_tempest_external_plugin: "{{ [ {'repository': 'https://' + external_plugin + '.git'} ] if change_item | length < 1 else [ { 'repository': 'https://' + external_plugin + '.git', 'changeRepository': 'https://review' + external_plugin, 'changeRefspec': [ 'refs/changes', change_item[0].change[-2:], change_item[0].change, change_item[0].patchset ] | join('/') } ] }}"

zuul.d/projects.yaml

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,28 @@
104104
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-power-monitoring.yml"
105105
irrelevant-files: *irrelevant_files
106106

107+
- job:
108+
name: telemetry-operator-multinode-cloudkitty
109+
dependencies: ["telemetry-openstack-meta-content-provider-master"]
110+
parent: telemetry-operator-multinode-autoscaling
111+
description: |
112+
Deploy CloudKitty and run tempest tests
113+
required-projects:
114+
- name: infrawatch/feature-verification-tests
115+
override-checkout: master
116+
extra-vars: *mcp_extra_vars
117+
vars:
118+
#patch_observabilityclient: true
119+
cifmw_update_containers: false
120+
cifmw_extras:
121+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir }}/scenarios/centos-9/multinode-ci.yml"
122+
# Need a config for CK
123+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-cloudkitty-tempest.yml"
124+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-use-master-containers.yml"
125+
roles:
126+
- zuul: github.com/openstack-k8s-operators/ci-framework
127+
irrelevant-files: *irrelevant_files
128+
107129
- project-template:
108130
name: rdo-telemetry-tempest-plugin-jobs
109131
openstack-experimental:
@@ -133,25 +155,30 @@
133155

134156
- project:
135157
name: openstack-k8s-operators/telemetry-operator
136-
templates:
137-
- podified-multinode-edpm-pipeline
158+
#templates:
159+
# - podified-multinode-edpm-pipeline
138160
github-check:
161+
#debug: true
139162
jobs:
163+
- telemetry-operator-multinode-cloudkitty:
164+
dependencies:
165+
- telemetry-openstack-meta-content-provider-master
140166
- telemetry-openstack-meta-content-provider-master
141-
- telemetry-operator-multinode-default-telemetry
142-
- functional-tests-osp18: &fvt_jobs_config
143-
voting: true
144-
required-projects:
145-
- name: infrawatch/feature-verification-tests
146-
override-checkout: master
147-
irrelevant-files: *irrelevant_files
148-
- feature-verification-tests-noop:
149-
files: *irrelevant_files
150-
- functional-periodic-telemetry-with-ceph:
151-
required-projects:
152-
- name: infrawatch/feature-verification-tests
153-
override-checkout: master
154-
files:
155-
- ci/deploy-telemetry-with-ceph.yml
156-
- ci/vars-telemetry-with-ceph.yml
157-
- zuul.d/projects.yaml
167+
#- telemetry-operator-multinode-default-telemetry
168+
#- functional-tests-osp18: &fvt_jobs_config
169+
# voting: true
170+
# required-projects:
171+
# - name: infrawatch/feature-verification-tests
172+
# override-checkout: master
173+
# irrelevant-files: *irrelevant_files
174+
#- feature-verification-tests-noop:
175+
# files: *irrelevant_files
176+
#- functional-periodic-telemetry-with-ceph:
177+
# required-projects:
178+
# - name: infrawatch/feature-verification-tests
179+
# override-checkout: master
180+
# files:
181+
# - ci/deploy-telemetry-with-ceph.yml
182+
# - ci/vars-telemetry-with-ceph.yml
183+
# - zuul.d/projects.yaml
184+

0 commit comments

Comments
 (0)