feat: 更新测试配置文件
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: "{{ include "dify.fullname" . }}-test-connection"
|
|
||||||
labels:
|
|
||||||
{{- include "dify.labels" . | nindent 4 }}
|
|
||||||
annotations:
|
|
||||||
"helm.sh/hook": test
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: wget
|
|
||||||
image: busybox
|
|
||||||
command: ['wget']
|
|
||||||
args: ['{{ include "dify.fullname" . }}:{{ .Values.service.port }}']
|
|
||||||
restartPolicy: Never
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: "{{ include "dify.fullname" . }}-test-postgres-connection"
|
||||||
|
labels:
|
||||||
|
{{- include "dify.labels" . | nindent 4 }}
|
||||||
|
component: "postgres"
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": test
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: check-postgres
|
||||||
|
image: "{{ .Values.postgresql.image.registry }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}"
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
until PGPASSWORD=$DB_PASSWORD pg_isready -h $DB_HOST -U $DB_USERNAME -d $DB_DATABASE ; do
|
||||||
|
echo "Waiting for PostgreSQL sequence to be available..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo "PostgreSQL is ready."
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ template "dify.api.fullname" . }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ template "dify.api.fullname" . }}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: "{{ include "dify.fullname" . }}-test-redis-connection"
|
||||||
|
labels:
|
||||||
|
{{- include "dify.labels" . | nindent 4 }}
|
||||||
|
component: "redis"
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": test
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: check-redis
|
||||||
|
image: "{{ .Values.redis.image.registry }}/{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
until redis-cli -h $REDIS_HOST -p $REDIS_PORT -a $REDIS_PASSWORD ping | grep -q PONG; do
|
||||||
|
echo "Waiting for Redis service to be available..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo "Redis is ready."
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ template "dify.api.fullname" . }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ template "dify.api.fullname" . }}
|
||||||
|
|
||||||
Reference in New Issue
Block a user