Skip to content

Commit

Permalink
Readd create topic job
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezzfelipe committed Jul 19, 2024
1 parent 92c02f1 commit 29bacd0
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 16 deletions.
72 changes: 72 additions & 0 deletions bootstrap/queue/create_topic_job.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
locals {
create_topic_job_name = "fabric-queue-create-topic"
brokers = join(",", [
for i in range(1, var.replicas) : "redpanda-${i}.${var.external_domain}:31092"
])
}

resource "kubernetes_job_v1" "fabric_queue_create_topic" {
depends_on = [helm_release.redpanda]

metadata {
name = local.create_topic_job_name
namespace = var.namespace
}
spec {
template {
metadata {
labels = {
"demeter.run/instance" = local.create_topic_job_name
}
}
spec {
security_context {
fs_group = 1000
}

container {
name = "main"
image = "docker.redpanda.com/redpandadata/redpanda:v23.3.18"
command = [
"rpk",
"-X",
"brokers=${local.brokers}",
"topic",
"create",
"events",
"-r", "3",
"-c", "cleanup.policy=compact",
"-c", "retention.ms=-1",
]
image_pull_policy = "Always"

resources {
limits = {
cpu = "500m"
memory = "512Mi"
}
requests = {
cpu = "500m"
memory = "512Mi"
}
}
}

toleration {
effect = "NoSchedule"
key = "demeter.run/compute-profile"
operator = "Equal"
value = "general-purpose"
}

toleration {
effect = "NoSchedule"
key = "demeter.run/compute-arch"
operator = "Equal"
value = "x86"
}
}
}
}

}
16 changes: 0 additions & 16 deletions bootstrap/queue/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
locals {
kafka_internal_port = 9092
kafka_external_port = 19092
pandaproxy_internal_port = 8082
pandaproxy_external_port = 18082
schema_registry_internal_port = 8081
schema_registry_external_port = 18081
rpc_port = 33145
admin_api_external_port = 19644
}

variable "namespace" {
type = string
}
Expand Down Expand Up @@ -38,11 +27,6 @@ variable "image_tag" {
default = "v23.3.18"
}

variable "console_image" {
type = string
default = "docker.redpanda.com/redpandadata/console:v2.3.1"
}

variable "resources" {
type = object({
cpu = number
Expand Down

0 comments on commit 29bacd0

Please sign in to comment.