Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: remove the Argo CD namespace variable and hardcode the Helm release name #27

Merged
merged 3 commits into from
Jan 19, 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
38 changes: 6 additions & 32 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ The following providers are used by this module:

- [[provider_null]] <<provider_null,null>> (>= 3)

- [[provider_argocd]] <<provider_argocd,argocd>> (>= 5)

- [[provider_utils]] <<provider_utils,utils>> (>= 1)

- [[provider_aws]] <<provider_aws,aws>>

- [[provider_argocd]] <<provider_argocd,argocd>> (>= 5)

=== Modules

The following Modules are called:
Expand All @@ -152,12 +152,6 @@ The following resources are used by this module:

The following input variables are required:

==== [[input_argocd_namespace]] <<input_argocd_namespace,argocd_namespace>>

Description: Namespace used by Argo CD where the Application and AppProject resources should be created.

Type: `string`

==== [[input_efs_file_system_id]] <<input_efs_file_system_id,efs_file_system_id>>

Description: EFS Filesystem ID to use by the CSI driver to create volumes.
Expand Down Expand Up @@ -212,7 +206,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v2.2.0"`
Default: `"v2.4.0"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Expand Down Expand Up @@ -254,14 +248,6 @@ Type: `map(string)`

Default: `{}`

==== [[input_name]] <<input_name,name>>

Description: Name used to override the chart name on deployment.

Type: `string`

Default: `"efs-csi-driver"`

==== [[input_iam_role_arn]] <<input_iam_role_arn,iam_role_arn>>

Description: ARN of an OIDC assumable IAM role that has access to the EFS filesystem. When specified, this is added as an annotation to the EFS CSI driver controller ServiceAccount, to allow the driver to manage EFS access points for dynamic volumes provisioning.
Expand Down Expand Up @@ -308,10 +294,10 @@ Description: ID to pass other modules in order to refer to this module as a depe
[cols="a,a",options="header,autowidth"]
|===
|Name |Version
|[[provider_null]] <<provider_null,null>> |>= 3
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 5
|[[provider_utils]] <<provider_utils,utils>> |>= 1
|[[provider_aws]] <<provider_aws,aws>> |n/a
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 5
|[[provider_null]] <<provider_null,null>> |>= 3
|===

= Modules
Expand Down Expand Up @@ -346,12 +332,6 @@ Description: ID to pass other modules in order to refer to this module as a depe
|`"cluster"`
|no

|[[input_argocd_namespace]] <<input_argocd_namespace,argocd_namespace>>
|Namespace used by Argo CD where the Application and AppProject resources should be created.
|`string`
|n/a
|yes

|[[input_argocd_project]] <<input_argocd_project,argocd_project>>
|Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application.
|`string`
Expand All @@ -373,7 +353,7 @@ Description: ID to pass other modules in order to refer to this module as a depe
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v2.2.0"`
|`"v2.4.0"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
Expand Down Expand Up @@ -414,12 +394,6 @@ object({
|`{}`
|no

|[[input_name]] <<input_name,name>>
|Name used to override the chart name on deployment.
|`string`
|`"efs-csi-driver"`
|no

|[[input_efs_file_system_id]] <<input_efs_file_system_id,efs_file_system_id>>
|EFS Filesystem ID to use by the CSI driver to create volumes.
|`string`
Expand Down
1 change: 0 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
locals {
helm_values = [{
"aws-efs-csi-driver" = {
nameOverride = var.name
storageClasses = [{
name = "efs"
parameters = {
Expand Down
10 changes: 4 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ resource "argocd_project" "this" {

metadata {
name = var.destination_cluster != "in-cluster" ? "efs-csi-driver-${var.destination_cluster}" : "efs-csi-driver"
namespace = var.argocd_namespace
annotations = {
"devops-stack.io/argocd_namespace" = var.argocd_namespace
}
namespace = "argocd"
}

spec {
Expand Down Expand Up @@ -97,7 +94,7 @@ module "iam_assumable_role_efs" {
resource "argocd_application" "this" {
metadata {
name = var.destination_cluster != "in-cluster" ? "efs-csi-driver-${var.destination_cluster}" : "efs-csi-driver"
namespace = var.argocd_namespace
namespace = "argocd"
labels = merge({
"application" = "efs-csi-driver"
"cluster" = var.destination_cluster
Expand All @@ -119,7 +116,8 @@ resource "argocd_application" "this" {
path = "charts/efs-csi-driver"
target_revision = var.target_revision
helm {
values = data.utils_deep_merge_yaml.values.output
release_name = "efs-csi-driver"
values = data.utils_deep_merge_yaml.values.output
}
}

Expand Down
11 changes: 0 additions & 11 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ variable "cluster_name" {
default = "cluster"
}

variable "argocd_namespace" {
description = "Namespace used by Argo CD where the Application and AppProject resources should be created."
type = string
}

variable "argocd_project" {
description = "Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application."
type = string
Expand Down Expand Up @@ -67,12 +62,6 @@ variable "dependency_ids" {
## Module variables
#######################

variable "name" {
description = "Name used to override the chart name on deployment."
type = string
default = "efs-csi-driver"
}

variable "efs_file_system_id" {
description = "EFS Filesystem ID to use by the CSI driver to create volumes."
type = string
Expand Down