johnybradshaw / acc-lke-networking

Networking for LKE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Networking for Linode Kubernetes Environments (LKE) on Akamai Connected Cloud (ACC)

acc-lke-networking module

This module creates a Linode Kubernetes (LKE) Cluster on the Akamai Connected Cloud using Terraform.

Important

The readme.md has the following sections:

  • Requirements - Min requirements for the module to run
  • Providers - Providers required by the module
  • Inputs- Inputs to the module
  • Outputs - Outputs from the module
  • Usage - How to use the module

Requirements

The following requirements are needed by this module:

Providers

The following providers are used by this module:

Required Inputs

The following input variables are required:

Description: n/a

Type:

object({
    api_token = string
  })

Description: The ID of the LKE cluster

Type: string

Optional Inputs

The following input variables are optional (have default values):

Description: values for the nodebalancer

Type:

object({
    client_conn_throttle = string
  })

Default:

{
  "client_conn_throttle": "20"
}

Outputs

The following outputs are exported:

Description: The ID of the firewall created for the LKE cluster.

Description: The link to the firewall created for the LKE cluster.

Description: The NodeBalancer created for the LKE cluster.

Usage

Sample usage of this module is as shown below. For detailed info, look at inputs and outputs.

Step 1

In your main.tf, add the following code:

# Create the Networking stack
module "lke" {
  source = "./modules/lke-networking"
  providers = {
    linode.default      = linode
  }

  linode_config = var.linode_config # Pass the Linode configuration to the module
  lke_cluster   = var.lke_cluster # Pass the LKE cluster configuration to the module
}

output "lke-networking" {
  description = "Important outputs from LKE Networking."
  value = module.lke-networking # Output from the lke module
}

Note

  • lke is the name of the module. You can use any name you want.

Step 2

In your provider.tf, add the following code, if it doesn't exist already:

terraform {
    required_version = ">= 1.5.7"

    required_providers {
        linode = {
            source = "linode/linode"
            version = ">= 2.9.3"
            configuration_aliases = [ linode.default ]
        }
    }
}

provider "linode" {
    alias = "default"
    token = var.linode_config.api_token
}

Step 3

Verify your settings using the following command:

terraform init
terraform plan

Step 4

Apply the changes

terraform apply

About

Networking for LKE


Languages

Language:HCL 100.0%