Skip to content

Commit

Permalink
Merge pull request #3140 from mathieuherbert/main
Browse files Browse the repository at this point in the history
[synthetic-monitoring-agent] feat: add support for existing secret
  • Loading branch information
zanhsieh authored Jul 17, 2024
2 parents 81f741b + 040e080 commit 3458cd8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/synthetic-monitoring-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ name: synthetic-monitoring-agent
sources:
- https://github.com/grafana/synthetic-monitoring-agent
type: application
version: 0.2.0
version: 0.3.0
5 changes: 3 additions & 2 deletions charts/synthetic-monitoring-agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# synthetic-monitoring-agent

![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.9.3-0-gcd7aadd](https://img.shields.io/badge/AppVersion-v0.9.3--0--gcd7aadd-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.9.3-0-gcd7aadd](https://img.shields.io/badge/AppVersion-v0.9.3--0--gcd7aadd-informational?style=flat-square)

Grafana's Synthetic Monitoring application. The agent provides probe functionality and executes network checks for monitoring remote targets.

Expand Down Expand Up @@ -28,7 +28,7 @@ Kubernetes: `^1.16.0-0`
|-----|------|---------|-------------|
| affinity | object | `{}` | Node affinity for pod assignment. |
| agent.apiServerAddress | string | `"synthetic-monitoring-grpc.grafana.net:443"` | Default server endpoint for receiving synthetic monitoring checks on Grafana's side. See https://grafana.com/docs/grafana-cloud/synthetic-monitoring/private-probes/#probe-api-server-url for more information. |
| agent.apiToken | string | `""` | **REQUIRED** API token from Grafana Cloud. |
| agent.apiToken | string | `""` | API token from Grafana Cloud when secret is created by the chart. |
| agent.debug | bool | `false` | Enable / disable debug logging on the agent. |
| agent.enableDisconnect | bool | `false` | Enable / disable the HTTP /disconnect endpoint |
| agent.verbose | bool | `false` | Enable / disable verbose logging on the agent. |
Expand All @@ -54,6 +54,7 @@ Kubernetes: `^1.16.0-0`
| readinessProbe | object | `{"httpGet":{"path":"/ready","port":"http"}}` | Readiness probe for the agent |
| replicaCount | int | `1` | Number of replicas to use; ignored if `autoscaling.enabled` is set to `true`. |
| resources | object | `{}` | Default resources to apply. |
| secret.existingSecret | string | `""` | Reference an existing secret for API token |
| securityContext | object | `{"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":65534}` | Security context for the container level. |
| service.annotations | object | `{}` | Annotations for the service |
| service.port | int | `4050` | Service port. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
valueFrom:
secretKeyRef:
key: api-token
name: {{ include "synthetic-monitoring-agent.fullname" . }}
name: {{ (tpl .Values.secret.existingSecret .) | default (include "synthetic-monitoring-agent.fullname" .) }}
name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
Expand Down
4 changes: 3 additions & 1 deletion charts/synthetic-monitoring-agent/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.secret.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -6,4 +7,5 @@ metadata:
{{- include "synthetic-monitoring-agent.labels" . | nindent 4 }}
type: Opaque
data:
api-token: {{ required "A valid .Values.agent.apiToken is required!" .Values.agent.apiToken | b64enc }}
api-token: {{ .Values.agent.apiToken | b64enc }}
{{- end }}
6 changes: 5 additions & 1 deletion charts/synthetic-monitoring-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Declare variables to be passed into your templates.

agent:
# -- **REQUIRED** API token from Grafana Cloud.
# -- API token from Grafana Cloud when secret is created by the chart.
apiToken: ""
# -- Default server endpoint for receiving synthetic monitoring checks on Grafana's side.
# See https://grafana.com/docs/grafana-cloud/synthetic-monitoring/private-probes/#probe-api-server-url for more information.
Expand Down Expand Up @@ -148,3 +148,7 @@ affinity: {}

# -- Add dynamic manifests via values:
extraObjects: []

secret:
# -- Reference an existing secret for API token
existingSecret: ""

0 comments on commit 3458cd8

Please sign in to comment.