Complete Kubeadm Example

The Terraform scripts use the module kubeadm to install and configure a Kubernetes cluster with Kubeadm.

First, you should have a list of barre metal ou virtual machines, and then you have to update values PUBLIC_DNS_HERE , PRIVATE_DNS_HERE and TLS_PRIVATE_KEY_FILE_HERE in the file terraform.tfvars.

Requirements

Name

Version

terraform

>= 1.0

null

~> 3.2.1

random

~> 3.5.1

Providers

Name

Version

null

~> 3.2.1

random

~> 3.5.1

Modules

Name

Source

Version

install_kubeadm_cluster

../../../kubeadm

n/a

Resources

Name

Type

null_resource.download_kubeconfig_file

resource

random_string.token_id

resource

random_string.token_secret

resource

Inputs

Name

Description

Type

Default

Required

master

The master node to be deployed.

object({
name = string
public_dns = string # it can be private if you are inside the destination network
private_dns = string
tls_private_key_pem_file = string
})

n/a

yes

user

user used to execute docker + kubernetes scripts. must be updated accordingly with the linux image used

string

n/a

yes

workers

The worker nodes to be deployed.

map(object({
instance_count = optional(number, 1)
label = optional(list(string), [])
name = string
public_dns = string
taints = optional(list(string), [])
}))

n/a

yes

Outputs

Name

Description

display_nodes_command_help

A sample command to display nodes of your cluster

kubeconfig_file_export_help

Use this export to begin to use your cluster