variable "namespace" {
  description = "Kubernetes namespace for this service"
  type        = string
  # Defaults to the logical environment, but can be overridden to point at an
  # existing namespace.
  default     = {{ environment | terraform_quote }}
}

variable "create_namespace" {
  description = "Whether this module should create the Kubernetes namespace (false = use existing)"
  type        = bool
  default     = true
}

variable "image" {
  description = "Container image for the service"
  type        = string
  default     = {{ "nginx:latest" | terraform_quote }}
}

variable "replicas" {
  description = "Number of pod replicas for the service"
  type        = number
  default     = {{ service.replicas }}
}

variable "port" {
  description = "Port exposed by the service (container and service port)"
  type        = number
  default     = {{ service.port }}
}

variable "cpu_limit" {
  description = "CPU limit for the container"
  type        = string
  default     = {{ service.cpu | terraform_quote }}
}

variable "memory_limit" {
  description = "Memory limit for the container"
  type        = string
  default     = {{ service.memory | terraform_quote }}
}

variable "cpu_request" {
  description = "CPU request for the container"
  type        = string
  default     = {{ "128m" | terraform_quote }}
}

variable "memory_request" {
  description = "Memory request for the container"
  type        = string
  default     = {{ "256Mi" | terraform_quote }}
}

variable "health_check_path" {
  description = "HTTP path used for liveness/readiness probes"
  type        = string
  default     = {{ "/health" | terraform_quote }}
}

variable "service_type" {
  description = "Kubernetes Service type (ClusterIP, NodePort, LoadBalancer)"
  type        = string
  default     = {{ "ClusterIP" | terraform_quote }}
}

variable "enable_autoscaling" {
  description = "Whether to enable a Horizontal Pod Autoscaler for this service"
  type        = bool
  default     = true
}

variable "min_replicas" {
  description = "Minimum number of replicas when autoscaling is enabled"
  type        = number
  default     = 1
}

variable "max_replicas" {
  description = "Maximum number of replicas when autoscaling is enabled"
  type        = number
  default     = 10
}

variable "target_cpu_utilization" {
  description = "Target CPU utilization percentage for autoscaling"
  type        = number
  default     = 70
}

variable "environment" {
  description = "Logical environment for this service (e.g., dev, staging, prod)"
  type        = string
  default     = {{ environment | terraform_quote }}
}
