This message was deleted.
# kubernetes
s
This message was deleted.
p
and I need to replace USERNAME and PASSWORD 🙂
I work with Pulumi, and I can manipulate the yaml before getting deployed in order to replace USERNAME and PASSWORD with the right values.
what I do not like of my current implementation is that I am binded to this deployment structure and it is very inflexible
Is there a way to pass something link another yaml to the deployment file which contains the right values and reference those?
Copy code
valueFrom:
            secretKeyRef:
              key:
can I put the pulumi config key? 🙂
k
Check out this stack
specifically,
Copy code
// Create secret from MongoDB connection string.
const mongoConnStrings = new k8s.core.v1.Secret(
    "mongo-secrets",
    {
        metadata: { name: "mongo-secrets", namespace: config.appsNamespaceName},
        data: mongoHelpers.parseConnString(cosmosdb.connectionStrings),
    },
    { provider },
);
and
Copy code
name: "WORDPRESS_DATABASE_PASSWORD",
                                valueFrom: {
                                    secretKeyRef: {
                                        name: mariadbSecret.metadata.name,
                                        key: "mariadb-password"
                                    }
                                }
from here
p
thanks @kind-mechanic-53546
@kind-mechanic-53546 This is all clear now thanks
only thing I do not understand is this
Copy code
// Create a Secret with the database credentials.
const databaseSecret = new k8s.core.v1.Secret("db-secret", {
    stringData: {
        "database-username": config.databaseUsername,
        "database-password": config.databasePassword,
    }
}, { provider: provider });
config.X
does not exists
but I can do config.get(SECRET-KEY)
but I got an error
can you help?
Copy code
const config = new pulumi.Config();
const ksqlDbSecret = new k8s.core.v1.Secret("ksqldb-secret", {
    stringData: {
        'kafka-cluster-username': config.get('kafkaApiKey'),
        'kafaka-cluster-password': config.get('kafkaApiSecret')
    }
}, { provider: clusterProvider });
that has compilation errors
Copy code
'kafka-cluster-username': config.requireSecret('kafkaApiKey'),
        'kafaka-cluster-password': config.requireSecret('kafkaApiSecret')
that sorts it 🙂
@kind-mechanic-53546 got another question
@billowy-army-68599 this does not work
Copy code
const config = new pulumi.Config();
const ksqlDbSecret = new k8s.core.v1.Secret("ksqldb-secret", {
    stringData: {
        'kafka-cluster-username': config.get('kafkaApiKey'),
        'kafaka-cluster-password': config.get('kafkaApiSecret')
    }
}, { provider: clusterProvider });
pulumi asks me to set 'kafka-cluster-username' ...?
thought it is a key : value
b
can you show the error?