apiVersion: bigquery.cnrm.cloud.google.com/v1beta1 kind: BigQueryDataset metadata: name: ctlfishpubsub namespace: ctlfish-infra annotations: cnrm.cloud.google.com/project-id: ${gcp_project_id} cnrm.cloud.google.com/state-into-spec: merge pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: ctlfish-instance-infra pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: cluster_hash: ${cluster_hash} cluster_uuid: ${cluster_uuid} spec: defaultPartitionExpirationMs: 43200000 --- apiVersion: bigquery.cnrm.cloud.google.com/v1beta1 kind: BigQueryTable metadata: name: ctlfishpubsub namespace: ctlfish-infra annotations: cnrm.cloud.google.com/project-id: ${gcp_project_id} cnrm.cloud.google.com/state-into-spec: merge pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: ctlfish-instance-infra pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: cluster_hash: ${cluster_hash} cluster_uuid: ${cluster_uuid} spec: datasetRef: name: ctlfishpubsub description: "pubsub table for bq" schema: | [ { "description":"timestamp", "mode":"REQUIRED", "name":"timestamp", "type":"TIMESTAMP" }, { "description":"cluster_name", "mode":"REQUIRED", "name":"cluster_name", "type":"STRING" }, { "description":"project_id", "mode":"REQUIRED", "name":"project_id", "type":"STRING" }, { "description":"group", "mode":"REQUIRED", "name":"group", "type":"STRING" }, { "description":"version", "mode":"REQUIRED", "name":"version", "type":"STRING" }, { "description":"kind", "mode":"REQUIRED", "name":"kind", "type":"STRING" }, { "description":"name", "mode":"REQUIRED", "name":"name", "type":"STRING" }, { "description":"namespace", "mode":"REQUIRED", "name":"namespace", "type":"STRING" }, { "description":"operation", "mode":"REQUIRED", "name":"operation", "type":"STRING" }, { "description":"cluster_id", "mode":"REQUIRED", "name":"cluster_id", "type":"STRING" }, { "description":"cluster_edge_id", "mode":"REQUIRED", "name":"cluster_edge_id", "type":"STRING" }, { "description":"resource", "mode":"REQUIRED", "name":"resource", "type":"STRING" } ] timePartitioning: type: DAY field: timestamp --- apiVersion: bigquery.cnrm.cloud.google.com/v1beta1 kind: BigQueryTable metadata: name: ctlfishpubsub-resources namespace: ctlfish-infra annotations: cnrm.cloud.google.com/project-id: ${gcp_project_id} cnrm.cloud.google.com/state-into-spec: merge pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: ctlfish-instance-infra pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: cluster_hash: ${cluster_hash} cluster_uuid: ${cluster_uuid} spec: datasetRef: name: ctlfishpubsub description: "a view for latest resources" friendlyName: resources resourceID: resources view: query: | SELECT timestamp, project_id, cluster_name, cluster_edge_id, kind, k8s_group, version, name, namespace, CAST(operation [safe_OFFSET(0)] AS string) AS operation, CAST(resource [safe_OFFSET(0)] AS string) AS resource FROM ${gcp_project_id}.ctlfishpubsub.latest useLegacySql: false --- apiVersion: bigquery.cnrm.cloud.google.com/v1beta1 kind: BigQueryTable metadata: name: latest namespace: ctlfish-infra annotations: cnrm.cloud.google.com/project-id: ${gcp_project_id} cnrm.cloud.google.com/state-into-spec: merge pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: ctlfish-instance-infra pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: cluster_hash: ${cluster_hash} cluster_uuid: ${cluster_uuid} spec: datasetRef: name: ctlfishpubsub description: "a materialized view for edge resources" materializedView: enableRefresh: true query: | SELECT t.project_id AS project_id, t.cluster_name AS cluster_name, t.cluster_edge_id AS cluster_edge_id, t.kind AS kind, t.group AS k8s_group, t.version AS version, t.name AS name, t.namespace AS namespace, MAX(t.timestamp) AS timestamp, ARRAY_AGG(t.resource IGNORE NULLS ORDER BY t.timestamp DESC LIMIT 1) AS resource, ARRAY_AGG(t.operation IGNORE NULLS ORDER BY t.timestamp DESC LIMIT 1) AS operation FROM ${gcp_project_id}.ctlfishpubsub.ctlfishpubsub AS t GROUP BY t.project_id, t.cluster_name, t.cluster_edge_id, t.kind, t.group, t.version, t.name, t.namespace refreshIntervalMs: 1800000 --- apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 kind: PubSubTopic metadata: name: ctlfish-pubsub namespace: ctlfish-infra annotations: cnrm.cloud.google.com/project-id: ${gcp_project_id} cnrm.cloud.google.com/state-into-spec: merge pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: ctlfish-instance-infra pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/edge-product' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: cluster_hash: ${cluster_hash} cluster_uuid: ${cluster_uuid}