Skip to content

Commit

Permalink
Merge branch 'feat/prom_jaeger' of github.com:clouddrove/terraform-aw…
Browse files Browse the repository at this point in the history
…s-eks-addons into feat/prom_jaeger
  • Loading branch information
anmolnagpal committed Dec 29, 2023
2 parents 5bb32b5 + 80c3b94 commit d725de1
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 348 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- master
paths-ignore:
- '**/*README.md'
workflow_dispatch:

jobs:
Expand Down
117 changes: 0 additions & 117 deletions _examples/complete/config/jaeger/jaeger.yaml

This file was deleted.

15 changes: 12 additions & 3 deletions _examples/complete/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,31 @@ provider "aws" {

provider "kubernetes" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}

provider "helm" {
kubernetes {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}
}

provider "kubectl" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
load_config_file = false
}

# ------------------------------------------------------------------------------
Expand Down
7 changes: 2 additions & 5 deletions _examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,19 @@ variable "prometheus_extra_configs" {
variable "jaeger_extra_configs" {
type = any
default = {
manifest_deployment = true
enable_cassandra = false
enable_kafka = false
enable_cassandra = false
enable_kafka = false
}
}

variable "jaeger_extra_manifests" {
type = object({
jaeger_cassandra_file_path = list(any)
jaeger_kafka_file_path = list(any)
jaeger_manifest = list(any)
})
default = {
jaeger_cassandra_file_path = [""]
jaeger_kafka_file_path = [""]
jaeger_manifest = ["./config/jaeger/jaeger.yaml"]
}
description = "Path of override files to create customized depedency helm charts for jaeger"
}
Expand Down
2 changes: 1 addition & 1 deletion _examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ terraform {
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.7.0"
version = ">= 1.14.0"
}
}
}
15 changes: 12 additions & 3 deletions _examples/external-eks/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@ provider "aws" {
provider "kubernetes" {
host = data.aws_eks_cluster.eks_cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
token = join("", data.aws_eks_cluster_auth.eks_cluster[*].token)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}

provider "helm" {
kubernetes {
host = data.aws_eks_cluster.eks_cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
token = join("", data.aws_eks_cluster_auth.eks_cluster[*].token)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}
}

provider "kubectl" {
host = data.aws_eks_cluster.eks_cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
token = join("", data.aws_eks_cluster_auth.eks_cluster[*].token)
token = data.aws_eks_cluster_auth.eks_cluster.token
load_config_file = false
}

data "aws_eks_cluster_auth" "eks_cluster" {
Expand Down
2 changes: 1 addition & 1 deletion addons/aws-load-balancer-controller/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
name = try(var.aws_load_balancer_controller_extra_configs.name, local.name)
chart = try(var.aws_load_balancer_controller_extra_configs.chart, local.name)
repository = try(var.aws_load_balancer_controller_extra_configs.repository, "https://aws.github.io/eks-charts")
version = try(var.aws_load_balancer_controller_extra_configs.version, "1.5.3")
version = try(var.aws_load_balancer_controller_extra_configs.version, "1.6.2")
namespace = try(var.aws_load_balancer_controller_extra_configs.namespace, "kube-system")
description = "AWS Load Balancer Controller helm Chart deployment configuration"
timeout = try(var.aws_load_balancer_controller_extra_configs.timeout, "600")
Expand Down
117 changes: 0 additions & 117 deletions addons/jaeger/config/manifest/jaeger.yaml

This file was deleted.

17 changes: 1 addition & 16 deletions addons/jaeger/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
locals {
enable_manifest = try(var.cassandra_extra_configs.manifest_deployment, true)
}

module "cassandra" {
count = try(var.jaeger_extra_configs.enable_cassandra, false) ? 1 : 0
source = "../helm"
Expand All @@ -23,23 +19,12 @@ module "kafka" {
module "jaeger" {
source = "../helm"

manage_via_gitops = local.enable_manifest
manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
addon_context = var.addon_context

depends_on = [
module.cassandra,
module.kafka
]
}

data "kubectl_file_documents" "docs" {
content = try(file(var.jaeger_extra_manifests.jaeger_manifest[0]), file("./config/manifest/jaeger.yaml"))
}

# Jaeger Deployment using manifest file
resource "kubectl_manifest" "jager_manifest" {
count = local.enable_manifest ? length(data.kubectl_file_documents.docs.documents) : 0
depends_on = [module.jaeger]
yaml_body = element(data.kubectl_file_documents.docs.documents, count.index)
}
Loading

0 comments on commit d725de1

Please sign in to comment.