Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add consumer name to daemon bootstrap and add fixes #40

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion bootstrap/daemon/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ resource "kubernetes_config_map_v1" "fabric_daemon_config" {
"daemon.toml" = "${templatefile(
"${path.module}/daemon.toml.tftpl",
{
broker_urls = var.broker_urls
broker_urls = var.broker_urls
consumer_name = var.consumer_name
}
)}"
}
Expand Down
1 change: 1 addition & 0 deletions bootstrap/daemon/daemon.toml.tftpl
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
brokers="${broker_urls}"
consumer_name="${consumer_name}"
4 changes: 4 additions & 0 deletions bootstrap/daemon/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ variable "broker_urls" {
description = "Comma separated values of the queue broker urls."
}

variable "consumer_name" {
type = string
}

variable "replicas" {
type = number
default = 1
Expand Down
9 changes: 9 additions & 0 deletions bootstrap/queue/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ variable "instance_name" {
type = string
}

variable "external_dns" {
type = string
}

variable "external_port" {
type = string
default = 9092
}

variable "topology_zone" {
type = string
default = null
Expand Down
24 changes: 1 addition & 23 deletions bootstrap/queue/sts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
"--kafka-addr",
"internal://${var.instance_name}-0:${local.kafka_internal_port},external://0.0.0.0:${local.kafka_external_port}",
"--advertise-kafka-addr",
"internal://${var.instance_name}:${local.kafka_internal_port},external://${var.instance_name}:${local.kafka_external_port}",
"internal://${var.instance_name}:${local.kafka_internal_port},external://${var.external_dns}:${var.external_port}",
"--pandaproxy-addr",
"internal://${var.instance_name}-0:${local.pandaproxy_internal_port},external://0.0.0.0:${local.pandaproxy_external_port}",
"--advertise-pandaproxy-addr",
Expand Down Expand Up @@ -83,28 +83,6 @@ resource "kubernetes_stateful_set_v1" "queue_main" {
memory = var.resources.requests.memory
}
}

# lifecycle {
# post_start {
# exec {
# # command = [
# # "rpk",
# # "-X",
# # "brokers=${var.instance_name}:${local.kafka_external_port}",
# # "topic",
# # "create",
# # "events"
# # ]
#
# command = [
# "sh", "-c", <<-EOT
# sleep 1
# rpk -X brokers=fabric-queue-0:9092 topic create events
# EOT
# ]
# }
# }
# }
}

dynamic "toleration" {
Expand Down
4 changes: 3 additions & 1 deletion bootstrap/services/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ resource "kubernetes_ingress_v1" "fabric-rpc-ingress" {
namespace = var.namespace
annotations = {
"cert-manager.io/cluster-issuer" = "letsencrypt"
"nginx.ingress.kubernetes.io/backend-protocol" : "GRPC"
}
}

Expand All @@ -70,7 +71,8 @@ resource "kubernetes_ingress_v1" "fabric-rpc-ingress" {
}
}
tls {
hosts = ["rpc.${var.dns_zone}"]
hosts = ["rpc.${var.dns_zone}"]
secret_name = "rpc-tls"
}
}
}
Loading