Skip to content

Commit

Permalink
This PR fixes issues with helm chart where streams as configured
Browse files Browse the repository at this point in the history
in the values file were not getting created if HA is enabled.
Fixes #899

Another fix included in this PR is to allow different configurations
for service monitor object by passing through the endpoints spec fields
directly from values.yaml.
Fixes #905

Final fix is to ensure podAnnotations applied in HA mode are propagated to
the query node.
Fixes #901

Also update the image tag to latest release v1.5.0
  • Loading branch information
nitisht committed Sep 6, 2024
1 parent 008bd7f commit 9b05068
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 80 deletions.
Binary file modified helm-releases/parseable-1.5.0.tgz
Binary file not shown.
8 changes: 8 additions & 0 deletions helm/templates/_helpers_config_logstream.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ createStream() {
echo;
echo \"Creating the log stream $STREAM\";

{{ if .Values.parseable.highAvailability.enabled }}
response=$(curl -sS --header 'Content-Type: application/json' -u "$P_USERNAME":"$P_PASSWORD" -w 'HTTPSTATUS:%{http_code}' --location --request PUT "http://{{ include "parseable.fullname" . }}-querier-service.{{ .Release.Namespace }}:{{ $.Values.parseable.service.port }}/api/v1/logstream/$STREAM");
{{ else }}
response=$(curl -sS --header 'Content-Type: application/json' -u "$P_USERNAME":"$P_PASSWORD" -w 'HTTPSTATUS:%{http_code}' --location --request PUT "http://{{ include "parseable.fullname" . }}.{{ .Release.Namespace }}:{{ $.Values.parseable.service.port }}/api/v1/logstream/$STREAM");
{{ end }}

HTTP_BODY=$(echo $response | sed -e 's/HTTPSTATUS\:.*//g')
HTTP_STATUS=$(echo $response | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
Expand All @@ -25,7 +29,11 @@ setRetention() {
echo;
echo \"Setting the retention for $STREAM\";

{{ if .Values.parseable.highAvailability.enabled }}
response=$(curl -sS --header 'Content-Type: application/json' -u "$P_USERNAME":"$P_PASSWORD" -w 'HTTPSTATUS:%{http_code}' --location --request PUT "http://{{ include "parseable.fullname" . }}-querier-service.{{ .Release.Namespace }}:{{ $.Values.parseable.service.port }}/api/v1/logstream/$STREAM/retention" --data "[{\"description\":\"$ACTION logs after $DURATION\",\"action\":\"$ACTION\",\"duration\":\"$DURATION\"}]");
{{ else }}
response=$(curl -sS --header 'Content-Type: application/json' -u "$P_USERNAME":"$P_PASSWORD" -w 'HTTPSTATUS:%{http_code}' --location --request PUT "http://{{ include "parseable.fullname" . }}.{{ .Release.Namespace }}:{{ $.Values.parseable.service.port }}/api/v1/logstream/$STREAM/retention" --data "[{\"description\":\"$ACTION logs after $DURATION\",\"action\":\"$ACTION\",\"duration\":\"$DURATION\"}]");
{{ end }}

HTTP_BODY=$(echo $response | sed -e 's/HTTPSTATUS\:.*//g')
HTTP_STATUS=$(echo $response | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/ingestor-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: Service
metadata:
name: {{ include "parseable.fullname" . }}-ingestor-service
namespace: {{ .Release.Namespace }}
labels:
{{- include "parseable.labelsSelector" . | nindent 4 }}
spec:
type: {{ $.Values.parseable.highAvailability.ingestor.service.type }}
ports:
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/ingestor-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ metadata:
name: {{ include "parseable.fullname" . }}-ingestor
namespace: {{ .Release.Namespace }}
labels:
{{- .Values.parseable.highAvailability.ingestor.labels | toYaml | nindent 4 }}
{{- include "parseable.ingestorLabels" . | nindent 4 }}
spec:
selector:
Expand All @@ -30,6 +29,7 @@ spec:
template:
metadata:
labels:
{{- .Values.parseable.highAvailability.ingestor.labels | toYaml | nindent 8 }}
{{- include "parseable.ingestorLabelsSelector" . | nindent 8 }}
spec:
terminationGracePeriodSeconds: 10
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/querier-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: Service
metadata:
name: {{ include "parseable.fullname" . }}-querier-service
namespace: {{ .Release.Namespace }}
labels:
{{- include "parseable.labelsSelector" . | nindent 4 }}
spec:
type: {{ $.Values.parseable.service.type }}
ports:
Expand Down
9 changes: 7 additions & 2 deletions helm/templates/querier-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Values.parseable.highAvailability.enabled true }}
{{- if .Values.parseable.highAvailability.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -18,7 +18,6 @@ metadata:
name: {{ include "parseable.fullname" . }}-querier
namespace: {{ .Release.Namespace }}
labels:
{{- .Values.parseable.podLabels | toYaml | nindent 4 }}
{{- include "parseable.querierLabels" . | nindent 4 }}
spec:
selector:
Expand All @@ -30,7 +29,10 @@ spec:
minReadySeconds: 2
template:
metadata:
annotations:
{{- .Values.parseable.podAnnotations | toYaml | nindent 8 }}
labels:
{{- .Values.parseable.podLabels | toYaml | nindent 8 }}
{{- include "parseable.querierLabelsSelector" . | nindent 8 }}
spec:
terminationGracePeriodSeconds: 10
Expand Down Expand Up @@ -76,6 +78,9 @@ spec:
- mountPath: "/parseable/hot-tier"
name: hot-tier-volume
{{- end }}
volumes:
- emptyDir: {}
name: stage-volume
{{- if .Values.parseable.sidecar.enabled}}
- name: {{ .Chart.Name }}-sidecar
securityContext:
Expand Down
81 changes: 55 additions & 26 deletions helm/templates/service-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,63 @@ kind: ServiceMonitor
metadata:
name: {{ include "parseable.fullname" . }}
namespace: {{ default .Release.Namespace .Values.parseable.metrics.serviceMonitor.namespace | quote }}
labels: {{- include "parseable.labelsSelector" . | nindent 4 }}
{{- if .Values.parseable.metrics.serviceMonitor.additionalLabels }}
{{- include (dict "value" .Values.parseable.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }}
{{- end }}
labels:
{{- include "parseable.labels" . | nindent 4 }}
spec:
{{ if .Values.parseable.metrics.serviceMonitor.spec.jobLabel }}
jobLabel: {{ .Values.parseable.metrics.serviceMonitor.spec.jobLabel | quote }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.targetLabels }}
targetLabels:
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.targetLabels | nindent 4 }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.podTargetLabels }}
podTargetLabels:
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.podTargetLabels | nindent 4 }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.endpoints }}
endpoints:
- port: parseable-metrics
{{- if .Values.parseable.metrics.serviceMonitor.interval }}
interval: {{ .Values.parseable.metrics.serviceMonitor.interval }}
{{- end }}
{{- if .Values.parseable.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.parseable.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.parseable.metrics.serviceMonitor.honorLabels }}
honorLabels: {{ .Values.parseable.metrics.serviceMonitor.honorLabels }}
{{- end }}
{{- if .Values.parseable.metrics.serviceMonitor.relabellings }}
relabelings: {{- toYaml .Values.parseable.metrics.serviceMonitor.relabellings | nindent 6 }}
{{- end }}
{{- if .Values.parseable.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- toYaml .Values.parseable.metrics.serviceMonitor.metricRelabelings | nindent 6 }}
{{- end }}
{{- if .Values.parseable.metrics.serviceMonitor.podTargetLabels }}
podTargetLabels: {{- toYaml .Values.parseable.metrics.serviceMonitor.podTargetLabels | nindent 4 }}
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.endpoints | nindent 4 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.selector }}
selector:
matchLabels: {{- include "parseable.labelsSelector" . | nindent 6 }}
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.selector | nindent 4 }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.namespaceSelector | nindent 4 }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.sampleLimit }}
sampleLimit: {{ .Values.parseable.metrics.serviceMonitor.spec.sampleLimit }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.scrapeProtocols }}
scrapeProtocols:
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.scrapeProtocols | nindent 4 }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.targetLimit }}
targetLimit: {{ .Values.parseable.metrics.serviceMonitor.spec.targetLimit }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.labelLimit }}
labelLimit: {{ .Values.parseable.metrics.serviceMonitor.spec.labelLimit }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.labelNameLengthLimit }}
labelNameLengthLimit: {{ .Values.parseable.metrics.serviceMonitor.spec.labelNameLengthLimit }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.labelValueLengthLimit }}
labelValueLengthLimit: {{ .Values.parseable.metrics.serviceMonitor.spec.labelValueLengthLimit }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.keepDroppedTargets }}
keepDroppedTargets: {{ .Values.parseable.metrics.serviceMonitor.spec.keepDroppedTargets }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.attachMetadata }}
attachMetadata:
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.attachMetadata | nindent 4 }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.scrapeClass }}
scrapeClass: {{ .Values.parseable.metrics.serviceMonitor.spec.scrapeClass | quote }}
{{- end }}
{{ if .Values.parseable.metrics.serviceMonitor.spec.bodySizeLimit }}
bodySizeLimit:
{{- toYaml .Values.parseable.metrics.serviceMonitor.spec.bodySizeLimit | nindent 4 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions helm/templates/standalone-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: Service
metadata:
name: {{ include "parseable.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "parseable.labelsSelector" . | nindent 4 }}
spec:
type: {{ $.Values.parseable.service.type }}
ports:
Expand Down
30 changes: 20 additions & 10 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
parseable:
image:
repository: containers.parseable.com/parseable/parseable
tag: v1.4.0
tag: v1.5.0
pullPolicy: Always
## Set to true if you want to deploy Parseable in local mode (store logs
## on local mount point instead of S3 bucket)
local: true
local: false
## Set to true if you want to deploy Parseable in a HA mode (multiple ingestors)
## Please note that highAvailability is not supported in local mode
highAvailability:
Expand Down Expand Up @@ -164,18 +164,28 @@ parseable:
tolerations: []
## Use this section to create ServiceMonitor object for
## this Parseable deployment. Read more on ServiceMonitor
## here: https://prometheus-operator.dev/docs/operator/design/#servicemonitor
## here: https://prometheus-operator.dev/docs/api-reference/api/#monitoring.coreos.com/v1.ServiceMonitor
metrics:
serviceMonitor:
enabled: false
namespace: ""
interval: 30s
scrapeTimeout: ""
relabellings: []
metricRelabelings: []
honorLabels: false
additionalLabels: {}
podTargetLabels: []
spec:
jobLabel: ""
targetLabels: []
podTargetLabels: []
endpoints: []
selector: {}
namespaceSelector: {}
sampleLimit: 0
scrapeProtocols: []
targetLimit: 0
labelLimit: 0
labelNameLengthLimit: 0
labelValueLengthLimit: 0
keepDroppedTargets: 0
attachMetadata: {}
scrapeClass: ""
bodySizeLimit: {}

# Default values for Vector
# See Vector helm documentation to learn more:
Expand Down
Loading

0 comments on commit 9b05068

Please sign in to comment.