Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-tools/cncluster
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ function _check_stateful_sets() {
# Checks if any StatefulSets EXCEPT those with a prometheus image (which are part of the infra stack)
# are currently deployed
# grep exits with return code 1 if it finds no matches so we account for that
query_result=$(kubectl get StatefulSets -A -o json 2> /dev/null | jq '.items[].spec.template.spec.containers[].image' | { grep -v prometheus || test $? = 1; })
query_result=$(kubectl get StatefulSets -A -o json 2> /dev/null | jq '.items[].spec.template.spec.containers[].image' | grep -v postgres | { grep -v prometheus || test $? = 1; })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is filtering out postgres ok? Isn't this one of the main stateful sets we have? It seems like we really should just filter out everything in the observability namespace no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will push a fix for that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed

echo "$query_result"
}

Expand Down
8 changes: 0 additions & 8 deletions cluster/expected/canton-network/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@
"provider": "",
"type": "kubernetes:core/v1:Secret"
},
{
"custom": true,
"id": "projects/test-project/global/networks/default",
"inputs": {},
"name": "default",
"provider": "",
"type": "gcp:compute/network:Network"
},
{
"custom": true,
"id": "",
Expand Down
8 changes: 0 additions & 8 deletions cluster/expected/deployment/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,6 @@
"provider": "",
"type": "kubernetes:pulumi.com/v1:Stack"
},
{
"custom": true,
"id": "projects/test-project/global/networks/default",
"inputs": {},
"name": "default",
"provider": "",
"type": "gcp:compute/network:Network"
},
{
"custom": true,
"id": "",
Expand Down
107 changes: 106 additions & 1 deletion cluster/expected/infra/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,28 @@
"provider": "",
"type": "kubernetes:core/v1:Namespace"
},
{
"custom": true,
"id": "",
"inputs": {
"apiVersion": "v1",
"data": {
"4dabf18193072939515e22adb298388d": "1b47061264138c4ac30d75fd1eb44270",
"value": {
"postgresPassword": ""
}
},
"kind": "Secret",
"metadata": {
"name": "grafana-pg-secret",
"namespace": "observability"
},
"type": "Opaque"
},
"name": "cn-app-observability-grafana-pg-secret",
"provider": "",
"type": "kubernetes:core/v1:Secret"
},
{
"custom": true,
"id": "",
Expand Down Expand Up @@ -2404,6 +2426,80 @@
"provider": "",
"type": "gcp:compute/routerNat:RouterNat"
},
{
"custom": true,
"id": "",
"inputs": {
"length": 16,
"overrideSpecial": "_%@",
"special": true
},
"name": "observability-grafana-pg-passwd",
"provider": "",
"type": "random:index/randomPassword:RandomPassword"
},
{
"custom": false,
"id": "",
"inputs": {},
"name": "observability-grafana-pg",
"provider": "",
"type": "canton:network:postgres"
},
{
"custom": true,
"id": "",
"inputs": {
"chart": "oci://ghcr.io/digital-asset/decentralized-canton-sync-dev/helm/splice-postgres",
"compat": "true",
"maxHistory": 10,
"name": "grafana-pg",
"namespace": "observability",
"timeout": 600,
"values": {
"affinity": {
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "cn_apps",
"operator": "Exists"
}
]
}
]
}
}
},
"cluster": {
"dnsName": "mock.global.canton.network.digitalasset.com",
"fixedTokens": false,
"hostname": "mock.global.canton.network.digitalasset.com",
"name": "cn-mocknet"
},
"db": {
"volumeSize": "20Gi"
},
"imageRepo": "us-central1-docker.pkg.dev/da-cn-shared/ghcr/digital-asset/decentralized-canton-sync-dev/docker",
"persistence": {
"secretName": "grafana-pg-secret"
},
"tolerations": [
{
"effect": "NoSchedule",
"key": "cn_apps",
"operator": "Exists"
}
]
},
"version": "0.3.20"
},
"name": "observability-grafana-pg",
"provider": "",
"type": "kubernetes:helm.sh/v3:Release"
},
{
"custom": true,
"id": "",
Expand Down Expand Up @@ -2512,6 +2608,7 @@
"coreDns": {
"enabled": false
},
"database": {},
"defaultRules": {
"create": true
},
Expand Down Expand Up @@ -2608,8 +2705,16 @@
"deploymentStrategy": {
"type": "Recreate"
},
"envFromSecret": "grafana-pg-secret",
"fullnameOverride": "grafana",
"grafana.ini": {
"database": {
"host": "grafana-pg.observability.svc.cluster.local:5432",
"name": "cantonnet",
"password": "${postgresPassword}",
"type": "postgres",
"user": "cnadmin"
},
"date_formats": {
"default_timezone": "UTC"
},
Expand Down Expand Up @@ -2981,7 +3086,7 @@
"name": "observability"
}
},
"name": "observabilty",
"name": "observability",
"provider": "",
"type": "kubernetes:core/v1:Namespace"
},
Expand Down
8 changes: 0 additions & 8 deletions cluster/expected/splitwell/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@
"provider": "",
"type": "kubernetes:core/v1:Secret"
},
{
"custom": true,
"id": "projects/test-project/global/networks/default",
"inputs": {},
"name": "default",
"provider": "",
"type": "gcp:compute/network:Network"
},
{
"custom": true,
"id": "",
Expand Down
8 changes: 0 additions & 8 deletions cluster/expected/sv-canton/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -837,14 +837,6 @@
"provider": "",
"type": "kubernetes:core/v1:Secret"
},
{
"custom": true,
"id": "projects/test-project/global/networks/default",
"inputs": {},
"name": "default",
"provider": "",
"type": "gcp:compute/network:Network"
},
{
"custom": true,
"id": "",
Expand Down
8 changes: 0 additions & 8 deletions cluster/expected/sv-runbook/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,6 @@
"provider": "",
"type": "kubernetes:core/v1:Secret"
},
{
"custom": true,
"id": "projects/test-project/global/networks/default",
"inputs": {},
"name": "default",
"provider": "",
"type": "gcp:compute/network:Network"
},
{
"custom": true,
"id": "",
Expand Down
8 changes: 0 additions & 8 deletions cluster/expected/validator-runbook/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@
"provider": "",
"type": "kubernetes:core/v1:Secret"
},
{
"custom": true,
"id": "projects/test-project/global/networks/default",
"inputs": {},
"name": "default",
"provider": "",
"type": "gcp:compute/network:Network"
},
{
"custom": true,
"id": "",
Expand Down
8 changes: 0 additions & 8 deletions cluster/expected/validator1/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@
"provider": "",
"type": "kubernetes:core/v1:Secret"
},
{
"custom": true,
"id": "projects/test-project/global/networks/default",
"inputs": {},
"name": "default",
"provider": "",
"type": "gcp:compute/network:Network"
},
{
"custom": true,
"id": "",
Expand Down
6 changes: 3 additions & 3 deletions cluster/pulumi/canton-network/src/bigQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
Postgres,
CloudPostgres,
generatePassword,
privateNetwork,
privateNetworkId,
protectCloudSql,
} from '@lfdecentralizedtrust/splice-pulumi-common/src/postgres';
import {
Expand Down Expand Up @@ -367,7 +367,7 @@ function installPrivateConnectivityConfiguration(
privateConnectionId: privateConnectionName,
displayName: privateConnectionName,
location: cloudsdkComputeRegion(),
vpcPeeringConfig: { subnet: pickDatastreamPeeringCidr(), vpc: privateNetwork.id },
vpcPeeringConfig: { subnet: pickDatastreamPeeringCidr(), vpc: privateNetworkId },
labels: {
cluster: CLUSTER_BASENAME,
},
Expand Down Expand Up @@ -450,7 +450,7 @@ function createPublicationAndReplicationSlots(
const schemaName = dbName;
const path = commandScriptPath('cluster/pulumi/canton-network/bigquery-cloudsql.sh');
const scriptArgs = pulumi.interpolate`\\
--private-network-project="${privateNetwork.project}" \\
--private-network-project="${gcp.organizations.getProjectOutput({})}" \\
--compute-region="${cloudsdkComputeRegion()}" \\
--service-account-email="${postgres.databaseInstance.serviceAccountEmailAddress}" \\
--tables-to-replicate-length="${tablesToReplicate.length}" \\
Expand Down
7 changes: 2 additions & 5 deletions cluster/pulumi/common/src/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ const cloudSqlEnterprisePlus = spliceConfig.pulumiProjectConfig.cloudSql.enterpr
const project = gcp.organizations.getProjectOutput({});

// use existing default network (needs to have a private vpc connection)
export const privateNetwork = gcp.compute.Network.get(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In infra stack, we're already creating this resource, so when this is imported from infra stack, it triggers a duplicate resource error. AFAICT, all we need from here is the ID, so no real point in even creating this resource.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds plausible

'default',
pulumi.interpolate`projects/${project.name}/global/networks/default`
);
export const privateNetworkId = pulumi.interpolate`projects/${project.name}/global/networks/default`;

export function generatePassword(
name: string,
Expand Down Expand Up @@ -120,7 +117,7 @@ export class CloudPostgres extends pulumi.ComponentResource implements Postgres
: undefined),
ipConfiguration: {
ipv4Enabled: false,
privateNetwork: privateNetwork.id,
privateNetwork: privateNetworkId,
enablePrivatePathForGoogleCloudServices: true,
},
userLabels: opts.migrationId
Expand Down
3 changes: 2 additions & 1 deletion cluster/pulumi/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"@pulumi/auth0": "3.21.0",
"@pulumi/kubernetes-cert-manager": "0.2.0",
"@pulumiverse/grafana": "0.16.3",
"@lfdecentralizedtrust/splice-pulumi-common": "1.0.0"
"@lfdecentralizedtrust/splice-pulumi-common": "1.0.0",
"@pulumi/gcp": "8.32.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure why having this in common did not suffice, but it didn't...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm 🤷

},
"overrides": {
"@pulumi/kubernetes-cert-manager": {
Expand Down
Loading