Skip to content

Commit

Permalink
Allow to skip certificate verification when tls is enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Amador <amador.marco@gmail.com>
  • Loading branch information
mfamador committed Jul 24, 2021
1 parent e135244 commit 47859bd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/kafka-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: kafka-exporter
version: 1.1.0
version: 1.1.1
home: https://github.com/abhishekjiitr/kafka-exporter-helm
maintainers:
- name: abhishekjiitr
Expand Down
8 changes: 6 additions & 2 deletions charts/kafka-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ spec:
{{- end }}
{{- if .Values.kafkaExporter.tls.enabled}}
- --tls.enabled
{{- if .Values.kafkaExporter.tls.insecureSkipTlsVerify}}
- --tls.insecure-skip-tls-verify
{{- else }}
- --tls.ca-file=/etc/tls-certs/ca-file
- --tls.cert-file=/etc/tls-certs/cert-file
- --tls.key-file=/etc/tls-certs/key-file
{{- end }}
{{- end }}
{{- if .Values.kafkaExporter.log }}
- --log.level={{ .Values.kafkaExporter.log.level }}
{{- if .Values.kafkaExporter.log.enableSarama }}
Expand Down Expand Up @@ -84,7 +88,7 @@ spec:
successThreshold: 1
timeoutSeconds: 9

{{- if .Values.kafkaExporter.tls.enabled }}
{{- if and .Values.kafkaExporter.tls.enabled (not .Values.kafkaExporter.tls.insecureSkipTlsVerify) }}
volumeMounts:
- name: tls-certs
mountPath: "/etc/tls-certs/"
Expand All @@ -105,7 +109,7 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.kafkaExporter.tls.enabled }}
{{- if and .Values.kafkaExporter.tls.enabled (not .Values.kafkaExporter.tls.insecureSkipTlsVerify) }}
volumes:
- name: tls-certs
secret:
Expand Down
2 changes: 1 addition & 1 deletion charts/kafka-exporter/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.kafkaExporter.tls.enabled }}
{{- if and .Values.kafkaExporter.tls.enabled (not .Values.kafkaExporter.tls.insecureSkipTlsVerify) }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
6 changes: 5 additions & 1 deletion charts/kafka-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ spec:
{{- if .Values.prometheus.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.prometheus.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml .Values.prometheus.serviceMonitor.metricRelabelings | nindent 4 }}
{{- end }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/kafka-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ kafkaExporter:

tls:
enabled: false
insecure-skip-tls-verify: false
insecureSkipTlsVerify: false
caFile: ""
certFile: ""
keyFile: ""
Expand All @@ -47,6 +47,7 @@ prometheus:
interval: "30s"
additionalLabels:
app: kafka-exporter
metricRelabelings: {}

labels: {}
podLabels: {}
Expand Down

0 comments on commit 47859bd

Please sign in to comment.