Skip to content

Commit

Permalink
feat: helm charts for running local setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsauravsahu committed Mar 17, 2023
1 parent 75fd4a8 commit 7f05c1c
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
flags:
rewrite: false

service:
name: kafka
port:
number: 9092

annotations:
hajimari.io/enable: "true"
hajimari.io/appName: "kafka"

ingress:
subdomain: kafka
routePath: /

hosts:
%{ for host in hosts ~}
- name: ${host}
%{ endfor ~}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
mode: "deployment"

config:
receivers:
filelog:
include: [/var/log/*.log]

processors:
batch: {}

exporters:
logging:
loglevel: debug

loki:
endpoint: "http://loki:3100/loki/api/v1/push"
labels:
attributes:
log.file.name: "filename"

service:
pipelines:
logs:
receivers: [filelog]
processors: [batch]
exporters: [loki]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
mode: "deployment"

config:
receivers:
filelog:
include: [/var/log/*.log]

processors:
batch: {}

exporters:
logging:
loglevel: debug

loki:
endpoint: "http://loki:3100/loki/api/v1/push"
labels:
attributes:
log.file.name: "filename"

service:
pipelines:
logs:
receivers: [filelog]
processors: [batch]
exporters: [loki]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nodeExporter:
# hostRootfs: false
hostRootFsMount:
enabled: false
mountPropagation: HostToContainer
2 changes: 1 addition & 1 deletion molecules/cluster-resources/externals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "helm_release" "external_apps" {
for_each = { for external in var.externals : external.name => external }
repository = each.value.repo
name = each.value.name
chart = each.value.name
chart = coalesce(each.value.chart_name, each.value.name)
namespace = each.value.namespace != null ? each.value.namespace : each.value.name
create_namespace = true
values = fileexists("./config/externals/${each.value.name}/values.yaml") == true ? ["${file("./config/externals/${each.value.name}/values.yaml")}"] : []
Expand Down
47 changes: 24 additions & 23 deletions molecules/cluster-resources/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,30 @@ variable "externals" {
description = "Details about external items to install"
type = list(object({
name = string
chart_name = optional(string)
repo = string
version = string
namespace = optional(string)
}))
// Feel free to move the applications arround, the order in the array does not matter
default = [
{
name = "ingress-nginx"
repo = "https://kubernetes.github.io/ingress-nginx"
version = "4.4.0"
},
# {
# name = "ingress-nginx"
# repo = "https://kubernetes.github.io/ingress-nginx"
# version = "4.4.0"
# },
{
name = "hajimari"
repo = "https://hajimari.io"
version = "1.2.0"
namespace = "homelab"
},
{
name = "postgresql"
repo = "https://cetic.github.io/helm-charts"
version = "0.2.3"
namespace = "homelab"
},
# {
# name = "postgresql"
# repo = "https://cetic.github.io/helm-charts"
# version = "0.2.3"
# namespace = "homelab"
# },
// TODO: nextcloud fails due to slow startup, need to figure this out
# {
# name = "nextcloud"
Expand All @@ -58,18 +59,18 @@ variable "externals" {
# version = "1.19.7",
# namespace = "homelab"
# }
{
name = "pihole",
repo = "https://mojo2600.github.io/pihole-kubernetes/",
version = "2.11.0",
namespace = "homelab"
},
{
name = "keycloak",
repo = "https://codecentric.github.io/helm-charts",
version = "20.0.3",
namespace = "homelab"
},
# {
# name = "pihole",
# repo = "https://mojo2600.github.io/pihole-kubernetes/",
# version = "2.11.0",
# namespace = "homelab"
# },
# {
# name = "keycloak",
# repo = "https://codecentric.github.io/helm-charts",
# version = "20.0.3",
# namespace = "homelab"
# },
{
name = "prometheus",
repo = "https://prometheus-community.github.io/helm-charts",
Expand Down
52 changes: 38 additions & 14 deletions molecules/cluster-resources/local.inputs.tfvars
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cluster = {
name = "default"
config_path = "../../config/127.0.0.1.kubeconfig"
name = "colima-justdocker"
config_path = "~/.kube/config"
host = "https://127.0.0.1:6443"
hosts = [
"127.0.0.1.nip.io"
Expand Down Expand Up @@ -50,18 +50,18 @@ externals = [
# version = "20.0.3",
# namespace = "homelab"
# },
{
name = "prometheus",
repo = "https://prometheus-community.github.io/helm-charts",
version = "19.3.1",
namespace = "homelab"
},
{
name = "grafana-agent-operator",
repo = "https://grafana.github.io/helm-charts",
version = "9.3.1",
namespace = "homelab"
},
#{
# name = "prometheus",
# repo = "https://prometheus-community.github.io/helm-charts",
# version = "19.3.1",
# namespace = "homelab"
#},
#{
# name = "grafana-agent-operator",
# repo = "https://grafana.github.io/helm-charts",
# version = "9.3.1",
# namespace = "homelab"
#},
{
name = "grafana",
repo = "https://grafana.github.io/helm-charts",
Expand All @@ -81,4 +81,28 @@ externals = [
version = "v0.72.0",
namespace = "homelab"
},
#{
# name = "otel-collector-template-monorepo-dev",
# chart_name = "opentelemetry-collector",
# repo = "https://open-telemetry.github.io/opentelemetry-helm-charts"
# version = "v0.72.0",
# namespace = "template-monorepo-dev"
#},
#{
# name = "opentelemetry-collector",
# repo = "https://open-telemetry.github.io/opentelemetry-helm-charts"
# version = "v0.72.0",
# namespace = "homelab"
# },
#{
# name = "kafka",
# repo = "https://charts.bitnami.com/bitnami",
# version = "21.3.0"
#},
{
name = "zeebe-full-helm",
repo = "https://helm.camunda.io"
version = "1.3.5",
namespace = "homelab"
},
]
2 changes: 1 addition & 1 deletion molecules/cluster-resources/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ terraform {
}
}

backend "http" { }
# backend "http" { }
}

provider "helm" {
Expand Down

0 comments on commit 7f05c1c

Please sign in to comment.