Skip to content

Instantly share code, notes, and snippets.

@YurgenUA
Last active January 17, 2024 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YurgenUA/dc82633b2c52786cfee265fc4c9c38e3 to your computer and use it in GitHub Desktop.
Save YurgenUA/dc82633b2c52786cfee265fc4c9c38e3 to your computer and use it in GitHub Desktop.
resource "kubernetes_deployment" "demo" {
metadata {
name = "demo-dp"
namespace = kubernetes_namespace.playground.id
}
spec {
replicas = 1
selector {
match_labels = {
app = "demo-lb"
}
}
template {
metadata {
labels = {
app = "demo-lb"
}
}
spec {
service_account_name = kubernetes_service_account.secret_privileged.metadata[0].name
automount_service_account_token = true
container {
name = "bibinwilson"
image = "bibinwilson/docker-kubectl:latest"
volume_mount {
mount_path = "/etc/sensitive"
name = "sensitive-vl"
read_only = true
}
}
volume {
name = "sensitive-vl"
secret {
secret_name = kubernetes_secret.top_secret.metadata[0].name
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment