Skip to content

Commit

Permalink
Merge pull request #1 from Imshelledin21/helm-charting
Browse files Browse the repository at this point in the history
Helm charting
  • Loading branch information
Imshelledin21 authored Apr 11, 2024
2 parents 7ef90f5 + 9a2f3c3 commit 68aab3a
Show file tree
Hide file tree
Showing 53 changed files with 380 additions and 240 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/helm-chart-values-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: HelmChartValuesBuilder

on:
pull_request:
branches: ["main"]
push:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo contents
uses: actions/checkout@v2

- name: execute shell script
run: ./tools/create-helm-config-files.sh

- name: commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add -A
git diff-index --quiet HEAD || (git commit -a -m "Updating Value Files for Helm Charts" --allow-empty)
- name: push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
23 changes: 23 additions & 0 deletions helm/alloy-modules/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions helm/alloy-modules/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: alloy-modules
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
11 changes: 11 additions & 0 deletions helm/alloy-modules/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# chart/templates/configmaps.yaml
{{- range $path, $_ := .Files.Glob "configmaps/*" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $path | trimPrefix "configmaps/" | trimSuffix ".alloy" }}
data:
{{ $path | trimPrefix "configmaps/" }}: |-
{{ $.Files.Get $path| indent 4 }}
---
{{ end }}
Empty file.
15 changes: 8 additions & 7 deletions modules/broker/rabbitmq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Handles discovery of kubernetes targets and exports them, this component does no

#### Arguments

| Name | Required | Default | Description |
| :----------- | :------- | :-------------------------------------------------------- | :-------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `selectors` | _no_ | `["app.kubernetes.io/name=prometheus-rabbitmq-exporter"]` | The label selectors to use to find matching targets |
| `port_name` | _no_ | `metrics` | The of the port to scrape metrics from |
| Name | Required | Default | Description |
| :---------------- | :------- | :-------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `field_selectors` | _no_ | `[]` | The [field selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/) to use to find matching targets |
| `label_selectors` | _no_ | `["app.kubernetes.io/name=prometheus-rabbitmq-exporter"]` | The [label selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to use to find matching targets |
| `port_name` | _no_ | `metrics` | The of the port to scrape metrics from |

#### Exports

Expand Down Expand Up @@ -103,7 +104,7 @@ The following example will scrape all rabbitmq instances in cluster.
import.git "rabbitmq" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "modules/brokers/rabbitmq/metric.river"
path = "modules/brokers/rabbitmq/metrics.alloy"
pull_frequency = "15m"
}
Expand Down Expand Up @@ -139,7 +140,7 @@ The following example will scrape rabbitmq for metrics on the local machine.
import.git "rabbitmq" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "modules/brokers/rabbitmq/metric.river"
path = "modules/brokers/rabbitmq/metrics.alloy"
pull_frequency = "15m"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare "kubernetes" {

selectors {
role = "pod"
field = join(coalesce(argument.fieldselectors.value, []), ",")
field = join(coalesce(argument.field_selectors.value, []), ",")
label = join(coalesce(argument.label_selectors.value, ["app.kubernetes.io/name=prometheus-rabbitmq-exporter"]), ",")
}

Expand Down
File renamed without changes.
15 changes: 8 additions & 7 deletions modules/collector/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Handles discovery of kubernetes targets and exports them, this component does no

#### Arguments

| Name | Required | Default | Description |
| :----------- | :------- | :----------------------------------------- | :-------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `selectors` | _no_ | `["app.kubernetes.io/name=grafana-agent"]` | The label selectors to use to find matching targets |
| `port_name` | _no_ | `http-metrics` | The of the port to scrape metrics from |
| Name | Required | Default | Description |
| :---------------- | :------- | :----------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `field_selectors` | _no_ | `[]` | The [field selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/) to use to find matching targets |
| `label_selectors` | _no_ | `["app.kubernetes.io/name=grafana-agent"]` | The [label selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to use to find matching targets |
| `port_name` | _no_ | `http-metrics` | The of the port to scrape metrics from |

#### Exports

Expand Down Expand Up @@ -102,7 +103,7 @@ The following example will scrape all agents in cluster.
import.git "agent" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "module/collectors/agent/metric.river"
path = "module/collectors/agent/metrics.alloy"
pull_frequency = "15m"
}
Expand Down Expand Up @@ -138,7 +139,7 @@ The following example will scrape the agent for metrics on the local machine.
import.git "agent" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "module/collectors/agent/metric.river"
path = "module/collectors/agent/metrics.alloy"
pull_frequency = "15m"
}
Expand Down
File renamed without changes.
13 changes: 7 additions & 6 deletions modules/collector/push-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ Handles discovery of kubernetes targets and exports them, this component does no

#### Arguments

| Name | Required | Default | Description |
| :----------- | :------- | :-------------------------------------------------- | :-------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `selectors` | _no_ | `["app.kubernetes.io/name=prometheus-pushgateway"]` | The label selectors to use to find matching targets |
| `port_name` | _no_ | `http-metrics` | The of the port to scrape metrics from |
| Name | Required | Default | Description |
| :---------------- | :------- | :-------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `field_selectors` | _no_ | `[]` | The [field selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/) to use to find matching targets |
| `label_selectors` | _no_ | `["app.kubernetes.io/name=prometheus-pushgateway"]` | The [label selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to use to find matching targets |
| `port_name` | _no_ | `http-metrics` | The of the port to scrape metrics from |

#### Exports

Expand Down Expand Up @@ -70,7 +71,7 @@ The following example will scrape all push-gateway in cluster.
import.git "push_gateway" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "modules/collectors/push-gateway/metrics.river"
path = "modules/collectors/push-gateway/metrics.alloy"
pull_frequency = "15m"
}
Expand Down
15 changes: 8 additions & 7 deletions modules/databases/kv/etcd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Handles discovery of kubernetes targets and exports them, this component does no

#### Arguments

| Name | Required | Default | Description |
| :----------- | :------- | :------------------------------------- | :-------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `selectors` | _no_ | `["app.kubernetes.io/component=etcd"]` | The label selectors to use to find matching targets |
| `port_name` | _no_ | `metrics` | The of the port to scrape metrics from |
| Name | Required | Default | Description |
| :---------------- | :------- | :------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `field_selectors` | _no_ | `[]` | The [field selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/) to use to find matching targets |
| `label_selectors` | _no_ | `["app.kubernetes.io/component=etcd"]` | The [label selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to use to find matching targets |
| `port_name` | _no_ | `metrics` | The of the port to scrape metrics from |

#### Exports

Expand Down Expand Up @@ -101,7 +102,7 @@ The following example will scrape all etcd instances in cluster.
import.git "etcd" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "modules/databases/kv/etcd/metrics.river"
path = "modules/databases/kv/etcd/metrics.alloy"
pull_frequency = "15m"
}
Expand Down Expand Up @@ -137,7 +138,7 @@ The following example will scrape etcd for metrics on the local machine.
import.git "etcd" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "modules/databases/kv/etcd/metrics.river"
path = "modules/databases/kv/etcd/metrics.alloy"
pull_frequency = "15m"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare "kubernetes" {

selectors {
role = "pod"
field = join(coalesce(argument.fieldselectors.value, []), ",")
field = join(coalesce(argument.field_selectors.value, []), ",")
label = join(coalesce(argument.label_selectors.value, ["app.kubernetes.io/component=etcd"]), ",")
}

Expand Down
15 changes: 8 additions & 7 deletions modules/databases/kv/memcached/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Handles discovery of kubernetes targets and exports them, this component does no

#### Arguments

| Name | Required | Default | Description |
| :----------- | :------- | :------------------------------------- | :-------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `selectors` | _no_ | `["app.kubernetes.io/name=memcached"]` | The label selectors to use to find matching targets |
| `port_name` | _no_ | `metrics` | The of the port to scrape metrics from |
| Name | Required | Default | Description |
| :---------------- | :------- | :------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |
| `namespaces` | _no_ | `[]` | The namespaces to look for targets in, the default (`[]`) is all namespaces |
| `field_selectors` | _no_ | `[]` | The [field selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/) to use to find matching targets |
| `label_selectors` | _no_ | `["app.kubernetes.io/name=memcached"]` | The [label selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to use to find matching targets |
| `port_name` | _no_ | `metrics` | The of the port to scrape metrics from |

#### Exports

Expand Down Expand Up @@ -102,7 +103,7 @@ The following example will scrape all memcached instances in cluster.
import.git "memcached" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "modules/databases/kv/memcached/metrics.river"
path = "modules/databases/kv/memcached/metrics.alloy"
pull_frequency = "15m"
}
Expand Down Expand Up @@ -138,7 +139,7 @@ The following example will scrape memcached for metrics on the local machine.
import.git "memcached" {
repository = "https://github.com/grafana/flow-modules.git"
revision = "main"
path = "modules/databases/kv/memcached/metrics.river"
path = "modules/databases/kv/memcached/metrics.alloy"
pull_frequency = "15m"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare "kubernetes" {

selectors {
role = "pod"
field = join(coalesce(argument.fieldselectors.value, []), ",")
field = join(coalesce(argument.field_selectors.value, []), ",")
label = join(coalesce(argument.label_selectors.value, ["app.kubernetes.io/name=memcached"]), ",")
}

Expand Down
Loading

0 comments on commit 68aab3a

Please sign in to comment.