Skip to content

Commit

Permalink
update the document and module output description
Browse files Browse the repository at this point in the history
  • Loading branch information
smalltown committed Apr 3, 2019
1 parent 822c01b commit 2cd101a
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 120 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
project adheres to [Semantic Versioning](http://semver.org/).


## [[v0.0.15](https://github.com/getamis/vishwakarma/compare/v0.0.15...v0.0.14)] - 2019-04-03]

### Added
- Add terratest script for eks example/eks-cluster
- Add tag parameter for autoscaler within eks
- Change the auth config management by refering to another [eks terraform module](https://github.com/terraform-aws-modules/terraform-aws-eks)

### Changed
- Upgrade eks to algin with the latest official worker group provision method
- The eks worker group changed AMI from CoreOS to official EKS AMI

## [[v0.0.14](https://github.com/getamis/vishwakarma/compare/v0.0.14...v0.0.13)] - 2019-03-28]

### Added
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ You have completed one Kubernetes cluster the same as below picture, and let me
![Alt text](https://cdn-images-1.medium.com/max/800/1*tvAY88CzHhxo4lBB6OUSyA.png)

## Modules
Vishwakarma include 4 major module:
Vishwakarma include serveral major modules:

### aws/network
Create one AWS VPC including private and public subnet, and one ec2 instance called bastion hosts in public subnet, hence, one can access the resource hosting in the private subnet, refer [**aws/network**](VARIABLES.md#aws/network) for the detail variable inputs

### aws/eks or aws/elastikube
This module creates the AWS EKS or ElastiKube, Terraform is responsible for the complicated k8s compoments, and it takes about 10~15 minutes to complete, refer [**Here**](VARIABLES.md#aws/) for the detail variable inputs
### aws/eks and aws/elastikube
This two modules creates the K8S control plane (AWS EKS and ElastiKube), Terraform is responsible for the complicated k8s compoments, and it takes about 10~15 minutes to complete, refer [**aws/eks**](VARIABLES.md#aws/eks) and [**aws/eks**](VARIABLES.md#aws/elastikube) for the detail variable inputs


### aws/eks-worker-asg or aws/kube-worker
Create a AWS auto-scaling group with CoreOS container linux and leverage ignition to provision and register to EKS cluster / ElastiKube automatically.
### aws/eks-worker-asg and aws/kube-worker
Create a AWS auto-scaling group with CoreOS container linux and leverage ignition to provision and register to EKS cluster or ElastiKube automatically.

Due to using AWS launch template, it's up to user to choose spot or on demand instance type, refer [**Here**](VARIABLES.md#worker) for the detail variable inputs
Due to using AWS launch template, hence, it's up to user to choose spot or on demand instance type by changing the variable, refer [**aws/eks-worker**](VARIABLES.md#aws/eks-worker) and [**aws/kube-worker**](VARIABLES.md#aws/kube-worker) for the detail variable inputs


## Contributing
Expand Down
220 changes: 148 additions & 72 deletions VARIABLES.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions modules/aws/eks-worker/variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "aws_region" {
type = "string"
default = "us-west-2"
description = "(Optional) The AWS region"
description = "The AWS region"
}

variable "aws_az_number" {
Expand Down Expand Up @@ -38,15 +38,15 @@ EOF
variable "load_balancer_ids" {
type = "list"
default = []
description = "(Optional) A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead."
description = "A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead."
}

variable "security_group_ids" {
type = "list"
default = []

description = <<EOF
(Optional) List of security group IDs for the cross-account elastic network interfaces
List of security group IDs for the cross-account elastic network interfaces
to use to allow communication between your worker nodes and the Kubernetes control plane.
EOF
}
Expand All @@ -56,7 +56,7 @@ variable "subnet_ids" {
default = []

description = <<EOF
(Required) List of subnet IDs. Must be in at least two different availability zones.
List of subnet IDs. Must be in at least two different availability zones.
Cross-account elastic network interfaces will be created in these subnets to allow
communication between your worker nodes and the Kubernetes control plane.
EOF
Expand All @@ -71,7 +71,7 @@ variable "ssh_key" {
variable "target_group_arns" {
type = "list"
default = []
description = "(Optional) A list of aws_alb_target_group ARNs, for use with Application Load Balancing."
description = "A list of aws_alb_target_group ARNs, for use with Application Load Balancing."
}

variable "extra_worker_policy_arns" {
Expand All @@ -97,7 +97,7 @@ variable "worker_config" {
spot_instance_pools = 1
}

description = "(Optional) Desired worker nodes configuration."
description = "Desired worker nodes configuration."
}

variable "extra_tags" {
Expand Down
17 changes: 12 additions & 5 deletions modules/aws/eks/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
output "id" {
value = "${aws_eks_cluster.vishwakarma.id}"
value = "${aws_eks_cluster.vishwakarma.id}"
description = "the eks cluster name"
}

output "endpoint" {
value = "${aws_eks_cluster.vishwakarma.endpoint}"
description = "the eks cluster endpoint"
}

output "kubernetes_version" {
value = "${aws_eks_cluster.vishwakarma.version}"
value = "${aws_eks_cluster.vishwakarma.version}"
description = "the eks cluster version"
}

output "worker_sg_id" {
value = "${aws_security_group.worker.id}"
value = "${aws_security_group.worker.id}"
description = "the security group id for worker group"
}

output "s3_bucket" {
value = "${aws_s3_bucket.eks.bucket}"
value = "${aws_s3_bucket.eks.bucket}"
description = "the s3 bucket where put kubeconfig"
}

output "worker_role_arns" {
value = "${aws_iam_role.workers.*.name}"
value = "${aws_iam_role.workers.*.name}"
description = "the role arns for worker groups"
}

output "worker_instance_profiles" {
value = "${aws_iam_instance_profile.workers.*.name}"
description = "the instance profiles name for worker groups"
}

6 changes: 3 additions & 3 deletions modules/aws/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ variable "project" {
variable "kubernetes_version" {
type = "string"
default = "1.12.7"
description = "(Optional) Desired Kubernetes master version. If you do not specify a value, the latest available version is used."
description = "Desired Kubernetes master version. If you do not specify a value, the latest available version is used."
}

variable "config_output_path" {
Expand Down Expand Up @@ -148,12 +148,12 @@ variable "lb_sg_ids" {

variable "endpoint_private_access" {
default = true
description = "(Optional) kubernetes apiserver endpoint"
description = "Kubernetes apiserver endpoint"
}

variable "endpoint_public_access" {
default = false
description = "(Optional) kubernetes apiserver endpoint"
description = "Kubernetes apiserver endpoint"
}

variable "local_exec_interpreter" {
Expand Down
22 changes: 15 additions & 7 deletions modules/aws/elastikube/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
output "id" {
value = "${var.name}"
value = "${var.name}"
description = "K8S cluster name"
}

output "certificate_authority" {
value = "${module.master.certificate_authority}"
value = "${module.master.certificate_authority}"
description = "K8S root CA Cert"
}

output "endpoint" {
value = "${module.master.endpoint}"
value = "${module.master.endpoint}"
description = "K8S cluster endpoint"
}

output "version" {
value = "${var.kubernetes_version}"
description = "K8S cluster version"
}

output "vpc_id" {
value = "${local.vpc_id}"
value = "${local.vpc_id}"
description = "The VPC id used by K8S"
}

output "s3_bucket" {
value = "${aws_s3_bucket.ignition.id}"
value = "${aws_s3_bucket.ignition.id}"
description = "The S3 bucket for storing provision ignition file"
}

output "master_sg_ids" {
value = ["${module.master.master_sg_id}"]
value = ["${module.master.master_sg_id}"]
description = "The security group which used by K8S master"
}

output "worker_sg_ids" {
value = ["${aws_security_group.workers.id}"]
value = ["${aws_security_group.workers.id}"]
description = "The security gruop for worker group"
}
28 changes: 14 additions & 14 deletions modules/aws/kube-worker/variables.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
variable "aws_region" {
type = "string"
default = "us-east-1"
description = "(Optional) The AWS region"
description = "The AWS region"
}

variable "cluster_name" {
type = "string"
description = " (Required) Name of the cluster."
description = "Name of the cluster."
}

variable "enable_autoscaler" {
type = "string"
default = "false"
description = "enable autoscaler or not"
description = "Enable to add autoscaler tag or not"
}

variable "role_name" {
type = "string"
default = ""
description = "(Optional) The Amazon Resource Name of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf."
description = "The Amazon Resource Name of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf."
}

variable "security_group_ids" {
type = "list"
default = []

description = <<EOF
(Optional) List of security group IDs for the cross-account elastic network interfaces
List of security group IDs for the cross-account elastic network interfaces
to use to allow communication between your worker nodes and the Kubernetes control plane.
EOF
}
Expand All @@ -36,7 +36,7 @@ variable "subnet_ids" {
default = []

description = <<EOF
(Required) List of subnet IDs. Must be in at least two different availability zones.
List of subnet IDs. Must be in at least two different availability zones.
Cross-account elastic network interfaces will be created in these subnets to allow
communication between your worker nodes and the Kubernetes control plane.
EOF
Expand All @@ -45,7 +45,7 @@ EOF
variable "kubernetes_version" {
type = "string"
default = "v1.13.4"
description = "(Optional) Desired Kubernetes kubelet version. If you do not specify a value, the latest available version is used."
description = "Desired Kubernetes kubelet version. If you do not specify a value, the latest available version is used."
}

variable "worker_config" {
Expand All @@ -65,7 +65,7 @@ variable "worker_config" {
spot_instance_pools = 1
}

description = "(Optional) Desired worker nodes configuration."
description = "Desired worker nodes configuration."
}

variable "ssh_key" {
Expand Down Expand Up @@ -99,39 +99,39 @@ variable "s3_bucket" {
default = ""

description = <<EOF
(Optional) Unique name under which the Amazon S3 bucket will be created. Bucket name must start with a lower case name and is limited to 63 characters.
Unique name under which the Amazon S3 bucket will be created. Bucket name must start with a lower case name and is limited to 63 characters.
If name is not provided the installer will construct the name using "name" and current AWS region.
EOF
}

variable "reboot_strategy" {
type = "string"
default = "etcd-lock"
description = "(Optional) CoreOS reboot strategies on updates, two option here: etcd-lock or off"
description = "CoreOS reboot strategies on updates, two option here: etcd-lock or off"
}

variable "extra_ignition_file_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition file IDs. See https://www.terraform.io/docs/providers/ignition/d/file.html for more details."
description = "Additional ignition file IDs. See https://www.terraform.io/docs/providers/ignition/d/file.html for more details."
}

variable "extra_ignition_systemd_unit_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition systemd unit IDs. See https://www.terraform.io/docs/providers/ignition/d/systemd_unit.html for more details."
description = "Additional ignition systemd unit IDs. See https://www.terraform.io/docs/providers/ignition/d/systemd_unit.html for more details."
}

variable "load_balancer_ids" {
type = "list"
default = []
description = "(Optional) A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead."
description = "A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead."
}

variable "target_group_arns" {
type = "list"
default = []
description = "(Optional) A list of aws_alb_target_group ARNs, for use with Application Load Balancing."
description = "A list of aws_alb_target_group ARNs, for use with Application Load Balancing."
}

variable "kubelet_flag_extra_flags" {
Expand Down
13 changes: 9 additions & 4 deletions modules/aws/network/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
output "vpc_id" {
value = "${aws_vpc.new_vpc.id}"
value = "${aws_vpc.new_vpc.id}"
description = "vpc id created by this module"
}

output "public_subnet_ids" {
value = ["${aws_subnet.public_subnet.*.id}"]
value = ["${aws_subnet.public_subnet.*.id}"]
description = "resource can be accessed publicly when use it"
}

output "private_subnet_ids" {
value = ["${aws_subnet.private_subnet.*.id}"]
value = ["${aws_subnet.private_subnet.*.id}"]
description = "resource can not be accessed publicly when use it"
}

output "bastion_public_ip" {
value = "${aws_instance.bastion.public_ip}"
value = "${aws_instance.bastion.public_ip}"
description = "the public ip address for ssh"
}

output "zone_id" {
value = "${var.private_zone ? join("", aws_route53_zone.zone.*.zone_id) : ""}"
description = "private zone id for k8s"
}
6 changes: 3 additions & 3 deletions modules/aws/network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variable "cidr_block" {
variable "phase" {
description = "Specific which phase service will be hosted"
type = "string"
default = "dev"
default = "test"
}

variable "project" {
Expand All @@ -36,7 +36,7 @@ variable "bastion_ami_id" {
variable "bastion_instance_type" {
description = "The AWS instance type for bastion"
type = "string"
default = "t2.micro"
default = "t3.micro"
}

variable "bastion_key_name" {
Expand All @@ -50,7 +50,7 @@ variable "private_zone" {
}

variable "extra_tags" {
description = "Extra AWS tags to be applied to created resources."
description = "Extra AWS tags to be applied to created resources"
type = "map"
default = {}
}

0 comments on commit 2cd101a

Please sign in to comment.