Git Product home page Git Product logo

terraform-alicloud-managed-kubernetes's Introduction

Alibaba Cloud terraform example for kubernetes cluster

A terraform example to launching a kubernetes cluster in alibaba cloud.

These types of the module resource are supported:

Usage

This example can specify the following arguments to create user-defined kuberntes cluster

  • alicloud_access_key: The Alicloud Access Key ID
  • alicloud_secret_key: The Alicloud Access Secret Key
  • region: The ID of region in which launching resources
  • k8s_name_prefix: The name prefix of kubernetes cluster
  • worker_number: The number of worker nodes in each kubernetes cluster
  • k8s_pod_cidr: The kubernetes pod cidr block. It cannot be equals to vpc's or vswitch's and cannot be in them. If vpc's cidr block is 172.16.XX.XX/XX, it had better to 192.168.XX.XX/XX or 10.XX.XX.XX/XX
  • k8s_service_cidr: The kubernetes service cidr block. Its setting rule is same as k8s_pod_cidr
  • Other kubernetes cluster arguments

Note: In order to avoid some needless error, you had better to set new_nat_gateway to true. Otherwise, you must you must ensure you specified vswitches can access internet before running the example.

Planning phase

terraform plan

Apply phase

terraform apply

Destroy

terraform destroy

Conditional creation

This example can support the following creating kubernetes cluster scenario by setting different arguments.

1. Create a new vpc, vswitches and nat gateway for the cluster.

You can specify the following user-defined arguments:

  • vpc_name: A new vpc name
  • vpc_cidr: A new vpc cidr block
  • vswitch_name_prefix: The name prefix of several vswitches
  • vswitch_cidrs: List of cidr blocks for several new vswitches

2. Using existing vpc and vswitches for the cluster.

You can specify the following user-defined arguments:

  • vpc_id: A existing vpc ID
  • vswitch_ids: List of IDs for several existing vswitches

3. Using existing vpc, vswitches and nat gateway for the cluster.

You can specify the following user-defined arguments:

  • vpc_id: A existing vpc ID
  • vswitch_ids: List of IDs for several existing vswitches
  • new_nat_gateway: Set it to false. But you must ensure you specified vswitches can access internet. In other words, you must set snat entry for each vswitch before running the example.

Terraform version

Terraform version 0.11.0 or newer and Provider version 1.57.2 or newer are required for this example to work.

Authors

Created and maintained by Meng Xiaobing(@menglingwei, [email protected])

License

Mozilla Public License 2.0. See LICENSE for full details.

Reference

terraform-alicloud-managed-kubernetes's People

Contributors

xiaozhu36 avatar

Watchers

 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.