Skip to content

Instantly share code, notes, and snippets.

@mdz
Created November 17, 2018 02:44
Show Gist options
  • Save mdz/8aa7fdbb27f40cba9553a8540d2a02f9 to your computer and use it in GitHub Desktop.
Save mdz/8aa7fdbb27f40cba9553a8540d2a02f9 to your computer and use it in GitHub Desktop.
resource "kubernetes_stateful_set" "eth-parity-ropsten" {
metadata {
name = "eth-parity-ropsten"
labels {
app = "eth-parity-ropsten"
}
}
spec {
replicas = 0
selector {
app = "eth-parity-ropsten"
}
service_name = "eth-parity-ropsten"
template {
metadata {
labels {
app = "eth-parity-ropsten"
}
annotations {
"kubernetes.io/egress-bandwidth" = "1M"
"prometheus.io/scrape" = "true"
"prometheus.io/port" = "8080"
}
}
spec {
init_container {
name = "set-perms"
image = "gcr.io/${var.gcp_project}/eth-parity:parity-2.0"
image_pull_policy = "Always"
security_context {
run_as_user = "0"
}
command = ["chown","-R","parity:parity","/data"]
volume_mount {
name = "parity-data"
mount_path = "/data"
}
}
container {
name = "parity"
image = "gcr.io/${var.gcp_project}/eth-parity:parity-2.0"
image_pull_policy = "Always"
args = ["--chain=ropsten",
"--jsonrpc-interface=all",
"--cache-size=2048",
"--port=30305",
"--min-peers=50",
"--max-peers=100",
"--warp-barrier=4300000"]
port {
container_port = 30305
name = "parity-p2p-tcp"
host_port = 30305
protocol = "TCP"
}
port {
container_port = 30305
name = "parity-p2p-udp"
host_port = 30305
protocol = "UDP"
}
liveness_probe {
tcp_socket {
port = 8545
}
initial_delay_seconds = 600
period_seconds = 10
}
resources {
requests {
cpu = "200m"
memory = "2Gi"
}
}
volume_mount {
name = "parity-data"
mount_path = "/home/parity/.local/share/io.parity.ethereum"
}
}
container {
name = "monitor"
image = "gcr.io/${var.gcp_project}/eth-monitor:master"
image_pull_policy = "Always"
env {
name = "ETH_URL"
value = "http://localhost:8545"
}
port {
container_port = "8080"
name = "http"
}
liveness_probe {
tcp_socket {
port = "8080"
}
initial_delay_seconds = 5
}
readiness_probe {
http_get {
path = "/healthz"
port = 8080
}
initial_delay_seconds = 5
}
resources {
requests {
cpu = "0"
}
}
}
}
}
volume_claim_templates {
metadata {
name = "parity-data"
}
spec {
access_modes = ["ReadWriteOnce"]
resources {
requests {
storage = "100Gi"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment