Skip to content

Commit

Permalink
Add the ability to use a caFile in tls sections (#1013)
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall authored Dec 19, 2024
1 parent 979dbde commit 39996f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ loki.write {{ include "helper.alloy_name" .name | quote }} {
{{- if .tls }}
tls_config {
insecure_skip_verify = {{ .tls.insecureSkipVerify | default false }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
{{- if .tls.caFile }}
ca_file = {{ .tls.caFile | quote }}
{{- else if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
ca_pem = {{ include "secrets.read" (dict "object" . "key" "tls.ca" "nonsensitive" true) }}
{{- end }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.cert")) "true" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ otelcol.exporter.otlphttp {{ include "helper.alloy_name" .name | quote }} {
tls {
insecure = {{ .tls.insecure | default false }}
insecure_skip_verify = {{ .tls.insecureSkipVerify | default false }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
{{- if .tls.caFile }}
ca_file = {{ .tls.caFile | quote }}
{{- else if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
ca_pem = {{ include "secrets.read" (dict "object" . "key" "tls.ca" "nonsensitive" true) }}
{{- end }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.cert")) "true" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ prometheus.remote_write {{ include "helper.alloy_name" .name | quote }} {
{{- if .tls }}
tls_config {
insecure_skip_verify = {{ .tls.insecureSkipVerify | default false }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
{{- if .tls.caFile }}
ca_file = {{ .tls.caFile | quote }}
{{- else if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
ca_pem = {{ include "secrets.read" (dict "object" . "key" "tls.ca" "nonsensitive" true) }}
{{- end }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.cert")) "true" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ pyroscope.write {{ include "helper.alloy_name" .name | quote }} {
{{- if .tls }}
tls_config {
insecure_skip_verify = {{ .tls.insecureSkipVerify | default false }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
{{- if .tls.caFile }}
ca_file = {{ .tls.caFile | quote }}
{{- else if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.ca")) "true" }}
ca_pem = {{ include "secrets.read" (dict "object" . "key" "tls.ca" "nonsensitive" true) }}
{{- end }}
{{- if eq (include "secrets.usesSecret" (dict "object" . "key" "tls.cert")) "true" }}
Expand Down

0 comments on commit 39996f5

Please sign in to comment.