Skip to content

Commit

Permalink
Merge branch 'main' into eks-cluster-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ltellesfl authored Nov 27, 2024
2 parents 233d587 + a8904a9 commit a4e6264
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 33 deletions.
6 changes: 5 additions & 1 deletion azure/ipa.tf
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ spec:
prune: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
source:
chart: cod-smoketests
repoURL: ${var.ipa_smoketest_repo}
Expand Down Expand Up @@ -866,6 +867,7 @@ spec:
prune: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
retry:
limit: 8
backoff:
Expand Down Expand Up @@ -1013,6 +1015,7 @@ metadata:
- resources-finalizer.argocd.argoproj.io
annotations:
avp.kubernetes.io/path: ${each.value.vaultPath}
argocd.argoproj.io/compare-options: ServerSideDiff=true
labels:
app: ${each.value.name}
region: ${var.region}
Expand All @@ -1028,6 +1031,7 @@ spec:
prune: true
syncOptions:
- CreateNamespace=${each.value.createNamespace}
- ServerSideApply=true
source:
chart: ${each.value.chart}
repoURL: ${each.value.repo}
Expand Down Expand Up @@ -1057,7 +1061,7 @@ resource "helm_release" "external-secrets" {
name = "external-secrets"
create_namespace = true
namespace = "default"
repository = "https://charts.external-secrets.io/"
repository = var.ipa_repo
chart = "external-secrets"
version = var.external_secrets_version
wait = true
Expand Down
8 changes: 4 additions & 4 deletions azure/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ingress-nginx:
) : (<<EOT
thanos: {}
EOT
# )
)
alerting_configuration_values = var.alerting_enabled == false ? (<<EOT
noExtraConfigs: true
EOT
Expand Down Expand Up @@ -369,7 +369,7 @@ resource "helm_release" "keda-monitoring" {
name = "keda"
create_namespace = true
namespace = "default"
repository = "https://kedacore.github.io/charts"
repository = var.ipa_repo
chart = "keda"
version = var.keda_version
wait = true
Expand Down Expand Up @@ -433,9 +433,9 @@ resource "helm_release" "opentelemetry-collector" {
name = "opentelemetry-collector"
create_namespace = true
namespace = "default"
repository = "https://open-telemetry.github.io/opentelemetry-helm-charts"
repository = var.ipa_repo
chart = "opentelemetry-collector"
version = var.opentelemetry-collector_version
version = var.opentelemetry_collector_version


values = [<<EOF
Expand Down
2 changes: 1 addition & 1 deletion azure/tf-smoketest-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ resource "kubernetes_config_map" "terraform-variables" {
monitoring_enabled = "${jsonencode(var.monitoring_enabled)}"
keda_version = "${jsonencode(var.keda_version)}"
external_secrets_version = "${jsonencode(var.external_secrets_version)}"
opentelemetry_collector_version = "${jsonencode(var.opentelemetry-collector_version)}"
opentelemetry_collector_version = "${jsonencode(var.opentelemetry_collector_version)}"
ipa_smoketest_values = "${jsonencode(var.ipa_smoketest_values)}"
ipa_smoketest_repo = "${jsonencode(var.ipa_smoketest_repo)}"
ipa_smoketest_version = "${jsonencode(var.ipa_smoketest_version)}"
Expand Down
2 changes: 1 addition & 1 deletion azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ variable "external_secrets_version" {
description = "Version of external-secrets helm chart"
}

variable "opentelemetry-collector_version" {
variable "opentelemetry_collector_version" {
type = string
default = "0.97.1"
description = "Version of opentelemetry-collector helm chart"
Expand Down
29 changes: 24 additions & 5 deletions ipa.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,34 @@ locals {
csi:
driver: fsx.csi.aws.com
volumeAttributes:
dnsname: ${module.fsx-storage[0].fsx-rwx.dns_name}
mountname: ${module.fsx-storage[0].fsx-rwx.mount_name}
volumeHandle: ${module.fsx-storage[0].fsx-rwx.id}
dnsname: ${module.fsx-storage[0].fsx_rwx_dns_name}
mountname: ${module.fsx-storage[0].fsx_rwx_mount_name}
volumeHandle: ${module.fsx-storage[0].fsx_rwx_id}
indicoStorageClass:
enabled: true
name: indico-sc
provisioner: fsx.csi.aws.com
parameters:
securityGroupIds: ${local.security_group_id}
subnetId: ${module.fsx-storage[0].fsx-rwx.subnet_ids[0]}
subnetId: ${module.fsx-storage[0].fsx_rwx_subnet_ids[0]}
EOF
] : []
storage_spec = var.include_fsx == true ? local.fsx_values : local.efs_values
on_prem_values = var.on_prem_test == true ? [<<EOF
storage:
indicoStorageClass:
enabled: false
existingPVC:
name: read-write
namespace: default
onprem:
enabled: true
storageClass: nfs-client
size: 100Gi
EOF
] : []
#storage_spec = var.include_fsx == true ? local.fsx_values : local.efs_values
storage_spec = var.on_prem_test == true ? local.on_prem_values : var.include_fsx == true ? local.fsx_values : local.efs_values

alb_ipa_values = var.enable_waf == true ? (<<EOT
app-edge:
image:
Expand Down Expand Up @@ -1348,6 +1363,7 @@ spec:
prune: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
source:
chart: cod-smoketests
Expand Down Expand Up @@ -1444,6 +1460,7 @@ spec:
prune: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
source:
chart: ipa
repoURL: ${var.ipa_repo}
Expand Down Expand Up @@ -1613,6 +1630,7 @@ metadata:
- resources-finalizer.argocd.argoproj.io
annotations:
avp.kubernetes.io/path: ${each.value.vaultPath}
argocd.argoproj.io/compare-options: ServerSideDiff=true
labels:
app: ${each.value.name}
region: ${var.region}
Expand All @@ -1628,6 +1646,7 @@ spec:
prune: true
syncOptions:
- CreateNamespace=${each.value.createNamespace}
- ServerSideApply=true
source:
chart: ${each.value.chart}
repoURL: ${each.value.repo}
Expand Down
14 changes: 12 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ module "efs-storage-local-registry" {
module "fsx-storage" {
count = var.include_fsx == true ? 1 : 0
source = "app.terraform.io/indico/indico-aws-fsx/mod"
version = "1.4.2"
version = "2.0.0"
label = var.label
additional_tags = var.additional_tags
region = var.region
Expand All @@ -293,7 +293,17 @@ module "fsx-storage" {
api_models_bucket = module.s3-storage.api_models_s3_bucket_name
kms_key = module.kms_key.key
per_unit_storage_throughput = var.per_unit_storage_throughput
deployment_type = var.fsx_deployment_type
include_rox = var.include_rox
fsx_type = var.fsx_type
fsx_rwx_id = var.fsx_rwx_id
fsx_rwx_subnet_ids = var.fsx_rwx_subnet_ids
fsx_rwx_security_group_ids = var.fsx_rwx_security_group_ids
fsx_rwx_dns_name = var.fsx_rwx_dns_name
fsx_rwx_mount_name = var.fsx_rwx_mount_name
fsx_rwx_arn = var.fsx_rwx_arn
fsx_rox_id = var.fsx_rox_id
fsx_rox_arn = var.fsx_rox_arn
}

module "iam" {
Expand Down Expand Up @@ -487,7 +497,7 @@ module "argo-registration" {
}

locals {
security_group_id = var.include_fsx == true ? tolist(module.fsx-storage[0].fsx-rwx.security_group_ids)[0] : ""
security_group_id = var.include_fsx == true ? tolist(module.fsx-storage[0].fsx_rwx_security_group_ids)[0] : ""
cluster_name = var.label
dns_zone_name = var.dns_zone_name == "" ? lower("${var.aws_account}.${var.domain_suffix}") : var.dns_zone_name
dns_name = var.domain_host == "" ? lower("${var.label}.${var.region}.${local.dns_zone_name}") : var.domain_host
Expand Down
2 changes: 1 addition & 1 deletion monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
thanos: {}
EOT
)

backend_port = var.acm_arn != "" ? "http" : "https"
enableHttp = var.acm_arn != "" || var.use_nlb == true ? false : true
lb_config = var.acm_arn != "" ? local.acm_loadbalancer_config : local.loadbalancer_config
Expand Down
26 changes: 16 additions & 10 deletions on_prem_test.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
privileged: true
volumeMounts:
- name: storage
mountPath: /nfs-storage
mountPath: /exports
resources:
requests:
cpu: 450m
Expand Down Expand Up @@ -133,15 +133,14 @@ resource "null_resource" "get_nfs_server_ip" {

resource "helm_release" "nfs-provider" {
count = var.on_prem_test == true ? 1 : 0
name = "nfs-subdir-external-provisioner"
name = "csi-driver-nfs"
repository = var.ipa_repo
chart = "nfs-subdir-external-provisioner"
version = var.nfs_subdir_external_provisioner_version
chart = "csi-driver-nfs"
version = var.csi_driver_nfs_version
namespace = "default"
depends_on = [
module.cluster,
kubectl_manifest.nfs_server_service,
data.local_file.nfs_ip
kubectl_manifest.nfs_server_service
]

# // prometheus URL
Expand All @@ -151,11 +150,18 @@ resource "helm_release" "nfs-provider" {
# }

values = [<<EOF
nfs-subdir-external-provisioner:
nfs:
server: ${data.local_file.nfs_ip[0].content}
csi-driver-nfs:
enabled: true
feature:
enableFSGroupPolicy: true
image:
repository: ${var.image_registry}/registry.k8s.io/sig-storage/nfs-subdir-external-provisioner
baseRepo: ${var.image_registry}
storageClass:
create: true
name: nfs-client
parameters:
server: nfs-service.default.svc.cluster.local
share: /nfs-storage
EOF
]
}
Expand Down
16 changes: 8 additions & 8 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ output "efs_filesystem_id" {
description = "ID of the EFS filesystem"
value = var.include_efs == true ? module.efs-storage[0].efs_filesystem_id : ""
}
output "fsx-rwx" {
output "fsx_rwx_id" {
description = "Read write filesystem"
value = var.include_fsx == true ? module.fsx-storage[0].fsx-rwx : null
value = var.include_fsx == true ? module.fsx-storage[0].fsx_rwx_id : null
}

output "fsx-rox" {
output "fsx_rox_id" {
description = "Read only filesystem"
value = var.include_rox ? module.fsx-storage[0].fsx-rox : ""
value = var.include_rox ? module.fsx-storage[0].fsx_rox_id : ""
}

output "key_pem" {
Expand All @@ -35,19 +35,19 @@ output "key_pem" {
}

output "fsx_storage_fsx_rwx_dns_name" {
value = var.include_fsx == true ? module.fsx-storage[0].fsx-rwx.dns_name : ""
value = var.include_fsx == true ? module.fsx-storage[0].fsx_rwx_dns_name : ""
}

output "fsx_storage_fsx_rwx_mount_name" {
value = var.include_fsx == true ? module.fsx-storage[0].fsx-rwx.mount_name : ""
value = var.include_fsx == true ? module.fsx-storage[0].fsx_rwx_mount_name : ""
}

output "fsx_storage_fsx_rwx_volume_handle" {
value = var.include_fsx == true ? module.fsx-storage[0].fsx-rwx.id : ""
value = var.include_fsx == true ? module.fsx-storage[0].fsx_rwx_id : ""
}

output "fsx_storage_fsx_rwx_subnet_id" {
value = var.include_fsx == true ? module.fsx-storage[0].fsx-rwx.subnet_ids[0] : ""
value = var.include_fsx == true ? module.fsx-storage[0].fsx_rwx_subnet_ids[0] : ""
}

output "cluster_name" {
Expand Down
11 changes: 11 additions & 0 deletions tf-smoketest-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ resource "kubernetes_config_map" "terraform-variables" {
external_secrets_version = "${jsonencode(var.external_secrets_version)}"
opentelemetry_collector_version = "${jsonencode(var.opentelemetry_collector_version)}"
nfs_subdir_external_provisioner_version = "${jsonencode(var.nfs_subdir_external_provisioner_version)}"
csi_driver_nfs_version = "${jsonencode(var.csi_driver_nfs_version)}"
include_fsx = "${jsonencode(var.include_fsx)}"
include_pgbackup = "${jsonencode(var.include_pgbackup)}"
include_efs = "${jsonencode(var.include_efs)}"
Expand Down Expand Up @@ -198,6 +199,16 @@ resource "kubernetes_config_map" "terraform-variables" {
api_model_destination_bucket = "${jsonencode(var.api_model_destination_bucket)}"
create_node_role = "${jsonencode(var.create_node_role)}"
node_role_name_override = "${jsonencode(var.node_role_name_override)}"
fsx_deployment_type = "${jsonencode(var.fsx_deployment_type)}"
fsx_type = "${jsonencode(var.fsx_type)}"
fsx_rwx_id = "${jsonencode(var.fsx_rwx_id)}"
fsx_rwx_subnet_ids = "${jsonencode(var.fsx_rwx_subnet_ids)}"
fsx_rwx_security_group_ids = "${jsonencode(var.fsx_rwx_security_group_ids)}"
fsx_rwx_dns_name = "${jsonencode(var.fsx_rwx_dns_name)}"
fsx_rwx_mount_name = "${jsonencode(var.fsx_rwx_mount_name)}"
fsx_rwx_arn = "${jsonencode(var.fsx_rwx_arn)}"
fsx_rox_id = "${jsonencode(var.fsx_rox_id)}"
fsx_rox_arn = "${jsonencode(var.fsx_rox_arn)}"

}
}
Expand Down
Loading

0 comments on commit a4e6264

Please sign in to comment.