Skip to content

Instantly share code, notes, and snippets.

@YurgenUA
Created January 20, 2024 18:39
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/0908fb403a800b50af817e12a6cc57e4 to your computer and use it in GitHub Desktop.
Save YurgenUA/0908fb403a800b50af817e12a6cc57e4 to your computer and use it in GitHub Desktop.
resource "kubernetes_deployment" "demo-non-privileged" {
metadata {
name = "demo-non-privileged-dp"
namespace = kubernetes_namespace.playground.id
}
spec {
replicas = 1
selector {
match_labels = {
app = "demo-non-privileged-lb"
}
}
template {
metadata {
labels = {
app = "demo-non-privileged-lb"
}
}
spec {
service_account_name = kubernetes_service_account.non_privileged.metadata[0].name
automount_service_account_token = false
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