future-student-37410
09/06/2022, 8:32 AM{
ApiVersion = "apps/v1",
Kind = "Deployment",
Metadata = new ObjectMetaArgs
{
Name = "redis-deployment",
Labels =
{
{ "app", "redis" },
},
},
Spec = new DeploymentSpecArgs
{
Replicas = 1,
Selector = new LabelSelectorArgs
{
MatchLabels =
{
{ "app", "redis" },
},
},
Template = new PodTemplateSpecArgs
{
Metadata = new ObjectMetaArgs
{
Labels =
{
{ "app", "redis" },
},
Annotations =
{
{ "<http://dapr.io/enabled|dapr.io/enabled>", "true" },
{ "<http://dapr.io/app-id|dapr.io/app-id>", "redis" },
{ "<http://dapr.io/app-port|dapr.io/app-port>", "6379" },
{ "<http://dapr.io/enable-api-logging|dapr.io/enable-api-logging>", "true" }
},
},
Spec = new PodSpecArgs
{
Containers =
{
new ContainerArgs
{
Name = "redis-message-broker",
Image = "<http://registry.hub.docker.com/library/redis:latest|registry.hub.docker.com/library/redis:latest>",
ImagePullPolicy = "Always",
},
},
},
},
},
}, new CustomResourceOptions()
{
Parent = this
});
How do I get the Redis secret key out of this deployment?
The other problem is, that I don't know how to translate the dapr component yaml file into Pulumi resources. The Pulumi converter throws an error saying it is not able to convert. The yaml file looks like this:
apiVersion: <http://dapr.io/v1alpha1|dapr.io/v1alpha1>
kind: Component
metadata:
name: pubsub
namespace: default
spec:
type: pubsub.redis
version: v1
metadata:
- name: redisHost
value: <REPLACE WITH HOSTNAME FROM ABOVE - for Redis on Kubernetes it is redis-master.default.svc.cluster.local:6379>
- name: redisPassword
secretKeyRef:
name: redis
key: redis-password
# uncomment below for connecting to redis cache instances over TLS (ex - Azure Redis Cache)
# - name: enableTLS
# value: true
source: https://docs.dapr.io/getting-started/tutorials/configure-state-pubsub/#next-steps
Did anyone of you deploy the Dapr Pub/Sub with Redis already?No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by