Skip to content

lints #9

Merged
merged 5 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc

15 changes: 5 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
## Unreleased
## 0.1.0 (2024-08-19)

### Fix
### ✨ Features

- **main.tf**: add operators ns here
- **kubectl**: updated kubectl version and resolve lints

### fix

# CHANGELOG
* 0.0.2 -- 2024-07-30
- remove cluster-autoscaler (using karpenter)
* 0.0.1 -- 2024-07-22
- updated version.tf to 0.0.1
- included module.images in depends on helm charts
- created changelog
- **main.tf**: add operators ns here
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,18 @@ sys 0m2.015s
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.14.0 |
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.11.0 |
| <a name="requirement_http"></a> [http](#requirement\_http) | >= 2.1.0 |
| <a name="requirement_kubectl"></a> [kubectl](#requirement\_kubectl) | >= 1.14.0 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.23.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.14.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.11.0 |
| <a name="provider_http"></a> [http](#provider\_http) | n/a |
| <a name="provider_kubectl"></a> [kubectl](#provider\_kubectl) | >= 1.14.0 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.23.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.61.0 |
| <a name="provider_http"></a> [http](#provider\_http) | 3.4.4 |
| <a name="provider_kubectl"></a> [kubectl](#provider\_kubectl) | 1.14.0 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.31.0 |

## Modules

Expand All @@ -69,29 +68,23 @@ sys 0m2.015s

| Name | Type |
|------|------|
| [aws_autoscaling_group_tag.on-demand](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group_tag) | resource |
| [helm_release.cluster-autoscaler](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [kubectl_manifest.deploy_cluster_roles](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource |
| [kubernetes_namespace.operators](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
| [kubernetes_storage_class.ebs_encrypted](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/storage_class) | resource |
| [kubernetes_storage_class.efs-sc](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/storage_class) | resource |
| [kubernetes_storage_class.efs_sc](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/storage_class) | resource |
| [kubernetes_storage_class.gp3_encrypted](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/storage_class) | resource |
| [aws_ebs_default_kms_key.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ebs_default_kms_key) | data source |
| [aws_iam_role.cluster_autoscaler_irsa_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_role) | data source |
| [aws_kms_key.ebs_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/kms_key) | data source |
| [http_http.cluster_roles](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source |
| [kubectl_file_documents.access_documents](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/file_documents) | data source |
| [kubernetes_namespace.kube-system](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/namespace) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_autoscaler_chart_version"></a> [cluster\_autoscaler\_chart\_version](#input\_cluster\_autoscaler\_chart\_version) | The helm chart of the cluster-autoscaler most closely matching the Kuberentes version. Review output of `helm add repo autoscaler 'https://kubernetes.github.io/autoscaler'` (if the repo hasn't been added previously) and `helm search repo -l autoscaler/cluster-autoscaler` | `string` | `"9.37.0"` | no |
| <a name="input_cluster_autoscaler_tag"></a> [cluster\_autoscaler\_tag](#input\_cluster\_autoscaler\_tag) | Image tag of cluster-autoscaler associated with the cluster\_autoscaler\_chart\_version helm chart. `helm show values --version [cluster_autoscaler_chart_version] autoscaler/cluster-autoscaler | grep tag:` | `string` | `"v1.30.0"` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev) | `string` | n/a | yes |
| <a name="input_eks_managed_node_groups_autoscaling_group_names"></a> [eks\_managed\_node\_groups\_autoscaling\_group\_names](#input\_eks\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by EKS managed node groups | `list(string)` | n/a | yes |
| <a name="input_kubectl_image_tag"></a> [kubectl\_image\_tag](#input\_kubectl\_image\_tag) | The version of bitnami/kubectl image to use. | `string` | `"1.27.14"` | no |
| <a name="input_kubectl_image_tag"></a> [kubectl\_image\_tag](#input\_kubectl\_image\_tag) | The version of bitnami/kubectl image to use. | `string` | `"1.30.4"` | no |
| <a name="input_oidc_provider_arn"></a> [oidc\_provider\_arn](#input\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | `string` | n/a | yes |
| <a name="input_operators_ns"></a> [operators\_ns](#input\_operators\_ns) | Namespace to create where operators will be installed. | `string` | `"operators"` | no |
| <a name="input_profile"></a> [profile](#input\_profile) | AWS config profile | `string` | `""` | no |
Expand Down
2 changes: 0 additions & 2 deletions cluster_autoscaler.tf.off
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,3 @@ resource "helm_release" "cluster-autoscaler" {
value = "true"
}
}


4 changes: 2 additions & 2 deletions efs-filesystem.tf.off
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ output "efs_ap_ids" {
## # resources:
## # requests:
## # storage: 5Gi
## #
##
## #
##
1 change: 0 additions & 1 deletion eks_console_access.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ resource "kubectl_manifest" "deploy_cluster_roles" {

yaml_body = local.all_access_documents[count.index]
}

23 changes: 22 additions & 1 deletion examples/simple/providers.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.14.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.11.0"
}
http = {
source = "hashicorp/http"
version = ">= 2.1.0"
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.14.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.23.0"
}
}
}

provider "aws" {
Expand Down Expand Up @@ -30,4 +52,3 @@ provider "helm" {
token = data.aws_eks_cluster_auth.cluster.token
}
}

2 changes: 1 addition & 1 deletion examples/simple/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ variable "tags" {
description = "AWS Tags to apply to appropriate resources"
type = map(string)
default = {}
}
}
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data "aws_kms_key" "ebs_key" {
locals {
base_tags = {
"eks-cluster-name" = var.cluster_name
"boc:tf_module_version" = local._module_version
"boc:tf_module_version" = local.module_version
"boc:created_by" = "terraform"
CostAllocation = var.tag_costallocation
}
Expand Down Expand Up @@ -54,6 +54,8 @@ resource "kubernetes_storage_class" "ebs_encrypted" {
}

module "efs" {
# tflint-ignore: terraform_module_version
# tflint-ignore: terraform_module_pinned_source
source = "git@github.e.it.census.gov:terraform-modules/aws-efs.git"

name = var.cluster_name
Expand All @@ -62,13 +64,12 @@ module "efs" {
security_groups = [var.security_group_all_worker_mgmt_id]

tags = merge(
local.base_tags,
var.tags,
local.tags,
tomap({ "efs.csi.aws.com/cluster" = "true" }),
)
}

resource "kubernetes_storage_class" "efs-sc" {
resource "kubernetes_storage_class" "efs_sc" {
depends_on = [module.efs]

metadata {
Expand Down
6 changes: 3 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

output "module_name" {
description = "The name of this module."
value = local._module_name
value = local.module_name
}

output "module_version" {
description = "The version of this module."
value = local._module_version
value = local.module_version
}

################################################################################
Expand All @@ -23,7 +23,7 @@ output "rwo_storage_class" {

output "rwx_storage_class" {
description = "Kubernetes storage class that supports read/write many."
value = kubernetes_storage_class.efs-sc.metadata[0].name
value = kubernetes_storage_class.efs_sc.metadata[0].name
}

################################################################################
Expand Down
6 changes: 3 additions & 3 deletions requirements.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.14.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.11.0"
http = {
source = "hashicorp/http"
version = ">= 2.1.0"
}
kubectl = {
source = "gavinbunney/kubectl"
Expand Down
5 changes: 4 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ variable "cluster_name" {
type = string
}

# tflint-ignore: terraform_unused_declarations
variable "region" {
description = "AWS region"
type = string
Expand All @@ -29,11 +30,13 @@ variable "security_group_all_worker_mgmt_id" {
type = string
}

# tflint-ignore: terraform_unused_declarations
variable "eks_managed_node_groups_autoscaling_group_names" {
description = "List of the autoscaling group names created by EKS managed node groups"
type = list(string)
}

# tflint-ignore: terraform_unused_declarations
variable "oidc_provider_arn" {
description = "The ARN of the OIDC Provider if `enable_irsa = true`"
type = string
Expand All @@ -60,7 +63,7 @@ variable "tags" {
variable "kubectl_image_tag" {
description = "The version of bitnami/kubectl image to use."
type = string
default = "1.27.14"
default = "1.30.4"
}

# # helm add repo autoscaler "https://kubernetes.github.io/autoscaler"
Expand Down
4 changes: 2 additions & 2 deletions version.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
locals {
_module_name = "tfmod-eks-configuration"
_module_version = "0.0.2"
module_name = "tfmod-eks-configuration"
module_version = "0.0.3"
}