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

Merge release branch changes to terraform #1659

Merged
merged 7 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion terraform/eks/adot-operator/adot-operator-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kubeRBACProxy:
image:
repository: public.ecr.aws/aws-observability/mirror-kube-rbac-proxy
tag: "v0.13.0"
tag: "v0.15.0"
11 changes: 0 additions & 11 deletions terraform/eks/adot-operator/adot_collector_deployment.tpl

This file was deleted.

14 changes: 11 additions & 3 deletions terraform/eks/adot-operator/adot_operator.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,21 @@ variable "aoc_image_repo" {
variable "aoc_version" {
}

resource "kubernetes_namespace" "adot_operator_ns" {
metadata {
name = "adot-operator-${var.testing_id}-ns"
}
}

resource "helm_release" "adot-operator" {
name = "adot-operator-${var.testing_id}"

repository = "https://open-telemetry.github.io/opentelemetry-helm-charts"
chart = "opentelemetry-operator"
version = "0.63.2"
namespace = "adot-operator-${var.testing_id}-ns"
wait = true
timeout = 600

values = [
file("./adot-operator/adot-operator-values.yaml")
Expand All @@ -65,7 +75,5 @@ resource "helm_release" "adot-operator" {
value = var.aoc_image_repo
}

provisioner "local-exec" {
command = "kubectl wait --kubeconfig=${var.kubeconfig} --timeout=5m --for=condition=available deployment adot-operator-${var.testing_id}-opentelemetry-operator"
}
depends_on = [kubernetes_namespace.adot_operator_ns]
}
2 changes: 1 addition & 1 deletion terraform/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ module "validator" {
module.adot_operator,
kubectl_manifest.logs_sample_fargate_deploy,
null_resource.prom_base_ready_check,
null_resource.aoc_deployment_adot_operator,
kubectl_manifest.aoc_deployment_adot_operator,
kubernetes_deployment.aoc_deployment,
]
}
46 changes: 15 additions & 31 deletions terraform/eks/otlp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module "iam_assumable_role_sample_app" {
version = "4.7.0"
}

# service acount name will be passed to the otlp module for use in the push mode sample app
# service account name will be passed to the otlp module for use in the push mode sample app
resource "kubernetes_service_account" "sample-app-sa" {
metadata {
name = "sample-app-sa-${module.common.testing_id}"
Expand Down Expand Up @@ -267,38 +267,22 @@ resource "kubernetes_service" "mocked_server_service" {
}
}

data "template_file" "adot_collector_config_file" {
resource "kubectl_manifest" "aoc_deployment_adot_operator" {
count = local.is_otlp_base_scenario && local.is_operator_testcase ? 1 : 0

template = file("./adot-operator/adot_collector_deployment.tpl")

vars = {
AOC_NAMESPACE = var.deployment_type == "fargate" ? kubernetes_namespace.aoc_fargate_ns.metadata[0].name : kubernetes_namespace.aoc_ns.metadata[0].name
AOC_IMAGE = module.common.aoc_image
AOC_DEPLOY_MODE = var.aoc_deploy_mode
AOC_SERVICEACCOUNT = "aoc-role-${module.common.testing_id}"
AOC_CONFIG = module.basic_components.0.otconfig_content
}

depends_on = [module.adot_operator]
}

resource "local_file" "adot_collector_deployment" {
count = local.is_otlp_base_scenario && local.is_operator_testcase ? 1 : 0

filename = "adot_collector.yaml"
content = data.template_file.adot_collector_config_file.0.rendered

depends_on = [module.adot_operator]
}

resource "null_resource" "aoc_deployment_adot_operator" {
count = local.is_otlp_base_scenario && local.is_operator_testcase ? 1 : 0

provisioner "local-exec" {
command = "kubectl apply --kubeconfig=${local_file.kubeconfig.filename} -f ${local_file.adot_collector_deployment.0.filename}"
}

yaml_body = <<-EOF
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: aoc
namespace: ${var.deployment_type == "fargate" ? kubernetes_namespace.aoc_fargate_ns.metadata[0].name : kubernetes_namespace.aoc_ns.metadata[0].name}
spec:
image: ${module.common.aoc_image}
mode: ${var.aoc_deploy_mode}
serviceAccount: aoc-role-${module.common.testing_id}
config: |
${module.basic_components.0.otconfig_content}
EOF
depends_on = [module.adot_operator]
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ variable "operator_repository" {

variable "operator_tag" {
type = string
default = "v0.99.0"
default = "v0.102.0"
}

// This will only fetch data from the MSK cluster in case this value is set
Expand Down
Loading