Skip to content

Terraform config to create RKE cluster on cloud.ca

License

Notifications You must be signed in to change notification settings

cloudops/cloudca-rke-cluster

 
 

Repository files navigation

Overview

This terraform configuration is used to build a RKE cluster on cloud.ca infrastructure.

Table of Content

Resources

It will create the required infrastructure:

  • one or several k8s master node(s)
  • two or several k8s worker nodes

Requirements

Available Kubernetes Versions

Version of Kubernetes to be used in the RKE cluster can be controlled with kubernetes_version, which depends on the version of terraform-provider-rke being used in which depends on the version of RKE binary beind used in that provider version.

To get the list of available (and the default) version of Kubernetes take a look at release notes of terraform-provider-rke and RKE respectively.

Required Inputs

The following input variables are required:

api_key

Description: cloud.ca API key to use

Type: string

environment_id

Description: The environment ID to create resources in

Type: string

network_id

Description: The network ID to create resources in

Type: string

vpc_id

Description: The vpc ID of the network used

Type: string

students

Description: The list of students attending the workshop

Type: list

Example:

[
    "phil",
    "scott"
]

Optional Inputs

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

kubernetes_version

Description: Kubernetes version to install in the cluster

Type: string

Default: "v1.15.3-rancher1-1"

master_count

Description: Number of master node(s) to create

Type: string

Default: "1"

node_prefix

Description: Prefix to be used in name of instances, e.g. cca in cca-foo-service01

Type: string

Default: "cca"

node_service

Description: Service to be used in name of instances, e.g. service in cca-foo-service01

Type: string

Default: "rke"

node_type

Description: Type to be used in name of instances, e.g. foo in cca-foo-service01

Type: string

Default: "cluster"

node_username

Description: The username to create in the nodes with SSH access

Type: string

Default: "student"

node_password

Description: The password for the student to sign in to the workshop

Type: string

To generate password for cloud-init

docker run --rm -it flyinprogrammer/mkpasswd --method=SHA-512 --rounds=4096

worker_count

Description: Number of worker node(s) to create

Type: string

Default: "2"

Outputs

The following outputs are exported:

master_ips

Description: List of private IP of master node(s)

worker_ips

Description: List of private IP of worker node(s)

master_endpoint_ips

Description: List of master endpoint IPs to access the clusters externally

Usage

  1. Clone the repository into an appropriate name:

    git clone https://github.com/khos2ow/cloudca-rke-cluster.git cloudca-rke-cluster
  2. Create terraform.tfvars containing:

    api_key = "<cloud_ca_API_KEY>"
    vpc_id = "<cloud_ca_VPC_ID>"
    environment_id = "<cloud_ca_ENVIRONMENT_ID>"
    network_id = "<cloud_ca_NETWORK_ID>"
    students = [
        "<STUDENT_NAME>"
    ]
    
  3. Execute the following command to initialize the repository:

    make init plan

License

MIT License

Copyright (c) 2019 Khosrow Moossavi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Terraform config to create RKE cluster on cloud.ca

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 72.9%
  • Makefile 26.5%
  • Shell 0.6%