robobunny173
12/20/2023, 6:46 PMspicedb-backend
.
- I have a User configured with that database on CloudSql
(more info coming in thread)robobunny173
12/20/2023, 6:46 PMconst spiceClusters = new kubernetes.apiextensions.CustomResource(
'spicedb-clusters',
{
apiVersion: 'authzed.com/v1alpha1',
kind: 'SpiceDBCluster',
metadata: {
name: 'spicedb-cluster',
},
spec: {
config: {
replicas: 2,
loglevel: 'debug',
datastoreEngine: 'postgres',
},
secretName: 'spicedb-config',
},
},
{ provider, dependsOn: [spiceDBConfig] }
);
robobunny173
12/20/2023, 6:46 PMspiceDBConfig
secret:
const spiceDBConfig = new kubernetes.core.v1.Secret(
'spicedb-config',
{
metadata: {
name: 'spicedb-config',
},
stringData: {
preshared_key: sqlUser.password.apply(p=> p ?? ''),
datastore_uri: fullDBUri,
},
},
{ provider }
);
robobunny173
12/20/2023, 6:46 PMdatastore_uri
string.
If I make the fullDbUri
string look like this:
const fullDBUri = pulumi.interpolate`postgresql://${sqlUser.name}:${sqlUser.password}@${postgres.privateIpAddress}:5432/${postgresDb.name}`;
Then I get an error that looks like this in the migration pod that's created:
unable to create migration driver for postgres: failed to connect to `host=spicedb-sql-user user=nonroot database=`: hostname resolving error (lookup spicedb-sql-user on 10.8.240.10:53: no such host)
Note that 10.8.240.10 is NOT the internal IP of my postgres instance (weird). Also It's taking the username as the host and can't figure out the database name??robobunny173
12/20/2023, 6:46 PMfullDbUri
look like this (with just username):
const fullDBUri = pulumi.interpolate`postgresql://${sqlUser.name}@${postgres.privateIpAddress}:5432/${postgresDb.name}`;
Then I see this error in the migration pod:
unable to create migration driver for postgres: failed to connect to `host=<CORRECT_IP> user=spicedb-sql-user database=spicedb-backend`: failed SASL auth (FATAL: password authentication failed for user "spicedb-sql-user" (SQLSTATE 28P01))
Note that it seems the connection string is being parsed correctly here: host, user, and database are all correct. I think I'm passing Spice my password via the preshared_key
bit in the configs but maybe that's not the case.robobunny173
12/20/2023, 6:47 PMJoey
12/20/2023, 6:51 PMrobobunny173
12/20/2023, 6:58 PM?sslmode=disable
to the uri stringsecordell
12/20/2023, 7:09 PMecordell
12/20/2023, 7:09 PMecordell
12/20/2023, 7:10 PMrobobunny173
12/20/2023, 7:29 PMrobobunny173
12/20/2023, 7:29 PMrobobunny173
12/20/2023, 7:31 PMrobobunny173
12/20/2023, 7:32 PMecordell
12/20/2023, 7:42 PMrobobunny173
12/20/2023, 7:50 PMhttps://github.com/authzed/spicedb-operator/tree/main/config
instead of this release. Maybe that was the problem.robobunny173
12/20/2023, 7:54 PMrobobunny173
12/20/2023, 8:02 PMhttps://github.com/authzed/spicedb-operator/releases/download/v1.12.0/bundle.yaml
or https://github.com/authzed/spicedb-operator/config?ref=v1.12.0
... but that seems like a pulumi problem, not a spice problem.robobunny173
12/21/2023, 1:07 AMrobobunny173
12/21/2023, 1:09 AM