Skip to content

ystkfujii/terraform-nifcloud-minimum-k8s-cluster

Repository files navigation

terraform-nifcloud-minimum-k8s-cluster

This module deploys single-master Kubernetes cluster on NIFCLOUD using kubeadm.

This project is for develop environment, so please do not use this in production

Overview

overview.png

Requirements

Before this module can be used on a project, you must ensure that the following pre-requisites are fulfilled:

  1. Terraform are installed on the machine where Terraform is executed.
  2. The Nifcloud Account you execute the module with has the right permissions.
    • You can set environment variable NIFCLOUD_ACCESS_KEY_ID and NIFCLOUD_SECRET_ACCESS_KEY

Usage

There are examples included in the examples folder but simple usage is as follows:

# Provider
provider "nifcloud" {
  region = "jp-west-1"
}

# Module
module "minimum_k8s_cluster" {
  source  = "ystkfujii/minimum-k8s-cluster/nifcloud"

  availability_zone = "west-11"

  instance_key_name = "deployerkey"
}

Then perform the following commands on the root folder:

  • terraform init to get the plugins
  • terraform plan to see the infrastructure plan
  • terraform apply to apply the infrastructure build
  • terraform destroy to destroy the built infrastructure

Inputs

Name Description Type Default
availability_zone The availability zone string
cni cni string containerd
prefix Prefix to include in the name of the resource to be created string 001
private_network_subnet The subnet of private network string 192.168.10.0
instance_key_name The key name of the Key Pair to use for the instance string
instance_count_wk Number of worker to be created number 2
instance_type_wk The instance type of worker string e-large
instance_type_cp The instance type of control plane string e-large
accounting_type Accounting type string 1

Outputs

Name Description
security_group_name The security group used in the cluster
private_network_id The private network used in the cluster
worker_info The worker information in cluster
control_plane_info The control plane information in cluster

Software Dependencies

Author