Skip to content

Commit

Permalink
feat: clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Jan 8, 2024
1 parent a3b2664 commit a5d11d3
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 22 deletions.
28 changes: 14 additions & 14 deletions application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand All @@ -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"
}
}
Expand All @@ -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"
}
}
Expand Down Expand Up @@ -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"
}
}
Expand Down Expand Up @@ -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"
}
}
Expand All @@ -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"
}
}
Expand Down Expand Up @@ -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"
}
}
Expand Down
57 changes: 57 additions & 0 deletions application_set.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

}
}
9 changes: 9 additions & 0 deletions clickhouse/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions clickhouse/dev/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
global:
storageClass: standard
shards: 1
replicaCount: 1
persistence:
size: 100Gi
zookeeper:
persistence:
size: 100Gi
9 changes: 9 additions & 0 deletions clickhouse/prod/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 1 addition & 8 deletions clickhouse/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -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
size: 100Gi

0 comments on commit a5d11d3

Please sign in to comment.