Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
add replicas as variable
Browse files Browse the repository at this point in the history
  • Loading branch information
broadeditz committed Oct 5, 2023
1 parent b70e5e1 commit 0af68e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion terraform/irc-reader/config.template.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
loglevel: info
replicas: %{replicas}
replicas: ${replicas}

ratelimit:
join: ${ratelimit_join}
Expand Down
4 changes: 2 additions & 2 deletions terraform/irc-reader/irc-reader.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "kubernetes_secret" "app" {

data = {
"config.yaml" = templatefile("${path.module}/config.template.yaml", {
replicas = 3
replicas = var.replicas
twitch_username = var.twitch_username
twitch_oauth = join(":", ["oauth", base64decode(data.kubernetes_secret.oauth.binary_data["access-token"])])
ratelimit_join = var.ratelimit_join
Expand Down Expand Up @@ -103,7 +103,7 @@ resource "kubernetes_stateful_set" "app" {
}
}

replicas = 3
replicas = var.replicas
service_name = kubernetes_service.app.metadata[0].name

template {
Expand Down
5 changes: 5 additions & 0 deletions terraform/irc-reader/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ variable "namespace" {
default = "app"
}

variable replicas {
type = number
default = 3
}

variable "oauth_secret" {
type = string
default = ""
Expand Down

0 comments on commit 0af68e8

Please sign in to comment.