Skip to content

Commit

Permalink
Merge pull request #157 from 1Password/add-profiler
Browse files Browse the repository at this point in the history
Add option to enable profiler
  • Loading branch information
jpcoenen authored Jul 14, 2023
2 parents d51637e + a218505 commit a41765b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/connect/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ maintainers:
- name: 1Password Secrets Integrations Team
email: [email protected]
icon: https://avatars.githubusercontent.com/u/38230737
appVersion: "1.7.0"
appVersion: "1.7.1"
14 changes: 14 additions & 0 deletions charts/connect/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,17 @@ Sets extra service annotations
{{- end }}
{{- end }}
{{- end -}}

{{/*
Sets environment variables when profiler is enabled
*/}}
{{- define "onepassword-connect.profilerConfig" -}}
{{- if .Values.connect.profiler.enabled}}
- name: OP_PROFILER_OUTPUT_DIR
value: "/home/opuser/.op/data/profiler"
- name: OP_PROFILER_INTERVAL
value: "{{ .Values.connect.profiler.interval }}"
- name: OP_PROFILER_KEEP_LAST
value: "{{ .Values.connect.profiler.keepLast }}"
{{- end -}}
{{- end -}}
11 changes: 11 additions & 0 deletions charts/connect/templates/connect-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
{{- end }}
- name: OP_LOG_LEVEL
value: "{{ .Values.connect.api.logLevel }}"
{{- include "onepassword-connect.profilerConfig" . | indent 12 -}}
{{- if .Values.connect.probes.readiness }}
readinessProbe:
httpGet:
Expand Down Expand Up @@ -131,6 +132,7 @@ spec:
value: localhost:11220
- name: OP_LOG_LEVEL
value: "{{ .Values.connect.sync.logLevel }}"
{{- include "onepassword-connect.profilerConfig" . | indent 12 }}
{{- if .Values.connect.probes.readiness }}
readinessProbe:
httpGet:
Expand All @@ -151,4 +153,13 @@ spec:
volumeMounts:
- mountPath: /home/opuser/.op/data
name: {{ .Values.connect.dataVolume.name }}
{{- if .Values.connect.profiler.enabled }}
- name: profiler-data
image: alpine
command: [ 'sleep', 'infinity' ]
volumeMounts:
- name: {{ .Values.connect.dataVolume.name }}
mountPath: /data
subPath: profiler
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ connect:
# hosts:
# - chart-example.local

# Optionally the internal profiler can be enabled to debug memory or performance issues.
# For normal operation of Connect this does not have to enabled.
profiler:
enabled: false
# The interval at which profiler snapshots are taken.
interval: 6h
# Number of profiler snapshots to keep.
keepLast: 12

# This section of values is for 1Password Operator Configuration
operator:
# Denotes whether the 1Password Operator will be deployed
Expand Down

0 comments on commit a41765b

Please sign in to comment.