Skip to content

Commit 7059594

Browse files
committed
Replace copy with template
1 parent 847e944 commit 7059594

File tree

2 files changed

+52
-38
lines changed

2 files changed

+52
-38
lines changed

ci/configure-cloudkitty.yml

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -62,41 +62,21 @@
6262
target:
6363
kind: OpenStackControlPlane
6464
65-
# This probably won't actually work, since there's no telemetry object yet at this point.
66-
# The kustomization needs to be done post_deploy
67-
# - name: Copy telemetry kustomization
68-
# ansible.builtin.copy:
69-
# dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-kustomize-telemetry-cloudkitty.yaml"
70-
# content: |-
71-
# apiVersion: kustomize.config.k8s.io/v1beta1
72-
# kind: Kustomization
73-
# namespace: openstack
74-
# patches:
75-
# - patch: |-
76-
# apiVersion: core.openstack.org/v1beta1
77-
# kind: Telemetry
78-
# metadata:
79-
# name: telemetry-ck
80-
# spec:
81-
# cloudkitty:
82-
# enabled: true
83-
# secret: osp-secret
84-
# passwordSelector:
85-
# aodhService: AodhPassword
86-
# ceilometerService: CeilometerPassword
87-
# cloudKittyService: CloudKittyPassword
88-
# # WORKAROUND
89-
# # Need to set the images, since the defaulting is not working at the moment.
90-
# # The container image is not being set, so the dbsync is failing.
91-
# # The defaulting will not be done in the webhook until CK is added to the openstack-operator.
92-
# # If I change the name of the CK, I can just configure using the CK CRD.
93-
# # If I don't change the name, and disable it in telemetry, then the telemetry-operator will delete the telemetry telemetry.
94-
# cloudKittyAPI:
95-
# # containerImage: "{{ cloudkitty_api_image }}"
96-
# containerImage: "quay.io/efoley/cloudkitty-api@sha256:baf3f44225be4ac55eef6e45ab4095a8284fc186da5916408dbf95767a1eb5e9"
97-
# cloudKittyProc:
98-
# # containerImage: "{{ cloudkitty_proc_image }}"
99-
# containerImage: "quay.io/efoley/cloudkitty-processor@sha256:4ddd2f824b17c0c2fb39363369a16af49cb2d95c07916f52e2c509ceca677de9"
100-
# target:
101-
# kind: Telemetry
102-
#
65+
- name: Make sure logs directory exists
66+
ansible.builtin.file:
67+
path: "{{ logs_dir }}"
68+
state: directory
69+
recurse: true
70+
71+
- name: Create the CloudKitty kustomization from a template
72+
ansible.builtin.template:
73+
src: "kustomize-controlplane-cloudkitty.yaml.j2"
74+
# dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-kustomize-controlplane-cloudkitty.yaml"
75+
dest: "{{ logs_dir }}/90-kustomize-controlplane-cloudkitty.yaml"
76+
77+
- name: Compare the templated and copied files
78+
ansible.builtin.command:
79+
cmd: |
80+
diff -s {{ logs_dir }}/90-kustomize-controlplane-cloudkitty.yaml {{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-kustomize-controlplane-cloudkitty.yaml
81+
register: output
82+
- debug: var=output.stdout
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
namespace: openstack
5+
patches:
6+
- patch: |-
7+
apiVersion: core.openstack.org/v1beta1
8+
kind: OpenStackControlPlane
9+
metadata:
10+
name: unused
11+
spec:
12+
# Set overall storage class so we don't need to increase the
13+
# number of PVCs that install_yamls creates
14+
# this is only applicable to crc-based jobs, it is not in
15+
# openshift by default, but is included in the crc distribution
16+
storageClass: crc-csi-hostpath-provisioner
17+
telemetry:
18+
# this is needed so the secrets are created for dataplane deployment
19+
enabled: true
20+
template:
21+
cloudkitty:
22+
enabled: true
23+
cloudKittyAPI:
24+
containerImage: {{ telemetry_registry }}/openstack-cloudkitty-api:{{ telemetry_tag }}
25+
cloudKittyProc:
26+
containerImage: {{ telemetry_registry }}/openstack-cloudkitty-processor:{{ telemetry_tag }}
27+
s3StorageConfig:
28+
secret:
29+
type: "s3"
30+
name: "cloudkitty-loki-s3"
31+
metricStorage:
32+
enabled: true
33+
target:
34+
kind: OpenStackControlPlane

0 commit comments

Comments
 (0)