GithubHelp home page GithubHelp logo

terraform-ibm-modules / terraform-ibm-namespace Goto Github PK

View Code? Open in Web Editor NEW
1.0 17.0 0.0 170 KB

Configures a Kubernetes namespace or Openshift project.

License: Apache License 2.0

HCL 58.23% Go 41.77%
ibm-cloud terraform-module terraform core-team graduated kubernetes namespace openshift project supported

terraform-ibm-namespace's Introduction

Namespace module

Graduated (Supported) latest release pre-commit Renovate enabled semantic-release

This module supports creating multiple Kubernetes namespaces / OpenShift projects with optional annotations and labels.

Overview

terraform-ibm-namespace

Usage

##############################################################################
# Init cluster config for kubernetes providers
##############################################################################

data "ibm_container_cluster_config" "cluster_config" {
  cluster_name_id = var.cluster_id
}

##############################################################################
# Config providers
##############################################################################

provider "ibm" {
  ibmcloud_api_key = var.ibmcloud_api_key # pragma: allowlist secret
}

provider "kubernetes" {
  host                   = data.ibm_container_cluster_config.cluster_config.host
  token                  = data.ibm_container_cluster_config.cluster_config.token
  cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
}

##############################################################################
# Namespace module
##############################################################################

module "namespace" {
  source            = "terraform-ibm-modules/namespace/ibm"
  version           = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific
  namespaces = [
    {
      name = "my-namespace"
      metadata = {
        labels = {
          "istio-injection" = "enabled"
        }
        annotations = {
          "name" = "example-annotation"
        }
      }
    },
    {
      name = "my-namespace-2"
      metadata = {
        labels = {
          "istio-injection" = "enabled"
        }
        annotations = {
          "name" = "example-annotation"
        }
      }
    }
  ]
}

Required IAM access policies

You need the following permissions to run this module.

  • IAM Services
    • Kubernetes service
      • Viewer platform access
      • Manager service access

Requirements

Name Version
terraform >= 1.3.0, <1.7.0
kubernetes >= 2.16.1, < 3.0.0

Modules

No modules.

Resources

Name Type
kubernetes_namespace.create_namespace resource

Inputs

Name Description Type Default Required
namespaces Set of namespaces to create
list(object({
name = string
metadata = optional(object({
labels = map(string)
annotations = map(string)
}))
}))
n/a yes

Outputs

No outputs.

Contributing

You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.

To set up your local development environment, see Local development setup in the project documentation.

terraform-ibm-namespace's People

Contributors

akocbek avatar iamar7 avatar jojustin avatar ocofaigh avatar terraform-ibm-modules-ops avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.