Skip to content

Commit f49d47c

Browse files
authored
[heartex/label-studio] Add scheme to probes and sidecar container support (#61)
1 parent 6143514 commit f49d47c

File tree

6 files changed

+120
-6
lines changed

6 files changed

+120
-6
lines changed

heartex/label-studio/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Changelog
2+
## 1.9.6
3+
### Fixes
4+
* Add `scheme` field to readinessProbe and livenessProbe for nginx container.
5+
* Add configuration for additional sidecar containers to run alongside the app's USWGI and nginx containers.
6+
27
## 1.9.5
38
### Fixes
49
* Add missing readiness probe for app deployment app container.

heartex/label-studio/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ home: https://labelstud.io/
55
type: application
66
icon: https://raw.githubusercontent.com/heartexlabs/label-studio/master/images/logo.png
77
# Chart version
8-
version: 1.9.5
8+
version: 1.9.6
99
# Label Studio release version
1010
appVersion: "1.16.0"
1111
kubeVersion: ">= 1.14.0-0"

heartex/label-studio/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,15 @@ directory.
300300
| `app.nginx.livenessProbe.periodSeconds` | Nginx sidecar container: How often (in seconds) to perform the probe | `5` |
301301
| `app.nginx.livenessProbe.successThreshold` | Nginx sidecar container: Minimum consecutive successes for the probe to be considered successful after having failed | `1` |
302302
| `app.nginx.livenessProbe.timeoutSeconds` | Nginx sidecar container: Number of seconds after which the probe times out | `3` |
303+
| `app.nginx.livenessProbe.scheme` | Nginx sidecar container: Scheme for livenessProbe | `HTTP` |
303304
| `app.nginx.readinessProbe.enabled` | Nginx sidecar container: Enable redinessProbe | `true` |
304305
| `app.nginx.readinessProbe.path` | Nginx sidecar container: Path for reasinessProbe | `/version` |
305306
| `app.nginx.readinessProbe.failureThreshold` | Nginx sidecar container: When a probe fails, Kubernetes will try failureThreshold times before giving up | `2` |
306307
| `app.nginx.readinessProbe.initialDelaySeconds` | Nginx sidecar container: Number of seconds after the container has started before probe initiates | `60` |
307308
| `app.nginx.readinessProbe.periodSeconds` | Nginx sidecar container: How often (in seconds) to perform the probe | `10` |
308309
| `app.nginx.readinessProbe.successThreshold` | Nginx sidecar container: Minimum consecutive successes for the probe to be considered successful after having failed | `1` |
309310
| `app.nginx.readinessProbe.timeoutSeconds` | Nginx sidecar container: Number of seconds after which the probe times out | `5` |
311+
| `app.nginx.readinessProbe.scheme` | Nginx sidecar container: Scheme for readinessProbe | `HTTP` |
310312
| `app.service.type` | k8s service type | `ClusterIP` |
311313
| `app.service.port` | k8s service port | `80` |
312314
| `app.service.targetPort` | k8s service target port | `8085` |
@@ -331,6 +333,7 @@ directory.
331333
| `app.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` |
332334
| `app.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` |
333335
| `app.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `app.pdb.minAvailable` and `app.pdb.maxUnavailable` are empty. | `""` |
336+
| `app.sidecarContainers` | Additional sidecar containers to the App Deployment pod | `[]` |
334337

335338
### Rqworker parameters
336339

heartex/label-studio/templates/app-deployment.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ spec:
245245
httpGet:
246246
path: "{{ if eq .Values.app.contextPath "/" }}{{ .Values.app.nginx.readinessProbe.path }}{{ else }}{{ .Values.app.contextPath }}{{ .Values.app.nginx.readinessProbe.path }}{{ end }}"
247247
port: 8085
248+
scheme: {{ .Values.app.nginx.readinessProbe.scheme | default "HTTP" }}
248249
failureThreshold: {{ .Values.app.nginx.readinessProbe.failureThreshold }}
249250
initialDelaySeconds: {{ .Values.app.nginx.readinessProbe.initialDelaySeconds }}
250251
periodSeconds: {{ .Values.app.nginx.readinessProbe.periodSeconds }}
@@ -256,6 +257,7 @@ spec:
256257
httpGet:
257258
path: "{{ if eq .Values.app.contextPath "/" }}{{ .Values.app.nginx.livenessProbe.path }}{{ else }}{{ .Values.app.contextPath }}{{ .Values.app.nginx.livenessProbe.path }}{{ end }}"
258259
port: 8085
260+
scheme: {{ .Values.app.nginx.livenessProbe.scheme | default "HTTP" }}
259261
failureThreshold: {{ .Values.app.nginx.livenessProbe.failureThreshold }}
260262
initialDelaySeconds: {{ .Values.app.nginx.livenessProbe.initialDelaySeconds }}
261263
periodSeconds: {{ .Values.app.nginx.livenessProbe.periodSeconds }}
@@ -312,6 +314,45 @@ spec:
312314
- name: "uwsgimetrics"
313315
containerPort: 9117
314316
{{- end }}
317+
{{- if .Values.app.sidecarContainers }}
318+
{{- range .Values.app.sidecarContainers }}
319+
- name: {{ .name }}
320+
image: {{ .image }}
321+
imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }}
322+
{{- if .securityContext }}
323+
securityContext: {{ toYaml .securityContext | nindent 12 }}
324+
{{- end }}
325+
env:
326+
{{- include "ls.common.envs" $ | nindent 12 }}
327+
{{- if .extraEnvironmentVars -}}
328+
{{- range $key, $value := .extraEnvironmentVars }}
329+
- name: {{ printf "%s" $key | replace "." "_" | upper | quote }}
330+
value: {{ $value | quote }}
331+
{{- end }}
332+
{{- end }}
333+
{{- if .extraEnvironmentSecrets -}}
334+
{{- range $key, $value := .extraEnvironmentSecrets }}
335+
- name: {{ printf "%s" $key | replace "." "_" | upper | quote }}
336+
valueFrom:
337+
secretKeyRef:
338+
name: {{ $value.secretName }}
339+
key: {{ $value.secretKey }}
340+
{{- end }}
341+
{{- end }}
342+
{{- if .readinessProbe }}
343+
readinessProbe: {{ toYaml .readinessProbe | nindent 12 }}
344+
{{- end }}
345+
{{- if .livenessProbe }}
346+
livenessProbe: {{ toYaml .livenessProbe | nindent 12 }}
347+
{{- end }}
348+
resources:
349+
{{- toYaml .resources | nindent 12 }}
350+
volumeMounts:
351+
{{- if .volumeMounts }}
352+
{{ toYaml .volumeMounts | nindent 12 }}
353+
{{- end }}
354+
{{- end }}
355+
{{- end }}
315356
{{- with .Values.app.nodeSelector }}
316357
nodeSelector:
317358
{{- toYaml . | nindent 8 }}

heartex/label-studio/values.schema.json

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@
459459
},
460460
"timeoutSeconds": {
461461
"type": "integer"
462+
},
463+
"scheme": {
464+
"type": "string"
462465
}
463466
},
464467
"additionalProperties": false
@@ -486,6 +489,9 @@
486489
},
487490
"timeoutSeconds": {
488491
"type": "integer"
492+
},
493+
"scheme": {
494+
"type": "string"
489495
}
490496
},
491497
"additionalProperties": false
@@ -748,6 +754,52 @@
748754
}
749755
},
750756
"additionalProperties": false
757+
},
758+
"sidecarContainers": {
759+
"type": "array",
760+
"items": {
761+
"type": "object",
762+
"properties": {
763+
"name": {
764+
"type": "string"
765+
},
766+
"image": {
767+
"type": "string"
768+
},
769+
"imagePullPolicy": {
770+
"type": "string"
771+
},
772+
"securityContext": {
773+
"type": "object",
774+
"additionalProperties": true
775+
},
776+
"extraEnvironmentVars": {
777+
"type": "object",
778+
"additionalProperties": true
779+
},
780+
"extraEnvironmentSecrets": {
781+
"type": "object",
782+
"additionalProperties": true
783+
},
784+
"readinessProbe": {
785+
"type": "object",
786+
"additionalProperties": true
787+
},
788+
"livenessProbe": {
789+
"type": "object",
790+
"additionalProperties": true
791+
},
792+
"resources": {
793+
"type": "object",
794+
"additionalProperties": true
795+
},
796+
"volumeMounts": {
797+
"type": "array",
798+
"additionalProperties": true
799+
}
800+
},
801+
"additionalProperties": false
802+
}
751803
}
752804
},
753805
"additionalProperties": false
@@ -1400,4 +1452,4 @@
14001452
},
14011453
"additionalProperties": false
14021454
}
1403-
}
1455+
}

heartex/label-studio/values.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ app:
176176
periodSeconds: 5
177177
successThreshold: 1
178178
timeoutSeconds: 3
179+
scheme: "HTTP"
179180
readinessProbe:
180181
enabled: true
181182
path: "/version"
@@ -184,6 +185,7 @@ app:
184185
periodSeconds: 10
185186
successThreshold: 1
186187
timeoutSeconds: 5
188+
scheme: "HTTP"
187189

188190
# extraEnvironmentVars is a list of extra environment variables to set in the
189191
# app deployment.
@@ -390,6 +392,17 @@ app:
390392
minAvailable: ""
391393
maxUnavailable: ""
392394

395+
## Add additional sidecar containers to the App Deployment pod
396+
## ref: https://kubernetes.io/docs/concepts/workloads/pods/#sidecar-containers
397+
## e.g:
398+
## sidecarContainers:
399+
## - name: your-sidecar-name
400+
## image: your-sidecar-image
401+
## imagePullPolicy: Always
402+
## command: ['sh', '-c', 'echo "hello world"']
403+
##
404+
sidecarContainers: [ ]
405+
393406
rqworker:
394407
enabled: true
395408

@@ -473,7 +486,7 @@ rqworker:
473486

474487
# Extra k8s annotations to attach to the rqworker pods
475488
# This can either be YAML or a YAML-formatted multi-line templated string map
476-
# of the k8s annotations to apply to the rqworker pods
489+
# of the annotations to apply to the rqworker pods
477490
annotations: { }
478491

479492
# Extra k8s labels to attach to the rqworker
@@ -525,7 +538,7 @@ rqworker:
525538
name: ""
526539
# Extra k8s annotations for the serviceAccount definition. This can either be
527540
# YAML or a YAML-formatted multi-line templated string map of the
528-
# annotations to apply to the serviceAccount.
541+
# k8s annotations to apply to the serviceAccount.
529542
annotations: { }
530543

531544
# Array to add extra volumes
@@ -572,7 +585,7 @@ rqworker:
572585

573586
## @param app.cmdWrapper Additional commands to run prior to starting App. Useful to run wrappers before startup command
574587
## e.g:
575-
## cmdWrapper: "newrelic-admin run-python"
588+
## cmdWrapper: "newrelic-admin run-program"
576589
##
577590
cmdWrapper: ""
578591

@@ -682,4 +695,4 @@ metrics:
682695
periodSeconds: 10
683696
timeoutSeconds: 5
684697
failureThreshold: 3
685-
successThreshold: 1
698+
successThreshold: 1

0 commit comments

Comments
 (0)