Skip to content

Commit

Permalink
Update liveness checks and debug ports
Browse files Browse the repository at this point in the history
Closes #111
  • Loading branch information
Daniel Swärd committed May 2, 2023
1 parent 5a5ece1 commit 81eccf1
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 65 deletions.
5 changes: 5 additions & 0 deletions charts/ocis/templates/audit/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ spec:
# - name: AUDIT_TRACING_COLLECTOR
# value: {{ .Values.tracing.collector | quote }}

- name: AUDIT_DEBUG_PPROF
value: {{ .Values.debug.profiling | quote }}
- name: AUDIT_DEBUG_ADDR
value: 0.0.0.0:9229

- name: AUDIT_EVENTS_ENDPOINT
{{- if not .Values.messagingSystem.external.enabled }}
value: {{ .appNameNats }}:9233
Expand Down
17 changes: 17 additions & 0 deletions charts/ocis/templates/audit/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- include "ocis.appNames" (dict "scope" . "appName" "appNameAudit" "appNameSuffix" "") -}}
apiVersion: v1
kind: Service
metadata:
name: {{ .appName }}
namespace: {{ template "ocis.namespace" . }}
labels:
app: {{ .appName }}
ocis-metrics: enabled
{{- include "ocis.labels" . | nindent 4 }}
spec:
selector:
app: {{ .appName }}
ports:
- name: metrics-debug
port: 9229
protocol: TCP
26 changes: 7 additions & 19 deletions charts/ocis/templates/idm/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ spec:
- name: IDM_TRACING_COLLECTOR
value: {{ .Values.tracing.collector | quote }}

# - name: IDM_DEBUG_PPROF
# value: {{ .Values.debug.profiling | quote }}
- name: IDM_DEBUG_PPROF
value: {{ .Values.debug.profiling | quote }}

- name: IDM_LDAPS_ADDR
value: 0.0.0.0:9235
# - name: IDM_DEBUG_ADDR
# value: 0.0.0.0:9239
- name: IDM_DEBUG_ADDR
value: 0.0.0.0:9239

- name: IDM_CREATE_DEMO_USERS
value: {{ .Values.features.demoUsers | quote }}
Expand Down Expand Up @@ -106,27 +106,15 @@ spec:
- name: IDM_LDAPS_KEY
value: /etc/ocis/ldap-cert/ldap.key

livenessProbe:
# TODO: IDM does not currently provide a debug port, re-enable this once that is implemented
# httpGet:
# path: /healthz
# port: metrics-debug
# until then we're just doing a TCP check on the main port
tcpSocket:
port: ldaps
timeoutSeconds: 10
initialDelaySeconds: 60
periodSeconds: 20
failureThreshold: 3
{{- include "ocis.livenessProbe" . | nindent 10 }}

resources: {{ toYaml .resources | nindent 12 }}

ports:
- name: ldaps
containerPort: 9235
# TODO: IDM does not currently provide a debug port, re-enable this once that is implemented
# - name: metrics-debug
# containerPort: 9239
- name: metrics-debug
containerPort: 9239

volumeMounts:
- name: ocis-config-tmp
Expand Down
7 changes: 3 additions & 4 deletions charts/ocis/templates/idm/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ spec:
- name: ldaps
port: 9235
protocol: TCP
# TODO: IDM does not currently provide a debug port, re-enable this once that is implemented
# - name: metrics-debug
# port: 9239
# protocol: TCP
- name: metrics-debug
port: 9239
protocol: TCP
{{- end }}
27 changes: 7 additions & 20 deletions charts/ocis/templates/nats/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,26 @@ spec:
# - name: NATS_TRACING_COLLECTOR
# value: {{ .Values.tracing.collector | quote }}

# - name: NATS_DEBUG_PPROF
# value: {{ .Values.debug.profiling | quote }}
- name: NATS_DEBUG_PPROF
value: {{ .Values.debug.profiling | quote }}

- name: NATS_NATS_HOST
value: "0.0.0.0"
- name: NATS_NATS_PORT
value: "9233"

# - name: NATS_DEBUG_ADDR
# value: 0.0.0.0:9234
- name: NATS_DEBUG_ADDR
value: 0.0.0.0:9234

livenessProbe:
# TODO: NATS does not currently provide a debug port, re-enable this once that is implemented
# See: https://github.com/owncloud/ocis-charts/issues/111
# httpGet:
# path: /healthz
# port: metrics-debug
# until then we're just doing a TCP check on the main port
tcpSocket:
port: 9233
timeoutSeconds: 10
initialDelaySeconds: 60
periodSeconds: 20
failureThreshold: 3
{{- include "ocis.livenessProbe" . | nindent 10 }}

resources: {{ toYaml .resources | nindent 12 }}

ports:
- name: nats
containerPort: 9233
# TODO: NATS does not currently provide a debug port, re-enable this once that is implemented
# - name: metrics-debug
# containerPort: 9234
- name: metrics-debug
containerPort: 9234

volumeMounts:
- name: nats-data
Expand Down
7 changes: 3 additions & 4 deletions charts/ocis/templates/nats/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ spec:
- name: nats
port: 9233
protocol: TCP
# TODO: NATS does not currently provide a debug port, re-enable this once that is implemented
# - name: metrics-debug
# port: 9234
# protocol: TCP
- name: metrics-debug
port: 9234
protocol: TCP
{{- end }}
26 changes: 8 additions & 18 deletions charts/ocis/templates/notifications/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ spec:
# - name: NOTIFICATIONS_TRACING_COLLECTOR
# value: {{ .Values.tracing.collector | quote }}

# - name: NOTIFICATIONS_DEBUG_PPROF
# value: {{ .Values.debug.profiling | quote }}
- name: NOTIFICATIONS_DEBUG_PPROF
value: {{ .Values.debug.profiling | quote }}

# - name: NOTIFICATIONS_DEBUG_ADDR
# value: 0.0.0.0:9174
- name: NOTIFICATIONS_DEBUG_ADDR
value: 0.0.0.0:9174

- name: NOTIFICATIONS_SMTP_HOST
value: {{ .Values.features.emailNotifications.smtp.host | quote }}
Expand Down Expand Up @@ -104,22 +104,12 @@ spec:
name: {{ .Values.secretRefs.machineAuthApiKeySecretRef }}
key: machine-auth-api-key

# TODO: This service does not currently provide a debug port, re-enable this once that is implemented
# See: https://github.com/owncloud/ocis-charts/issues/111
# livenessProbe:
# httpGet:
# path: /healthz
# port: metrics-debug
# timeoutSeconds: 10
# initialDelaySeconds: 60
# periodSeconds: 20
# failureThreshold: 3
{{- include "ocis.livenessProbe" . | nindent 10 }}

resources: {{ toYaml .resources | nindent 12 }}
# TODO: This service does not currently provide a debug port, re-enable this once that is implemented
# ports:
# - name: metrics-debug
# containerPort: 9174
ports:
- name: metrics-debug
containerPort: 9174

volumeMounts:
- name: ocis-config-tmp
Expand Down
19 changes: 19 additions & 0 deletions charts/ocis/templates/notifications/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.features.emailNotifications.enabled }}
{{- include "ocis.appNames" (dict "scope" . "appName" "appNameNotifications" "appNameSuffix" "") -}}
apiVersion: v1
kind: Service
metadata:
name: {{ .appName }}
namespace: {{ template "ocis.namespace" . }}
labels:
app: {{ .appName }}
ocis-metrics: enabled
{{- include "ocis.labels" . | nindent 4 }}
spec:
selector:
app: {{ .appName }}
ports:
- name: metrics-debug
port: 9174
protocol: TCP
{{- end }}

0 comments on commit 81eccf1

Please sign in to comment.