Skip to content

Commit

Permalink
feat: add init container to check dep. services
Browse files Browse the repository at this point in the history
  • Loading branch information
schneidermr committed Dec 1, 2023
1 parent 39405c1 commit 53587f1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion appwrite/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- "appwrite"
icon: "https://appwrite.io/images/logos/logo.svg"
type: application
version: 0.1.13
version: 0.1.14
appVersion: "1.4.13"
kubeVersion: ">=1.26"
deprecated: false
Expand Down
19 changes: 19 additions & 0 deletions appwrite/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ securityContext:
{{- toYaml . | nindent 2 }}
{{- end }}
restartPolicy: {{ .component.config.restartPolicy }}
{{- if .component.config.test }}
initContainers:
{{- $configname := (printf "%s-env" (include "appwrite.fullname" .)) -}}
{{- range $i, $v := .component.config.test }}
- name: "dependency-test-{{ $i }}"
image: ghcr.io/schneidermr/kubernetes-tools:telnet-test
env:
- name: TEST_HOST
valueFrom:
configMapKeyRef:
name: {{ $configname }}
key: {{ $v.hostkey }}
- name: TEST_PORT
valueFrom:
configMapKeyRef:
name: {{ $configname }}
key: {{ $v.portkey }}
{{- end }}
{{- end }}
containers:
- name: {{ .component.name }}
{{- with .component.config.containerSecurityContext }}
Expand Down
12 changes: 10 additions & 2 deletions appwrite/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ components:
# -- Define the rediness probe
readinessProbe:
httpGet:
path: /api/health
path: /
port: 80
# -- Define the liveness probe
livenessProbe:
httpGet:
path: /api/health
path: /
port: 80
initialDelaySeconds: 30
timeoutSeconds: 30
Expand All @@ -360,6 +360,11 @@ components:
- name: http
containerPort: 80
protocol: TCP
test:
- hostkey: _APP_REDIS_HOST
portkey: _APP_REDIS_PORT
- hostkey: _APP_DB_HOST
portkey: _APP_DB_PORT

# Service configuration
service:
Expand Down Expand Up @@ -568,6 +573,9 @@ components:
- name: http
containerPort: 80
protocol: TCP
test:
- hostkey: _APP_REDIS_HOST
portkey: _APP_REDIS_PORT

# Service configuration
service:
Expand Down

0 comments on commit 53587f1

Please sign in to comment.