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 #23

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
32 changes: 3 additions & 29 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,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_create_role]] <<input_create_role,create_role>>

Description: Boolean to indicate that the OIDC assumable IAM role should be created. **If passing `iam_role_arn` this should be false, otherwise if you want to create the OIDC assumable IAM role provided by this module, you will need to specify the variable `cluster_oidc_issuer_url`.**
Expand Down Expand Up @@ -160,7 +154,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 @@ -202,14 +196,6 @@ Type: `map(string)`

Default: `{}`

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

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

Type: `string`

Default: `"ebs-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 EBS volumes. When specified, this is added as an annotation to the EBS CSI driver controller ServiceAccount, to allow the driver to manage EBS access points for dynamic volumes provisioning.
Expand Down Expand Up @@ -256,9 +242,9 @@ 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_utils]] <<provider_utils,utils>> |>= 1
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 5
|[[provider_null]] <<provider_null,null>> |>= 3
|===

= Modules
Expand Down Expand Up @@ -292,12 +278,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 @@ -319,7 +299,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 @@ -360,12 +340,6 @@ object({
|`{}`
|no

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

|[[input_create_role]] <<input_create_role,create_role>>
|Boolean to indicate that the OIDC assumable IAM role should be created. **If passing `iam_role_arn` this should be false, otherwise if you want to create the OIDC assumable IAM role provided by this module, you will need to specify the variable `cluster_oidc_issuer_url`.**
|`bool`
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-ebs-csi-driver" = {
nameOverride = var.name
controller = {
serviceAccount = {
annotations = {
Expand Down
10 changes: 4 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ resource "argocd_project" "this" {
count = var.argocd_project == null ? 1 : 0
metadata {
name = var.destination_cluster != "in-cluster" ? "ebs-csi-driver-${var.destination_cluster}" : "ebs-csi-driver"
namespace = var.argocd_namespace
annotations = {
"devops-stack.io/argocd_namespace" = var.argocd_namespace
}
namespace = "argocd"
}

spec {
Expand Down Expand Up @@ -54,7 +51,7 @@ module "iam_assumable_role_ebs" {
resource "argocd_application" "this" {
metadata {
name = var.destination_cluster != "in-cluster" ? "ebs-csi-driver-${var.destination_cluster}" : "ebs-csi-driver"
namespace = var.argocd_namespace
namespace = "argocd"
labels = merge({
"application" = "ebs-csi-driver"
"cluster" = var.destination_cluster
Expand All @@ -76,7 +73,8 @@ resource "argocd_application" "this" {
path = "charts/ebs-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 = "ebs-csi-driver"
}

variable "create_role" {
description = "Boolean to indicate that the OIDC assumable IAM role should be created. **If passing `iam_role_arn` this should be false, otherwise if you want to create the OIDC assumable IAM role provided by this module, you will need to specify the variable `cluster_oidc_issuer_url`.**"
type = bool
Expand Down