This Terraform module provisions a Kubernetes namespace, along with RBAC role bindings, LimitRange, ResourceQuota, and NetworkPolicy. It provides a way to easily set up a Kubernetes namespace with configurable limits and policies, as well as RBAC settings for administrative access.
- Creates a Kubernetes namespace with annotations and labels.
- Sets up RBAC role bindings for administrative access.
- Configures resource limits for containers within the namespace.
- Defines quotas for the maximum number of pods.
- Applies a default network policy to control ingress traffic.
module "namespace" {
source = "./terraform-module"
namespace_name = "my-namespace"
environment = "development"
is_production = false
application = "Join a Ministry of Justice GitHub Org"
source_code = "https://github.com/ministryofjustice/operations-engineering-join-github"
}
No requirements.
Name | Version |
---|---|
kubernetes | n/a |
No modules.
Name | Type |
---|---|
kubernetes_limit_range.example | resource |
kubernetes_namespace.example | resource |
kubernetes_network_policy.default | resource |
kubernetes_resource_quota.example | resource |
kubernetes_role_binding.example | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
application | Application name | string |
n/a | yes |
business_unit | Business unit responsible for the service | string |
"Platforms" |
no |
environment | Environment name (e.g., development, staging, production) | string |
n/a | yes |
is_production | Boolean flag to indicate if this is a production environment | bool |
n/a | yes |
namespace_name | Name of the Kubernetes namespace | string |
n/a | yes |
owner | Email or contact info of the application owner | string |
"operations-engineering@digital.justice.gov.uk" |
no |
rbac_group | Group name for RBAC role bindings | string |
"github:operations-engineering" |
no |
slack_channel | Slack channel for notifications | string |
"#operations-engieering" |
no |
source_code | URL of the source code repository | string |
n/a | yes |
team_name | Development team responsible for the service | string |
"Operations Engineering" |
no |
Name | Description |
---|---|
ecr_repo_url | n/a |
namespace_name | n/a |