Skip to content

pingbui/terraform-kubernetes-namespace

 
 

Repository files navigation

Kubernetes Namespace

Maintained by Gruntwork.io Terraform Version

This repo contains a Module for managing Kubernetes Namespaces with Terraform.

Features

  • Deploy a Namespace from scratch
  • Configure Namespaces with default RBAC roles
  • Create and manage Namespace scoped Service Accounts with various access levels via RBAC

Learn

This repo is a part of the Gruntwork Infrastructure as Code Library, a collection of reusable, battle-tested, production ready infrastructure code. If you've never used the Infrastructure as Code Library before, make sure to read How to use the Gruntwork Infrastructure as Code Library!

Core concepts

Repo organization

  • modules: the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules.
  • examples: This folder contains working examples of how to use the submodules.
  • test: Automated tests for the modules and examples.

Deploy

  • examples folder: The examples folder contains sample code optimized for learning, experimenting, and testing (but not production usage).

Manage

Support

If you need help with this repo or anything else related to infrastructure or DevOps, Gruntwork offers Commercial Support via Slack, email, and phone/video. If you're already a Gruntwork customer, hop on Slack and ask away! If not, subscribe now. If you're not sure, feel free to email us at support@gruntwork.io.

Contributions

Contributions to this repo are very welcome and appreciated! If you find a bug or want to add a new feature or even contribute an entirely new module, we are very happy to accept pull requests, provide feedback, and run your changes through our automated test suite.

Please see Contributing to the Gruntwork Infrastructure as Code Library for instructions.

License

Please see LICENSE.txt for details on how the code in this repo is licensed.

Requirements

Name Version
terraform >= 1.2.0
kubernetes >= 2.11

Providers

No providers.

Modules

Name Source Version
namespace ./modules/namespace n/a
service_account_access_all ./modules/service-account n/a
service_account_access_read_only ./modules/service-account n/a

Resources

No resources.

Inputs

Name Description Type Default Required
cluster_ca_certificate The root certificates bundle for TLS authentication string "" no
cluster_endpoint The hostname (in form of URI) of the Kubernetes API string "" no
cluster_token Token of the cluster to authen string "" no
create_resources Set to false to have this module skip creating resources. bool true no
exec_plugins The Configuration block to use an exec-based credential plugin map(any) {} no
kubectl_config_context_name The config context to use when authenticating to the Kubernetes cluster. If empty, defaults to the current context specified in the kubeconfig file. string "" no
kubectl_config_path The path to the config file to use for kubectl. If empty, defaults to $HOME/.kube/config string "" no
name Name of the namespace to be created string n/a yes

Outputs

Name Description
name Name of the created namespace
rbac_access_all_role The name of the RBAC role that grants admin level permissions on the namespace.
rbac_access_read_only_role The name of the RBAC role that grants read only permissions on the namespace.
service_account_access_all The name of the ServiceAccount that has admin level permissions.
service_account_access_read_only The name of the ServiceAccount that has read only level permissions.

About

This repo contains a Module for managing Kubernetes Namespaces with Terraform.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 69.4%
  • Go 27.4%
  • Smarty 3.2%