82 lines
1.5 KiB
Markdown
82 lines
1.5 KiB
Markdown
# Kubernetes Namespace Module
|
|
|
|
**Purpose**: Create Kubernetes namespace with resource quotas and limit ranges
|
|
**Status**: ✅ Complete
|
|
|
|
---
|
|
|
|
## Usage
|
|
|
|
```hcl
|
|
module "namespace" {
|
|
source = "../../modules/kubernetes/namespace"
|
|
|
|
name = "my-app"
|
|
|
|
labels = {
|
|
app = "my-app"
|
|
env = "production"
|
|
managed = "terraform"
|
|
}
|
|
|
|
annotations = {
|
|
description = "Namespace for my-app"
|
|
}
|
|
|
|
resource_quota = {
|
|
"requests.cpu" = "4"
|
|
"requests.memory" = "8Gi"
|
|
"limits.cpu" = "8"
|
|
"limits.memory" = "16Gi"
|
|
}
|
|
|
|
limit_range = {
|
|
default = {
|
|
"cpu" = "500m"
|
|
"memory" = "1Gi"
|
|
}
|
|
default_request = {
|
|
"cpu" = "100m"
|
|
"memory" = "128Mi"
|
|
}
|
|
max = {
|
|
"cpu" = "2"
|
|
"memory" = "4Gi"
|
|
}
|
|
min = {
|
|
"cpu" = "50m"
|
|
"memory" = "64Mi"
|
|
}
|
|
max_limit_request_ratio = {
|
|
"cpu" = "4"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## Inputs
|
|
|
|
| Name | Description | Type | Default | Required |
|
|
|------|-------------|------|---------|----------|
|
|
| name | Namespace name | string | - | yes |
|
|
| labels | Labels to apply | map(string) | {} | no |
|
|
| annotations | Annotations to apply | map(string) | {} | no |
|
|
| resource_quota | Resource quota limits | map(string) | {} | no |
|
|
| limit_range | Limit range configuration | object | {} | no |
|
|
|
|
---
|
|
|
|
## Outputs
|
|
|
|
| Name | Description |
|
|
|------|-------------|
|
|
| namespace_name | Namespace name |
|
|
| namespace_id | Namespace UID |
|
|
| resource_quota_id | Resource quota ID (if created) |
|
|
|
|
---
|
|
|
|
**Status**: ✅ Complete - Ready for use
|