mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-15 04:18:20 +00:00
Merge commit 'refs/review/20261015-fix-953-945-949/945' into fix/pr945-reuse-values-20261015
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
This commit is contained in:
commit
b095b242a4
4 changed files with 49 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ spec:
|
|||
imagePullPolicy: {{ .Values.images.pullPolicy }}
|
||||
env:
|
||||
- name: SKILLHUB_API_UPSTREAM
|
||||
value: http://{{ include "skillhub.fullname" . }}-server:{{ .Values.server.service.port }}
|
||||
value: {{ printf "http://%s-server.%s.svc.%s:%v" (include "skillhub.fullname" .) .Release.Namespace .Values.web.clusterDomain .Values.server.service.port | quote }}
|
||||
- name: SKILLHUB_PUBLIC_BASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
|
|
|
|||
|
|
@ -23,6 +23,45 @@ assert_rejected() {
|
|||
fi
|
||||
}
|
||||
|
||||
assert_web_upstream() {
|
||||
local manifest=$1
|
||||
local expected=$2
|
||||
[[ $(grep -Fc 'name: SKILLHUB_API_UPSTREAM' "$manifest") -eq 1 ]] \
|
||||
|| fail "Web must render exactly one built-in API upstream"
|
||||
grep -A1 -F 'name: SKILLHUB_API_UPSTREAM' "$manifest" \
|
||||
| grep -Fq "value: \"$expected\"" \
|
||||
|| fail "Web runtime DNS upstream must be $expected"
|
||||
}
|
||||
|
||||
# Nginx runtime DNS resolution does not expand the pod's search suffixes.
|
||||
render web-dns "$CHART_DIR" --namespace default \
|
||||
--show-only templates/web-deployment.yaml >"$TMP_DIR/web-dns.yaml"
|
||||
assert_web_upstream "$TMP_DIR/web-dns.yaml" \
|
||||
'http://web-dns-skillhub-server.default.svc.cluster.local:8080'
|
||||
|
||||
render skillhub "$CHART_DIR" --namespace team-skills \
|
||||
--show-only templates/web-deployment.yaml >"$TMP_DIR/web-dns-namespace.yaml"
|
||||
assert_web_upstream "$TMP_DIR/web-dns-namespace.yaml" \
|
||||
'http://skillhub-server.team-skills.svc.cluster.local:8080'
|
||||
|
||||
render web-dns "$CHART_DIR" --namespace team-skills \
|
||||
--set nameOverride=registry \
|
||||
--show-only templates/web-deployment.yaml >"$TMP_DIR/web-dns-name.yaml"
|
||||
assert_web_upstream "$TMP_DIR/web-dns-name.yaml" \
|
||||
'http://web-dns-registry-server.team-skills.svc.cluster.local:8080'
|
||||
|
||||
render web-dns "$CHART_DIR" --namespace team-skills \
|
||||
--set fullnameOverride=custom-hub --set server.service.port=9080 \
|
||||
--set web.clusterDomain=k8s.example.internal \
|
||||
--show-only templates/web-deployment.yaml >"$TMP_DIR/web-dns-custom.yaml"
|
||||
assert_web_upstream "$TMP_DIR/web-dns-custom.yaml" \
|
||||
'http://custom-hub-server.team-skills.svc.k8s.example.internal:9080'
|
||||
|
||||
assert_rejected web-dns-empty-domain --set-string web.clusterDomain=
|
||||
assert_rejected web-dns-url-domain --set-string web.clusterDomain=https://cluster.local
|
||||
assert_rejected web-dns-empty-label --set-string web.clusterDomain=cluster..local
|
||||
assert_rejected web-dns-invalid-label --set-string web.clusterDomain=-cluster.local
|
||||
|
||||
render verify "$CHART_DIR" >"$TMP_DIR/default.yaml"
|
||||
grep -Fq 'name: POSTGRESQL_MAX_CONNECTIONS' "$TMP_DIR/default.yaml"
|
||||
grep -Fq 'value: "verify-postgresql"' "$TMP_DIR/default.yaml"
|
||||
|
|
|
|||
|
|
@ -482,6 +482,12 @@
|
|||
"required": ["replicaCount", "image", "service", "resources", "extraEnv", "podAnnotations", "imagePullSecrets", "nodeSelector", "tolerations", "affinity", "probes", "autoscaling", "podDisruptionBudget"],
|
||||
"properties": {
|
||||
"replicaCount": { "type": "integer", "minimum": 1 },
|
||||
"clusterDomain": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 253,
|
||||
"pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$"
|
||||
},
|
||||
"image": { "$ref": "#/definitions/image" },
|
||||
"service": { "$ref": "#/definitions/service" },
|
||||
"basePath": { "type": "string", "pattern": "^$|^/$|^(/[A-Za-z0-9_~-][A-Za-z0-9._~-]*)+/$" },
|
||||
|
|
|
|||
|
|
@ -391,6 +391,9 @@ server:
|
|||
# ============================================================================
|
||||
web:
|
||||
replicaCount: 1
|
||||
# Nginx resolves the API upstream at runtime without pod DNS search suffixes.
|
||||
# Set the cluster DNS domain here instead of duplicating SKILLHUB_API_UPSTREAM in extraEnv.
|
||||
clusterDomain: cluster.local
|
||||
image:
|
||||
registry: ""
|
||||
tag: ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue