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

[#2586] Terraform core module has wrong Helm link #2587

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -17,6 +17,9 @@ spec:
name: frontend-ui
port:
number: 80
{{- if .Values.global.host }}
host: {{ .Values.global.host }}
{{- end }}
ingressClassName: nginx
---
kind: Ingress
Expand All @@ -38,4 +41,7 @@ spec:
name: frontend-ui
port:
number: 80
{{- if .Values.global.host }}
host: {{ .Values.global.host }}
{{- end }}
ingressClassName: nginx
Expand Up @@ -17,4 +17,7 @@ spec:
name: frontend-chat-plugin
port:
number: 80
{{- if .Values.global.host }}
host: {{ .Values.global.host }}
{{- end }}
ingressClassName: nginx
Expand Up @@ -208,4 +208,7 @@ spec:
name: sources-chatplugin
port:
number: 80
{{- if .Values.global.host }}
host: {{ .Values.global.host }}
{{- end }}
ingressClassName: nginx
10 changes: 10 additions & 0 deletions infrastructure/terraform/main/main.tf
@@ -1,3 +1,13 @@
provider "helm" {
kubernetes {
config_path = var.kubeconfig_output_path
}
}

provider "kubernetes" {
config_path = var.kubeconfig_output_path
}

module "my-airy-core" {
source = "../modules/core"
values_yaml = data.template_file.airy_yaml.rendered
Expand Down
8 changes: 4 additions & 4 deletions infrastructure/terraform/modules/aws_eks/main.tf
Expand Up @@ -96,10 +96,10 @@ module "eks" {
resource "aws_eks_fargate_profile" "example" {


cluster_name = module.eks.cluster_name
fargate_profile_name = "example"
pod_execution_role_arn = module.eks.cluster_iam_role_arn
subnet_ids = module.eks.subnet_ids
cluster_name = var.core_id
fargate_profile_name = "stateless"
pod_execution_role_arn = module.eks.fargate_iam_role_arn
subnet_ids = module.vpc.private_subnets

dynamic "selector" {
for_each = var.fargate_profiles
Expand Down
1 change: 0 additions & 1 deletion infrastructure/terraform/modules/aws_eks/variables.tf
Expand Up @@ -38,7 +38,6 @@ variable "private_subnets" {

variable "public_subnets" {
default = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]

}

variable "instance_type" {
Expand Down
16 changes: 12 additions & 4 deletions infrastructure/terraform/modules/core/main.tf
Expand Up @@ -22,21 +22,29 @@ data "http" "core_version" {
}
}

locals {
core_version = var.core_version != "" ? var.core_version : trimspace(data.http.core_version.body)
}

resource "helm_release" "airy_core" {
name = "airy-release"
chart = "https://airy-core-helm-charts.s3.amazonaws.com/testing/airy-${trimspace(data.http.core_version.body)}.tgz"
chart = "https://airy-core-helm-charts.s3.amazonaws.com/stable/airy-${local.core_version}.tgz"

timeout = "600"
values = [
var.values_yaml
]

namespace = var.namespace

namespace = var.namespaced ? var.core_id : "default"
set {
name = "global.appImageTag"
value = local.core_version
}

set {
name = "global.appImageTag"
value = trimspace(data.http.core_version.body)
name = "ingress-controller.enabled"
value = var.ingress_controller_enabled
}

depends_on = [
Expand Down
30 changes: 20 additions & 10 deletions infrastructure/terraform/modules/core/variables.tf
@@ -1,19 +1,29 @@
variable "kubeconfig_output_path" {
default = "./.kubeconfig"
}

variable "kubernetes_namespace" {
default = "default"
description = "The KUBECONFIG file"
default = "./.kubeconfig"
}

variable "core_id" {
default = "airy-core"
description = "Unique ID if the Airy Core instance"
default = "airy-core"
}

variable "namespaced" {
default = false
variable "namespace" {
description = "The Kubernetes namespace where Airy Core will be deployed"
default = "default"
}

variable "values_yaml" {

}
description = "The helm values overrides"
}

variable "core_version" {
description = "Version of the Airy Core instance"
type = string
}

variable "ingress_controller_enabled" {
description = "Whether to create the NGinx ingress controller"
type = string
default = "true"
}