Skip to content

Commit 9a97f2d

Browse files
authored
Add zipkinUrl for horizon-ui (#188)
1 parent da0e267 commit 9a97f2d

4 files changed

Lines changed: 23 additions & 15 deletions

File tree

chart/skywalking/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ The following table lists the configurable parameters of the Skywalking chart an
5757
| `oap.ports.grpc` | OAP grpc port for tracing or metric | `11800` |
5858
| `oap.ports.rest` | OAP http port for the GraphQL query protocol (used by the UI and by `swctl`) | `12800` |
5959
| `oap.ports.admin` | OAP admin REST port (runtime-rule, DSL debugging, inspect, status). Required by Horizon UI's admin features; available on OAP 10.5+ | `17128` |
60-
| `oap.ports.zipkinreceiver` | OAP http port for Zipkin receiver(not exposed by default) | `9411` |
61-
| `oap.ports.zipkinquery` | OAP http port for querying Zipkin traces and UI(not exposed by default) | `9412` |
60+
| `oap.ports.zipkin-receiver` | OAP http port for Zipkin receiver(not exposed by default) | `9411` |
61+
| `oap.ports.zipkin-query` | OAP http port for querying Zipkin traces and UI(not exposed by default) | `9412` |
6262
| `oap.replicas` | OAP k8s deployment replicas | `2` |
6363
| `oap.service.type` | OAP svc type | `ClusterIP` |
6464
| `oap.service.annotations` | OAP svc annotations | `{}` |
@@ -102,7 +102,7 @@ The following table lists the configurable parameters of the Skywalking chart an
102102
| `ui.persistence.storageClass` | Storage class for the chart-managed PVC | `""` |
103103
| `ui.persistence.accessModes` | PVC access modes | `[ReadWriteOnce]` |
104104
| `ui.persistence.size` | PVC size | `1Gi` |
105-
| `ui.config` | `horizon.yaml` content (deep-merged onto chart defaults that point `oap.queryUrl`/`adminUrl` at the in-cluster OAP). See the upstream [`horizon.example.yaml`](https://github.com/apache/skywalking-horizon-ui/blob/main/horizon.example.yaml) and [horizon.yaml reference](https://github.com/apache/skywalking-horizon-ui/blob/main/docs/setup/horizon-yaml.md). `auth.local.users` defaults to empty (BFF refuses to start); see the root README "Web UI" section for a demo snippet and the production Secret pattern | see `values.yaml` |
105+
| `ui.config` | `horizon.yaml` content (deep-merged onto chart defaults that point `oap.queryUrl`/`adminUrl`/`zipkinUrl` at the in-cluster OAP; `zipkinUrl` is derived from `oap.ports.zipkin-query` and only resolves to a usable URL when that port is set). See the upstream [`horizon.example.yaml`](https://github.com/apache/skywalking-horizon-ui/blob/main/horizon.example.yaml) and [horizon.yaml reference](https://github.com/apache/skywalking-horizon-ui/blob/main/docs/setup/horizon-yaml.md). `auth.local.users` defaults to empty (BFF refuses to start); see the root README "Web UI" section for a demo snippet and the production Secret pattern | see `values.yaml` |
106106
| `ui.envFromSecret` | Reference a Secret whose keys are exposed as env vars in the BFF container, for use with `${VAR}` interpolation in `ui.config` (e.g. admin password hash) | `""` |
107107
| `ui.extraEnv` | Extra env vars passed to the BFF container | `[]` |
108108
| `oapInit.nodeAffinity` | OAP init job node affinity policy | `{}` |

chart/skywalking/templates/oap-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ spec:
127127
{{ toYaml .Values.oap.resources | indent 10 }}
128128
{{- end }}
129129
env:
130-
{{- if .Values.oap.ports.zipkinreceiver }}
130+
{{- if index .Values.oap.ports "zipkin-receiver" }}
131131
- name: SW_RECEIVER_ZIPKIN
132132
value: default
133133
- name: SW_RECEIVER_ZIPKIN_REST_PORT
134-
value: "{{ .Values.oap.ports.zipkinreceiver }}"
134+
value: "{{ index .Values.oap.ports "zipkin-receiver" }}"
135135
{{- end }}
136-
{{- if .Values.oap.ports.zipkinquery }}
136+
{{- if index .Values.oap.ports "zipkin-query" }}
137137
- name: SW_QUERY_ZIPKIN
138138
value: default
139139
- name: SW_QUERY_ZIPKIN_REST_PORT
140-
value: "{{ .Values.oap.ports.zipkinquery }}"
140+
value: "{{ index .Values.oap.ports "zipkin-query" }}"
141141
{{- end }}
142142
- name: JAVA_OPTS
143143
value: "-Dmode=no-init {{ .Values.oap.javaOpts }}"

chart/skywalking/templates/ui-configmap.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ horizon.yaml is built by deep-merging:
2020
2. whatever the operator put in `ui.config`
2121
The merge order means user values win on every field except oap.queryUrl /
2222
oap.adminUrl, where we always default to the in-cluster service if the
23-
operator left them unset.
23+
operator left them unset. zipkinUrl is only injected when the Zipkin query
24+
port is enabled — Horizon's BFF rejects an empty/non-URL value at startup.
2425
*/ -}}
25-
{{- $defaults := dict
26-
"oap" (dict
27-
"queryUrl" (printf "http://%s:%v" (include "skywalking.oap.fullname" .) .Values.oap.ports.rest)
28-
"adminUrl" (printf "http://%s:%v" (include "skywalking.oap.fullname" .) (default 17128 .Values.oap.ports.admin))
29-
)
26+
{{- $oapDefaults := dict
27+
"queryUrl" (printf "http://%s:%v" (include "skywalking.oap.fullname" .) .Values.oap.ports.rest)
28+
"adminUrl" (printf "http://%s:%v" (include "skywalking.oap.fullname" .) (default 17128 .Values.oap.ports.admin))
3029
}}
30+
{{- $zipkinQueryPort := index .Values.oap.ports "zipkin-query" }}
31+
{{- if $zipkinQueryPort }}
32+
{{- $_ := set $oapDefaults "zipkinUrl" (printf "http://%s:%v/zipkin" (include "skywalking.oap.fullname" .) $zipkinQueryPort) }}
33+
{{- end }}
34+
{{- $defaults := dict "oap" $oapDefaults }}
3135
{{- $userConfig := default (dict) .Values.ui.config }}
3236
{{- $merged := mergeOverwrite (deepCopy $defaults) (deepCopy $userConfig) }}
3337
apiVersion: v1

chart/skywalking/values.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ oap:
4646
# null (or remove) if the deployed OAP version predates 10.5 — Horizon
4747
# admin features will be unavailable in that case.
4848
admin: 17128
49-
# zipkinreceiver: 9411
50-
# zipkinquery: 9412
49+
# zipkin-receiver: 9411
50+
# zipkin-query: 9412
51+
# promql: 9090
52+
# logql: 3100
53+
# traceql: 3200
54+
# metrics: 1234
5155
replicas: 2
5256
service:
5357
type: ClusterIP

0 commit comments

Comments
 (0)