Skip to content

Commit 16c4dd0

Browse files
committed
[ci] Add loki-operator deps to CloudKitty deployment
Loki-operator needs to be pinned to 6.3.0, because 6.3.1 has this issue: https://issues.redhat.com/browse/LOG-7752
1 parent d084423 commit 16c4dd0

File tree

3 files changed

+202
-0
lines changed

3 files changed

+202
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 }}/deploy-loki-for-ck.yaml
13+
14+
- name: Get install plan from the list of installplans (not used)
15+
ansible.builtin.shell:
16+
cmd: |
17+
oc get installplan -n openshift-operators-redhat | grep "loki-operator.v6.3.0" | awk '{print $1}'
18+
retries: 10
19+
delay: 10
20+
register: install_plan
21+
until: install_plan.stdout_lines != 0
22+
23+
# This is the better option if it produces an installplan var, since it filters by loki version
24+
- name: Show the install_plan from oc get installplan
25+
ansible.builtin.debug:
26+
var: install_plan
27+
28+
- name: Get the installplan from the loki-operator subscription
29+
ansible.builtin.shell:
30+
cmd: |
31+
oc get subscription -n openshift-operators-redhat loki-operator -ojsonpath='{ .status.installplan.name }'
32+
until: loki_installplan.stdout_lines | length > 0
33+
retries: 12
34+
delay: 10
35+
register: loki_installplan
36+
37+
- name: Show the loki_installplan
38+
ansible.builtin.debug:
39+
var: loki_installplan.stdout
40+
41+
- name: Get details of loki installplan
42+
ansible.builtin.shell:
43+
cmd: |
44+
oc describe -n openshift-operators-redhat installplan {{ loki_installplan.stdout }}
45+
46+
- name: Show installplans
47+
ansible.builtin.shell:
48+
cmd: |
49+
oc get installplan --all-namespaces
50+
register: all_install_plans
51+
52+
- name: Show all install plans
53+
ansible.builtin.debug:
54+
var: all_install_plans
55+
56+
- name: Get install plan and approve the installation
57+
ansible.builtin.shell:
58+
cmd: |
59+
oc patch -n openshift-operators-redhat installplan {{ loki_installplan.stdout }} --type='json' -p='[{"op": "replace", "path": "/spec/approved", "value":true}]'
60+

ci/vars-cloudkitty-tempest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ pre_deploy_kustomize_cloudkitty:
1717
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/configure-cloudkitty.yml"
1818
type: playbook
1919

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
2023
# test cloudkitty
2124
cifmw_run_tests: true
2225
cifmw_run_test_role: test_operator

deploy-loki-for-ck.yaml

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

0 commit comments

Comments
 (0)