Skip to content

Commit

Permalink
storage class name added to variables
Browse files Browse the repository at this point in the history
  • Loading branch information
cyucelen committed Oct 12, 2019
1 parent fac4cc5 commit 51790b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
resource "kubernetes_service" "cassandra" {
metadata {
name = "${var.cassandra_name}"
name = "${var.cassandra_name}"
namespace = "${var.namespace}"
labels = { app = "${var.cassandra_name}"}
labels = { app = "${var.cassandra_name}" }
}
spec {
port {
Expand Down Expand Up @@ -30,22 +30,22 @@ resource "kubernetes_service" "cassandra" {
port = 9160
target_port = "9160"
}
selector = { app = "${var.cassandra_name}"}
selector = { app = "${var.cassandra_name}" }
cluster_ip = "None"
type = "ClusterIP"
}
}

resource "kubernetes_stateful_set" "cassandra" {
metadata {
name = "${var.cassandra_name}"
name = "${var.cassandra_name}"
namespace = "${var.namespace}"
labels = { app = "${var.cassandra_name}" }
labels = { app = "${var.cassandra_name}" }
}
spec {
replicas = "${var.cluster_size}"
selector {
match_labels = { app = "${var.cassandra_name}"}
match_labels = { app = "${var.cassandra_name}" }
}
template {
metadata {
Expand Down Expand Up @@ -150,8 +150,8 @@ resource "kubernetes_stateful_set" "cassandra" {
labels = { app = "${var.cassandra_name}" }
}
spec {
access_modes = ["ReadWriteOnce"]
storage_class_name = "generic"
access_modes = ["ReadWriteOnce"]
storage_class_name = "${var.storage_class_name}"
resources {
requests = { storage = "${var.storage_size}" }
}
Expand Down
3 changes: 3 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ variable "namespace" {}
variable "cassandra_name" {}
variable "cluster_size" {}
variable "storage_size" {}
variable "storage_class_name" {
default = "standard"
}

0 comments on commit 51790b5

Please sign in to comment.