Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extraObjects #780

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions charts/k8s-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ podLogs:

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alloy-logs.controller.type | string | `"daemonset"` | The type of controller to use for the Alloy Logs instance. |
| alloy-logs.enabled | bool | `false` | Deploy the Alloy instance for collecting log data. |
| alloy-logs.extraConfig | string | `""` | Extra Alloy configuration to be added to the configuration file. |
| alloy-logs.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". |
Expand All @@ -155,6 +156,8 @@ podLogs:

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alloy-metrics.controller.replicas | int | `1` | The number of replicas for the Alloy Metrics instance. |
| alloy-metrics.controller.type | string | `"statefulset"` | The type of controller to use for the Alloy Metrics instance. |
| alloy-metrics.enabled | bool | `false` | Deploy the Alloy instance for collecting metrics. |
| alloy-metrics.extraConfig | string | `""` | Extra Alloy configuration to be added to the configuration file. |
| alloy-metrics.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". |
Expand All @@ -165,6 +168,7 @@ podLogs:

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alloy-profiles.controller.type | string | `"daemonset"` | The type of controller to use for the Alloy Profiles instance. |
| alloy-profiles.enabled | bool | `false` | Deploy the Alloy instance for gathering profiles. |
| alloy-profiles.extraConfig | string | `""` | Extra Alloy configuration to be added to the configuration file. |
| alloy-profiles.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". |
Expand All @@ -176,6 +180,7 @@ podLogs:
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alloy-receiver.alloy.extraPorts | list | `[]` | The ports to expose for the Alloy receiver. |
| alloy-receiver.controller.type | string | `"daemonset"` | The type of controller to use for the Alloy Receiver instance. |
| alloy-receiver.enabled | bool | `false` | Deploy the Alloy instance for opening receivers to collect application data. |
| alloy-receiver.extraConfig | string | `""` | Extra Alloy configuration to be added to the configuration file. |
| alloy-receiver.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". |
Expand All @@ -186,6 +191,8 @@ podLogs:

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alloy-singleton.controller.replicas | int | `1` | The number of replicas for the Alloy Singleton instance. This should remain a single instance to avoid duplicate data. |
| alloy-singleton.controller.type | string | `"deployment"` | The type of controller to use for the Alloy Singleton instance. |
| alloy-singleton.enabled | bool | `false` | Deploy the Alloy instance for data sources required to be deployed on a single replica. |
| alloy-singleton.extraConfig | string | `""` | Extra Alloy configuration to be added to the configuration file. |
| alloy-singleton.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". |
Expand Down Expand Up @@ -288,8 +295,4 @@ podLogs:

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alloy-logs | object | `{"controller":{"nodeSelector":{"kubernetes.io/os":"linux"},"type":"daemonset"},"enabled":false,"extraConfig":"","liveDebugging":{"enabled":false},"logging":{"format":"logfmt","level":"info"}}` | An Alloy instance for collecting log data. |
| alloy-metrics | object | `{"crds":{"create":false},"enabled":false,"extraConfig":"","liveDebugging":{"enabled":false},"logging":{"format":"logfmt","level":"info"}}` | An Alloy instance for collecting metrics. |
| alloy-profiles | object | `{"enabled":false,"extraConfig":"","liveDebugging":{"enabled":false},"logging":{"format":"logfmt","level":"info"}}` | An Alloy instance for gathering profiles. |
| alloy-receiver | object | `{"alloy":{"extraPorts":[]},"controller":{"nodeSelector":{"kubernetes.io/os":"linux"},"type":"daemonset"},"enabled":false,"extraConfig":"","liveDebugging":{"enabled":false},"logging":{"format":"logfmt","level":"info"}}` | An Alloy instance for opening receivers to collect application data. |
| alloy-singleton | object | `{"controller":{"nodeSelector":{"kubernetes.io/os":"linux"},"podAnnotations":{"k8s.grafana.com/logs.job":"integrations/alloy"},"replicas":1,"type":"deployment"},"enabled":false,"extraConfig":"","liveDebugging":{"enabled":false},"logging":{"format":"logfmt","level":"info"}}` | An Alloy instance for data sources required to be deployed on a single replica. |
| extraObjects | list | `[]` | Deploy additional manifest objects |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions charts/k8s-monitoring/templates/extra-objects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ range .Values.extraObjects }}
---
{{ tpl (toYaml .) $ }}
{{ end }}
21 changes: 21 additions & 0 deletions charts/k8s-monitoring/tests/extra_objects_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# yamllint disable rule:document-start rule:line-length rule:trailing-spaces
suite: Extra Objects test
templates:
- extra-objects.yaml
tests:
- it: creates extra objects
set:
extraObjects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
namespace: my-namespace
data:
key: value
asserts:
- containsDocument:
apiVersion: v1
kind: ConfigMap
name: my-config
namespace: my-namespace
3 changes: 3 additions & 0 deletions charts/k8s-monitoring/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@
"destinations": {
"$ref": "#/definitions/destination-list"
},
"extraObjects": {
"type": "array"
},
"frontendObservability": {
"type": "object",
"properties": {
Expand Down
67 changes: 59 additions & 8 deletions charts/k8s-monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ integrations:
# Collectors (Alloy instances)
#

# -- An Alloy instance for collecting metrics.
# An Alloy instance for collecting metrics.
alloy-metrics:
# -- Deploy the Alloy instance for collecting metrics.
# @section -- Collectors - Alloy Metrics
Expand Down Expand Up @@ -249,20 +249,28 @@ alloy-metrics:
seccompProfile:
type: "RuntimeDefault"

# @ignored
controller:
# -- The type of controller to use for the Alloy Metrics instance.
# @section -- Collectors - Alloy Metrics
type: statefulset

# -- The number of replicas for the Alloy Metrics instance.
# @section -- Collectors - Alloy Metrics
replicas: 1

# @ignored
nodeSelector:
kubernetes.io/os: linux

# @ignored
podAnnotations:
k8s.grafana.com/logs.job: integrations/alloy

# Skip installation of the Grafana Alloy CRDs, since we don't use them in this chart
# @ignored
crds: {create: false}

# -- An Alloy instance for data sources required to be deployed on a single replica.
# An Alloy instance for data sources required to be deployed on a single replica.
alloy-singleton:
# -- Deploy the Alloy instance for data sources required to be deployed on a single replica.
# @section -- Collectors - Alloy Singleton
Expand Down Expand Up @@ -300,19 +308,27 @@ alloy-singleton:
type: "RuntimeDefault"

controller:
# -- The type of controller to use for the Alloy Singleton instance.
# @section -- Collectors - Alloy Singleton
type: deployment
replicas: 1 # Only one replica should be used, otherwise multiple copies of cluster events might get sent to Loki.
# -- The number of replicas for the Alloy Singleton instance.
# This should remain a single instance to avoid duplicate data.
# @section -- Collectors - Alloy Singleton
replicas: 1

# @ignored
nodeSelector:
kubernetes.io/os: linux

# @ignored
podAnnotations:
k8s.grafana.com/logs.job: integrations/alloy

# Skip installation of the Grafana Alloy CRDs, since we don't use them in this chart
# @ignored
crds: {create: false}

# -- An Alloy instance for collecting log data.
# An Alloy instance for collecting log data.
alloy-logs:
# -- Deploy the Alloy instance for collecting log data.
# @section -- Collectors - Alloy Logs
Expand Down Expand Up @@ -362,11 +378,15 @@ alloy-logs:
type: "RuntimeDefault"

controller:
# -- The type of controller to use for the Alloy Logs instance.
# @section -- Collectors - Alloy Logs
type: daemonset

# @ignored
nodeSelector:
kubernetes.io/os: linux

# -- An Alloy instance for opening receivers to collect application data.
# An Alloy instance for opening receivers to collect application data.
alloy-receiver:
# -- Deploy the Alloy instance for opening receivers to collect application data.
# @section -- Collectors - Alloy Receiver
Expand Down Expand Up @@ -409,11 +429,15 @@ alloy-receiver:
type: "RuntimeDefault"

controller:
# -- The type of controller to use for the Alloy Receiver instance.
# @section -- Collectors - Alloy Receiver
type: daemonset

# @ignored
nodeSelector:
kubernetes.io/os: linux

# -- An Alloy instance for gathering profiles.
# An Alloy instance for gathering profiles.
alloy-profiles:
# -- Deploy the Alloy instance for gathering profiles.
# @section -- Collectors - Alloy Profiles
Expand Down Expand Up @@ -455,17 +479,44 @@ alloy-profiles:
runAsGroup: 0
runAsUser: 0

# @ignored
controller:
# -- The type of controller to use for the Alloy Profiles instance.
# @section -- Collectors - Alloy Profiles
type: daemonset

# @ignored
hostPID: true

# @ignored
nodeSelector:
kubernetes.io/os: linux

# @ignored
tolerations:
- effect: NoSchedule
operator: Exists

# Skip installation of the Grafana Alloy CRDs, since we don't use them in this chart
# @ignored
crds: {create: false}

# -- Deploy additional manifest objects
extraObjects: []
# - apiVersion: external-secrets.io/v1beta1
# kind: ExternalSecret
# metadata:
# name: prometheus-secret
# spec:
# refreshInterval: 1h
# secretStoreRef:
# kind: SecretStore
# name: example
# target:
# template:
# data:
# prometheus_host: "{{ .Values.externalServices.prometheus.host }}"
# username: "{{`{{ .username }}`}}"
# password: "{{`{{ .password }}`}}"
# dataFrom:
# - extract:
# key: mysecret
Loading