Copy service "name" {
containers {
app "web_app" {
image = "nginx:latest"
type = "Deployment"
replicas = 3
command = ["/bin/sh"]
args = ["-c", "nginx -g 'daemon off;'"]
working_dir = "/usr/share/nginx/html"
readiness_probe = {
http_get = {
path = "/healthz"
port = 80
}
initial_delay_seconds = 5
period_seconds = 10
}
resources = {
limits = {
cpu = "500m"
memory = "512Mi"
}
requests = {
cpu = "250m"
memory = "256Mi"
}
}
empty_dir_volumes = [
{
name = "cache"
size_limit = "1Gi"
}
]
volume_mounts = [
{
name = "cache"
mountPath = "/cache"
}
]
ports = [
{
container_port = 80
service_port = 80
}
]
service = {
type = "LoadBalancer"
annotations = {
"service.beta.kubernetes.io/aws-load-balancer-type" = "nlb"
}
}
node_selector = {
"kubernetes.io/os" = "linux"
"node-type" = "web"
}
auto_scaling = {
min_replicas = 2
max_replicas = 10
target_cpu_utilization_percentage = 80
}
}
}
}