Skip to content
Terraform module for creating a Kubernetes cluster on Alibaba Cloud ("aliyun") with latest available version, all RAM roles with their policies and kubeconfig file.
HCL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
main.tf
outputs.tf
provider.tf
variables.tf

README.md

Terraform Managed Kubernetes on Alibaba Cloud ("aliyun")

This repository contains the Terraform module for creating a simple but ready-to-use managed Kubernetes Cluster on Alibaba Cloud Container Service for Kubernetes (ACK).

It uses the latest available Kubernetes version available in the Alibaba Cloud region, creates all necessary RAM roles with its policies and generates a kubeconfig file at completion.

Link to my comprehensive blog post (beginner friendly):

https://napo.io/posts/terraform-kubernetes-multi-cloud-ack-aks-dok-eks-gke-oke/#alibaba-cloud

Alibaba Cloud Logo

Requirements

You need an Alibaba Cloud account.

Features

  • Always uses latest Kubernetes version available at Alibaba Cloud region
  • Creates all necessary RAM roles and policies
  • kubeconfig file generation

Notes

Defaults

See tables at the end for a comprehensive list of inputs and outputs.

  • Default region: eu-central-1 (Frankfurt, Germany)
  • Default worker node type: ecs.sn1.medium (2x vCPU, 4.0GB memory) (choose your cpu and memory configuration -> auto selection of the right instance type)
  • Default worker node pool size: 2

Terraform Inputs

Name Description Type Default Required
enable_alibaba Enable / Disable Alibaba Cloud k8s bool true yes
random_cluster_suffix Random 6 byte hex suffix for cluster name string no
ali_region Alibaba Cloud region string eu-central-1 no
ali_access_key Alibaba Cloud access key string yes
ali_secret_key Alibaba Cloud secret key string yes
ssh_public_key_path Path to your existing SSH public key file string ~/.ssh/id_rsa.pub no
ali_vpc_name Alibaba Cloud VPC name string k8svpc no
ali_vpc_cidr Alibaba Cloud VPC CIDR block string 10.1.0.0/21 no
ali_vswitch_cidrs List of CIDR blocks used to create several new VSwitches list(string) 10.1.2.0/24 no
ack_name Alibaba Managed Kubernetes cluster name string k8s-ali no
ack_node_count Alibaba Managed Kubernetes cluster worker node count list 2 no
ack_node_types Alibaba node instance types for worker nodes list(string) ecs.sn1.medium no
ack_k8s_cni Kubernetes CNI plugin to use for networking string flannel no
ack_k8s_pod_cidr CIDR for Kubernetes pod network string 172.20.0.0/16 no
ack_k8s_service_cidr CIDR for Kubernetes service network string 172.21.0.0/20 no

Outputs

Name Description
alicloud_eip_ip_address Alibaba Cloud EIP IPv4 address (used for NAT gateway)
kubeconfig_path_oci kubeconfig file path
You can’t perform that action at this time.