From a5d11d3da645c62763bb2f7a4ec91cbceeca74a3 Mon Sep 17 00:00:00 2001 From: incubator4 Date: Mon, 8 Jan 2024 21:12:39 +0800 Subject: [PATCH] feat: clickhouse --- application.tf | 28 +++++++-------- application_set.tf | 57 ++++++++++++++++++++++++++++++ clickhouse/dev/kustomization.yaml | 9 +++++ clickhouse/dev/values.yaml | 9 +++++ clickhouse/prod/kustomization.yaml | 9 +++++ clickhouse/prod/values.yaml | 9 +---- 6 files changed, 99 insertions(+), 22 deletions(-) create mode 100644 clickhouse/dev/kustomization.yaml create mode 100644 clickhouse/dev/values.yaml create mode 100644 clickhouse/prod/kustomization.yaml diff --git a/application.tf b/application.tf index 6a8c84b..29621af 100644 --- a/application.tf +++ b/application.tf @@ -13,11 +13,11 @@ resource "argocd_application" "argocd" { plugin { name = "avp-kustomize" env { - name = "APP_REPO" + name = "APP_REPO" value = "NaturalSelectionLabs/Hephaestus" } env { - name = "AVP_SECRET" + name = "AVP_SECRET" value = "guardian:avp-prod" } } @@ -44,11 +44,11 @@ resource "argocd_application" "grafana" { plugin { name = "avp-kustomize" env { - name = "APP_REPO" + name = "APP_REPO" value = "NaturalSelectionLabs/Hephaestus" } env { - name = "AVP_SECRET" + name = "AVP_SECRET" value = "guardian:avp-prod" } } @@ -75,11 +75,11 @@ resource "argocd_application" "cilium" { plugin { name = "avp-kustomize" env { - name = "APP_REPO" + name = "APP_REPO" value = "NaturalSelectionLabs/Hephaestus" } env { - name = "AVP_SECRET" + name = "AVP_SECRET" value = "guardian:avp-prod" } } @@ -107,11 +107,11 @@ resource "argocd_application" "keycloak" { plugin { name = "avp-kustomize" env { - name = "APP_REPO" + name = "APP_REPO" value = "NaturalSelectionLabs/Hephaestus" } env { - name = "AVP_SECRET" + name = "AVP_SECRET" value = "guardian:avp-prod" } } @@ -139,11 +139,11 @@ resource "argocd_application" "rabbitmq" { plugin { name = "avp-kustomize" env { - name = "APP_REPO" + name = "APP_REPO" value = "NaturalSelectionLabs/Hephaestus" } env { - name = "AVP_SECRET" + name = "AVP_SECRET" value = "guardian:avp-prod" } } @@ -170,11 +170,11 @@ resource "argocd_application" "discourse" { plugin { name = "avp-kustomize" env { - name = "APP_REPO" + name = "APP_REPO" value = "NaturalSelectionLabs/Hephaestus" } env { - name = "AVP_SECRET" + name = "AVP_SECRET" value = "guardian:avp-prod" } } @@ -202,11 +202,11 @@ resource "argocd_application" "ipfs" { plugin { name = "avp-kustomize" env { - name = "APP_REPO" + name = "APP_REPO" value = "NaturalSelectionLabs/Hephaestus" } env { - name = "AVP_SECRET" + name = "AVP_SECRET" value = "guardian:avp-prod" } } diff --git a/application_set.tf b/application_set.tf index 3b1970e..bcd9eca 100644 --- a/application_set.tf +++ b/application_set.tf @@ -651,3 +651,60 @@ resource "argocd_application_set" "jaeger" { } } + +resource "argocd_application_set" "clickhouse" { + metadata { + name = "clickhouse" + namespace = "guardian" + } + spec { + generator { + list { + elements = [ + { + cluster = argocd_cluster.dev.name + url = argocd_cluster.dev.server + }, + { + cluster = argocd_cluster.prod.name + url = argocd_cluster.prod.server + } + ] + } + } + template { + metadata { + name = "clickhouse-{{cluster}}" + labels = { + cluster = "{{cluster}}" + } + } + spec { + project = argocd_project.guardian.metadata[0].name + + source { + repo_url = var.repo_url + target_revision = "HEAD" + path = "clickhouse/{{cluster}}" + plugin { + name = "avp-kustomize" + env { + name = "APP_REPO" + value = "NaturalSelectionLabs/Hephaestus" + } + env { + name = "AVP_SECRET" + value = "guardian:avp-{{cluster}}" + } + } + } + + destination { + server = "{{url}}" + namespace = "guardian" + } + } + } + + } +} diff --git a/clickhouse/dev/kustomization.yaml b/clickhouse/dev/kustomization.yaml new file mode 100644 index 0000000..0b09642 --- /dev/null +++ b/clickhouse/dev/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +helmCharts: + - name: clickhouse + releaseName: clickhouse + repo: https://charts.bitnami.com/bitnami + valuesFile: values.yaml + version: 4.x.x diff --git a/clickhouse/dev/values.yaml b/clickhouse/dev/values.yaml new file mode 100644 index 0000000..cde3a0f --- /dev/null +++ b/clickhouse/dev/values.yaml @@ -0,0 +1,9 @@ +global: + storageClass: standard +shards: 1 +replicaCount: 1 +persistence: + size: 100Gi +zookeeper: + persistence: + size: 100Gi \ No newline at end of file diff --git a/clickhouse/prod/kustomization.yaml b/clickhouse/prod/kustomization.yaml new file mode 100644 index 0000000..0b09642 --- /dev/null +++ b/clickhouse/prod/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +helmCharts: + - name: clickhouse + releaseName: clickhouse + repo: https://charts.bitnami.com/bitnami + valuesFile: values.yaml + version: 4.x.x diff --git a/clickhouse/prod/values.yaml b/clickhouse/prod/values.yaml index 5a2a4a5..c14123a 100644 --- a/clickhouse/prod/values.yaml +++ b/clickhouse/prod/values.yaml @@ -1,14 +1,7 @@ global: storageClass: standard -shards: 1 -replicaCount: 1 persistence: size: 100Gi zookeeper: persistence: - size: 100Gi -service: - type: LoadBalancer - annotations: - service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: intranet - service.beta.kubernetes.io/alibaba-cloud-loadbalancer-name: clickhouse \ No newline at end of file + size: 100Gi \ No newline at end of file