Skip to content

Instantly share code, notes, and snippets.

@gmaliar
Created February 2, 2019 12:57
Show Gist options
  • Save gmaliar/abaf147735e1c2122e67ce81c411e2d2 to your computer and use it in GitHub Desktop.
Save gmaliar/abaf147735e1c2122e67ce81c411e2d2 to your computer and use it in GitHub Desktop.
resource "kubernetes_role_binding" "etcd-operator-role-binding" {
metadata {
name = "etcd-operator"
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "Role"
name = "etcd-operator"
}
subject {
api_group = ""
kind = "ServiceAccount"
name = "default"
namespace = "default"
}
}
resource "kubernetes_role" "etcd-operator-role" {
metadata {
name = "etcd-operator"
}
rule {
api_groups = ["etcd.database.coreos.com"]
resources = ["etcdclusters", "etcdbackups", "etcdrestores"]
verbs = ["*"]
}
rule {
api_groups = [""]
resources = ["pods", "services", "endpoints", "persistentvolumeclaims", "events"]
verbs = ["*"]
}
rule {
api_groups = ["apps"]
resources = ["deployments"]
verbs = ["*"]
}
provisioner "local-exec" {
command = "kubectl apply -f https://gist.githubusercontent.com/gmaliar/9e339b8e829858a29996023f2e903dc1/raw/39a95661db321a8031743d4237c8e5be188be0e0/etcd.yml"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment