Declarative Infrastructure as Code (IaC) ensures repeatable deployments and seamless cloud environment promotion across staging and production.
Terraform Kubernetes Deployment Module
resource "kubernetes_deployment" "api_gateway" {
metadata {
name = "api-gateway-deployment"
labels = {
app = "api-gateway"
}
}
spec {
replicas = 3
selector {
match_labels = {
app = "api-gateway"
}
}
template {
metadata {
labels = {
app = "api-gateway"
}
}
spec {
container {
image = "myregistry.io/api-gateway:v1.2.0"
name = "gateway"
resources {
limits = {
cpu = "500m"
memory = "512Mi"
}
requests = {
cpu = "250m"
memory = "256Mi"
}
}
}
}
}
}
}