From 22bb969534cf47a751b515f51d394eaef951404d Mon Sep 17 00:00:00 2001 From: Timur Galeev Date: Mon, 26 Oct 2020 13:40:39 +0100 Subject: [PATCH 1/7] Update versions --- charts/00-variable.tf.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/charts/00-variable.tf.json b/charts/00-variable.tf.json index d1f071e..3187814 100644 --- a/charts/00-variable.tf.json +++ b/charts/00-variable.tf.json @@ -1,11 +1,11 @@ { "variable": { "bitnami_external_dns": { - "default": "3.3.0", + "default": "3.4.1", "description": "bitnami/external-dns" }, "codecentric_keycloak": { - "default": "8.3.0", + "default": "9.1.0", "description": "codecentric/keycloak" }, "gabibbo97_keycloak_gatekeeper": { @@ -13,19 +13,19 @@ "description": "gabibbo97/keycloak-gatekeeper" }, "jetstack_cert_manager": { - "default": "v0.16.1", + "default": "v1.0.2", "description": "jetstack/cert-manager" }, "oteemo_sonarqube": { - "default": "6.6.0", + "default": "6.8.0", "description": "oteemo/sonarqube" }, "oteemo_sonatype_nexus": { - "default": "2.7.0", + "default": "2.8.0", "description": "oteemo/sonatype-nexus" }, "stable_chartmuseum": { - "default": "2.13.2", + "default": "2.13.3", "description": "stable/chartmuseum" }, "stable_grafana": { @@ -37,7 +37,7 @@ "description": "stable/jenkins" }, "stable_metrics_server": { - "default": "2.11.1", + "default": "2.11.2", "description": "stable/metrics-server" }, "stable_nginx_ingress": { @@ -53,19 +53,19 @@ "description": "stable/prometheus-operator" }, "argo_argo": { - "default": "0.9.8", + "default": "0.12.1", "description": "argo/argo" }, "argo_argo_cd": { - "default": "2.6.0", + "default": "2.7.4", "description": "argo/argo-cd" }, "argo_argo_events": { - "default": "0.17.0", + "default": "1.0.0", "description": "argo/argo-events" }, "argo_argo_rollouts": { - "default": "0.3.4", + "default": "0.3.6", "description": "argo/argo-rollouts" }, "stable_weave_scope": { From a04f6587479ab7adff4b414581fe4a215e3b1814 Mon Sep 17 00:00:00 2001 From: Timur Galeev Date: Mon, 26 Oct 2020 13:42:10 +0100 Subject: [PATCH 2/7] Fix readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e34168a..da9ad73 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Terraform and helm charts to provide deployment of the full EKS cluster ```bash brew update -brew install kubectl +brew install kubernetes-cli brew install python3 easy_install pip pip install awscli — upgrade — user From 8891a8c7a75fe66d47b78ac9a2f3d20668d69720 Mon Sep 17 00:00:00 2001 From: Timur Galeev Date: Mon, 26 Oct 2020 14:47:01 +0100 Subject: [PATCH 3/7] Fix update --- VERSION | 2 +- charts/04-backend.tf | 2 +- charts/modules/argo/values/argo-rollouts.yaml | 3 +-- charts/modules/ingress/values/ingress-nginx.yml | 2 +- eks-vpc/04-backend.tf | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index dd8a2af..4ba4bef 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.1.x \ No newline at end of file +v1.2.x \ No newline at end of file diff --git a/charts/04-backend.tf b/charts/04-backend.tf index b0ddf13..1f8643e 100644 --- a/charts/04-backend.tf +++ b/charts/04-backend.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">= 0.12" backend "s3" { bucket = "tfstate-demo-infra" key = "terraform/states/charts.tfstate" @@ -6,5 +7,4 @@ terraform { encrypt = true dynamodb_table = "tfstate_god_charts" } - required_version = ">= 0.12.0" } \ No newline at end of file diff --git a/charts/modules/argo/values/argo-rollouts.yaml b/charts/modules/argo/values/argo-rollouts.yaml index f51319b..1ffaf16 100644 --- a/charts/modules/argo/values/argo-rollouts.yaml +++ b/charts/modules/argo/values/argo-rollouts.yaml @@ -3,5 +3,4 @@ nameOverride: argo-rollouts installCRDs: true controller: - image: - tag: v0.8.3 + diff --git a/charts/modules/ingress/values/ingress-nginx.yml b/charts/modules/ingress/values/ingress-nginx.yml index 0e23aef..6409ff6 100644 --- a/charts/modules/ingress/values/ingress-nginx.yml +++ b/charts/modules/ingress/values/ingress-nginx.yml @@ -10,7 +10,7 @@ controller: service: annotations: external-dns.alpha.kubernetes.io/hostname: "*.godapp.de" - external-dns.alpha.kubernetes.io/ttl: "300" + # external-dns.alpha.kubernetes.io/ttl: "300" # service.beta.kubernetes.io/aws-load-balancer-type: "nlb" # service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http" service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "3600" diff --git a/eks-vpc/04-backend.tf b/eks-vpc/04-backend.tf index 26c8a6e..c190d5f 100644 --- a/eks-vpc/04-backend.tf +++ b/eks-vpc/04-backend.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">= 0.12" backend "s3" { bucket = "tfstate-demo-infra" key = "terraform/states/eks.tfstate" @@ -6,5 +7,4 @@ terraform { encrypt = true dynamodb_table = "tfstate_god" } - required_version = ">= 0.12.0" } \ No newline at end of file From 19dd237f572776dd02a0734d427514ed4faee8e6 Mon Sep 17 00:00:00 2001 From: Timur Galeev Date: Mon, 26 Oct 2020 21:46:16 +0100 Subject: [PATCH 4/7] Place versions --- charts/00-variables-modules.tf | 31 ------------------------------- charts/00-variables.tf | 34 ++++++++++++++++++++++++++++++++++ charts/modules/argo/main.tf | 26 +++++++++++++------------- 3 files changed, 47 insertions(+), 44 deletions(-) delete mode 100644 charts/00-variables-modules.tf diff --git a/charts/00-variables-modules.tf b/charts/00-variables-modules.tf deleted file mode 100644 index a9dbbac..0000000 --- a/charts/00-variables-modules.tf +++ /dev/null @@ -1,31 +0,0 @@ -variable "jenkins_enabled" { - default = false -} - -variable "chartmuseum_enabled" { - default = false -} - -variable "archiva_enabled" { - default = false -} - -variable "nexus_enabled" { - default = false -} - -variable "sonarqube_enabled" { - default = false -} - -variable "kiali_gatekeeper_enabled" { - default = false -} - -variable "tracing_gatekeeper_enabled" { - default = false -} - -variable "argo_enabled" { - default = false -} \ No newline at end of file diff --git a/charts/00-variables.tf b/charts/00-variables.tf index 143e036..8338051 100644 --- a/charts/00-variables.tf +++ b/charts/00-variables.tf @@ -14,3 +14,37 @@ variable "domains" { description = "domain name for ingress" default = "" } + +######### Charts + +variable "jenkins_enabled" { + default = false +} + +variable "chartmuseum_enabled" { + default = false +} + +variable "archiva_enabled" { + default = false +} + +variable "nexus_enabled" { + default = false +} + +variable "sonarqube_enabled" { + default = false +} + +variable "kiali_gatekeeper_enabled" { + default = false +} + +variable "tracing_gatekeeper_enabled" { + default = false +} + +variable "argo_enabled" { + default = false +} \ No newline at end of file diff --git a/charts/modules/argo/main.tf b/charts/modules/argo/main.tf index c1a0e53..c4985ee 100644 --- a/charts/modules/argo/main.tf +++ b/charts/modules/argo/main.tf @@ -28,23 +28,23 @@ resource "helm_release" "argo" { ] } -# resource "helm_release" "argo-events" { -# count = var.argo_count ? 1 : 0 -# repository = "https://argoproj.github.io/argo-helm" -# chart = "argo-events" -# version = var.argo_argo_events_version +resource "helm_release" "argo-events" { + count = var.argo_count ? 1 : 0 + repository = "https://argoproj.github.io/argo-helm" + chart = "argo-events" + version = var.argo_argo_events_version -# namespace = "argo-events" -# name = "argo-events" + namespace = "argo-events" + name = "argo-events" -# values = [ -# file("./modules/argo/values/argo-events.yaml") -# ] + values = [ + file("./modules/argo/values/argo-events.yaml") + ] -# wait = false + wait = false -# create_namespace = true -# } + create_namespace = true +} resource "helm_release" "argo-gatekeeper" { count = var.argo_count ? 1 : 0 From 774ec23a449044d6f52a8d82333ca858c96e1c17 Mon Sep 17 00:00:00 2001 From: Timur Galeev Date: Mon, 26 Oct 2020 21:52:27 +0100 Subject: [PATCH 5/7] Fix argo --- charts/modules/argo/main.tf | 23 +++++++ .../argo/values/argo-events-webhook.yaml | 62 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 charts/modules/argo/values/argo-events-webhook.yaml diff --git a/charts/modules/argo/main.tf b/charts/modules/argo/main.tf index c4985ee..95ad62f 100644 --- a/charts/modules/argo/main.tf +++ b/charts/modules/argo/main.tf @@ -46,6 +46,29 @@ resource "helm_release" "argo-events" { create_namespace = true } +resource "helm_release" "argo-events-webhook" { + count = var.argo_count ? 1 : 0 + + repository = "https://kubernetes-charts-incubator.storage.googleapis.com" + chart = "raw" + + namespace = "argo-events" + name = "argo-events-webhook" + + values = [ + file("./modules/argo/values/argo-webhook.yaml") + ] + + wait = false + + create_namespace = true + + depends_on = [ + helm_release.argo, + helm_release.argo-events, + ] +} + resource "helm_release" "argo-gatekeeper" { count = var.argo_count ? 1 : 0 diff --git a/charts/modules/argo/values/argo-events-webhook.yaml b/charts/modules/argo/values/argo-events-webhook.yaml new file mode 100644 index 0000000..70954dc --- /dev/null +++ b/charts/modules/argo/values/argo-events-webhook.yaml @@ -0,0 +1,62 @@ +resources: + - apiVersion: argoproj.io/v1alpha1 + kind: EventSource + metadata: + name: webhook + spec: + service: + ports: + - port: 12000 + targetPort: 12000 + webhook: + example: + port: "12000" + endpoint: /example + method: POST + + - apiVersion: argoproj.io/v1alpha1 + kind: Sensor + metadata: + name: webhook + spec: + template: + serviceAccountName: argo-events-sa + dependencies: + - name: test-dep + eventSourceName: webhook + eventName: example + triggers: + - template: + name: webhook-workflow-trigger + k8s: + group: argoproj.io + version: v1alpha1 + resource: workflows + operation: create + source: + resource: + apiVersion: argoproj.io/v1alpha1 + kind: Workflow + metadata: + generateName: webhook- + spec: + entrypoint: whalesay + arguments: + parameters: + - name: message + # the value will get overridden by event payload from test-dep + value: hello world + templates: + - name: whalesay + serviceAccountName: argo-events-sa + inputs: + parameters: + - name: message + container: + image: docker/whalesay:latest + command: [cowsay] + args: ["{{inputs.parameters.message}}"] + parameters: + - src: + dependencyName: test-dep + dest: spec.arguments.parameters.0.value \ No newline at end of file From c4c1d03b915a1b6866cf0314446e1dd513479b3d Mon Sep 17 00:00:00 2001 From: Timur Galeev Date: Mon, 26 Oct 2020 21:59:47 +0100 Subject: [PATCH 6/7] Update Keycloak --- charts/00-variable.tf.json | 2 +- charts/modules/keycloak/main.tf | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/charts/00-variable.tf.json b/charts/00-variable.tf.json index 3187814..64b7c9e 100644 --- a/charts/00-variable.tf.json +++ b/charts/00-variable.tf.json @@ -5,7 +5,7 @@ "description": "bitnami/external-dns" }, "codecentric_keycloak": { - "default": "9.1.0", + "default": "8.3.0", "description": "codecentric/keycloak" }, "gabibbo97_keycloak_gatekeeper": { diff --git a/charts/modules/keycloak/main.tf b/charts/modules/keycloak/main.tf index 2faeecf..9dcb7e7 100644 --- a/charts/modules/keycloak/main.tf +++ b/charts/modules/keycloak/main.tf @@ -6,6 +6,26 @@ resource "kubernetes_namespace" "keycloak" { } } +resource "kubernetes_secret" "keycloak-admin" { + count = var.keycloak_enabled ? 1 : 0 + + metadata { + namespace = "keycloak" + name = "keycloak-admin" + } + + type = "Opaque" + + data = { + "username" = "admin" + "password" = "password" + } + + depends_on = [ + kubernetes_namespace.keycloak, + ] +} + resource "kubernetes_secret" "keycloak-realm" { metadata { namespace = "keycloak" @@ -51,6 +71,7 @@ resource "helm_release" "keycloak" { } depends_on = [ + kubernetes_secret.keycloak-admin, kubernetes_secret.keycloak-realm, var.module_depends_on ] From 76f6f39798cb496ced73015d5e5a663a12d05dd6 Mon Sep 17 00:00:00 2001 From: Timur Galeev Date: Mon, 26 Oct 2020 22:03:14 +0100 Subject: [PATCH 7/7] lint --- charts/modules/argo/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/modules/argo/main.tf b/charts/modules/argo/main.tf index 95ad62f..de0d4c9 100644 --- a/charts/modules/argo/main.tf +++ b/charts/modules/argo/main.tf @@ -47,7 +47,7 @@ resource "helm_release" "argo-events" { } resource "helm_release" "argo-events-webhook" { - count = var.argo_count ? 1 : 0 + count = var.argo_count ? 1 : 0 repository = "https://kubernetes-charts-incubator.storage.googleapis.com" chart = "raw"