1apiVersion: bigquery.cnrm.cloud.google.com/v1beta1
2kind: BigQueryDataset
3metadata:
4 name: ctlfishpubsub
5 namespace: ctlfish-infra
6 annotations:
7 cnrm.cloud.google.com/project-id: ${gcp_project_id}
8 cnrm.cloud.google.com/state-into-spec: merge
9 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z"
10 pallet.edge.ncr.com/name: ctlfish-instance-infra
11 pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1
12 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1
13 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product'
14 pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a
15 labels:
16 cluster_hash: ${cluster_hash}
17 cluster_uuid: ${cluster_uuid}
18spec:
19 defaultPartitionExpirationMs: 43200000
20---
21apiVersion: bigquery.cnrm.cloud.google.com/v1beta1
22kind: BigQueryTable
23metadata:
24 name: ctlfishpubsub
25 namespace: ctlfish-infra
26 annotations:
27 cnrm.cloud.google.com/project-id: ${gcp_project_id}
28 cnrm.cloud.google.com/state-into-spec: merge
29 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z"
30 pallet.edge.ncr.com/name: ctlfish-instance-infra
31 pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1
32 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1
33 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product'
34 pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a
35 labels:
36 cluster_hash: ${cluster_hash}
37 cluster_uuid: ${cluster_uuid}
38spec:
39 datasetRef:
40 name: ctlfishpubsub
41 description: "pubsub table for bq"
42 schema: |
43 [
44 {
45 "description":"timestamp",
46 "mode":"REQUIRED",
47 "name":"timestamp",
48 "type":"TIMESTAMP"
49 },
50 {
51 "description":"cluster_name",
52 "mode":"REQUIRED",
53 "name":"cluster_name",
54 "type":"STRING"
55 },
56 {
57 "description":"project_id",
58 "mode":"REQUIRED",
59 "name":"project_id",
60 "type":"STRING"
61 },
62 {
63 "description":"group",
64 "mode":"REQUIRED",
65 "name":"group",
66 "type":"STRING"
67 },
68 {
69 "description":"version",
70 "mode":"REQUIRED",
71 "name":"version",
72 "type":"STRING"
73 },
74 {
75 "description":"kind",
76 "mode":"REQUIRED",
77 "name":"kind",
78 "type":"STRING"
79 },
80 {
81 "description":"name",
82 "mode":"REQUIRED",
83 "name":"name",
84 "type":"STRING"
85 },
86 {
87 "description":"namespace",
88 "mode":"REQUIRED",
89 "name":"namespace",
90 "type":"STRING"
91 },
92 {
93 "description":"operation",
94 "mode":"REQUIRED",
95 "name":"operation",
96 "type":"STRING"
97 },
98 {
99 "description":"cluster_id",
100 "mode":"REQUIRED",
101 "name":"cluster_id",
102 "type":"STRING"
103 },
104 {
105 "description":"cluster_edge_id",
106 "mode":"REQUIRED",
107 "name":"cluster_edge_id",
108 "type":"STRING"
109 },
110 {
111 "description":"resource",
112 "mode":"REQUIRED",
113 "name":"resource",
114 "type":"STRING"
115 }
116 ]
117 timePartitioning:
118 type: DAY
119 field: timestamp
120---
121apiVersion: bigquery.cnrm.cloud.google.com/v1beta1
122kind: BigQueryTable
123metadata:
124 name: ctlfishpubsub-resources
125 namespace: ctlfish-infra
126 annotations:
127 cnrm.cloud.google.com/project-id: ${gcp_project_id}
128 cnrm.cloud.google.com/state-into-spec: merge
129 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z"
130 pallet.edge.ncr.com/name: ctlfish-instance-infra
131 pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1
132 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1
133 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product'
134 pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a
135 labels:
136 cluster_hash: ${cluster_hash}
137 cluster_uuid: ${cluster_uuid}
138spec:
139 datasetRef:
140 name: ctlfishpubsub
141 description: "a view for latest resources"
142 friendlyName: resources
143 resourceID: resources
144 view:
145 query: |
146 SELECT
147 timestamp,
148 project_id,
149 cluster_name,
150 cluster_edge_id,
151 kind,
152 k8s_group,
153 version,
154 name,
155 namespace,
156 CAST(operation [safe_OFFSET(0)] AS string) AS operation,
157 CAST(resource [safe_OFFSET(0)] AS string) AS resource
158 FROM
159 ${gcp_project_id}.ctlfishpubsub.latest
160 useLegacySql: false
161---
162apiVersion: bigquery.cnrm.cloud.google.com/v1beta1
163kind: BigQueryTable
164metadata:
165 name: latest
166 namespace: ctlfish-infra
167 annotations:
168 cnrm.cloud.google.com/project-id: ${gcp_project_id}
169 cnrm.cloud.google.com/state-into-spec: merge
170 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z"
171 pallet.edge.ncr.com/name: ctlfish-instance-infra
172 pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1
173 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1
174 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product'
175 pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a
176 labels:
177 cluster_hash: ${cluster_hash}
178 cluster_uuid: ${cluster_uuid}
179spec:
180 datasetRef:
181 name: ctlfishpubsub
182 description: "a materialized view for edge resources"
183 materializedView:
184 enableRefresh: true
185 query: |
186 SELECT
187 t.project_id AS project_id,
188 t.cluster_name AS cluster_name,
189 t.cluster_edge_id AS cluster_edge_id,
190 t.kind AS kind,
191 t.group AS k8s_group,
192 t.version AS version,
193 t.name AS name,
194 t.namespace AS namespace,
195 MAX(t.timestamp) AS timestamp,
196 ARRAY_AGG(t.resource IGNORE NULLS
197 ORDER BY
198 t.timestamp DESC
199 LIMIT
200 1) AS resource,
201 ARRAY_AGG(t.operation IGNORE NULLS
202 ORDER BY
203 t.timestamp DESC
204 LIMIT
205 1) AS operation
206 FROM
207 ${gcp_project_id}.ctlfishpubsub.ctlfishpubsub AS t
208 GROUP BY
209 t.project_id,
210 t.cluster_name,
211 t.cluster_edge_id,
212 t.kind,
213 t.group,
214 t.version,
215 t.name,
216 t.namespace
217 refreshIntervalMs: 1800000
218---
219apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
220kind: PubSubTopic
221metadata:
222 name: ctlfish-pubsub
223 namespace: ctlfish-infra
224 annotations:
225 cnrm.cloud.google.com/project-id: ${gcp_project_id}
226 cnrm.cloud.google.com/state-into-spec: merge
227 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z"
228 pallet.edge.ncr.com/name: ctlfish-instance-infra
229 pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1
230 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1
231 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product'
232 pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a
233 labels:
234 cluster_hash: ${cluster_hash}
235 cluster_uuid: ${cluster_uuid}
View as plain text