-
Notifications
You must be signed in to change notification settings - Fork 665
Description
Problem
The Feature Flags UI (aka Flagd UI) is not accessible via the frontend-proxy at http://localhost:8080/feature as stated in the documentation.
Chart version: opentelemetry-demo-0.38.1
Steps to reproduce
- Install the chart as described in the documentation.
- Either port-forward the frontend-proxy or expose it via Ingress or Gateway
- Navigate to the
/feature
path to access the Feature Flags UI - You will get a 503, since no backend is available
Cause
As you can see in the following snippet, the flagd-ui
container is deployed as a Sidecar container in the flagd
pod.
opentelemetry-helm-charts/charts/opentelemetry-demo/values.yaml
Lines 611 to 682 in b71d101
flagd: | |
enabled: true | |
imageOverride: | |
repository: "ghcr.io/open-feature/flagd" | |
tag: "v0.12.8" | |
useDefault: | |
env: true | |
replicas: 1 | |
ports: | |
- name: rpc | |
value: 8013 | |
- name: ofrep | |
value: 8016 | |
env: | |
- name: FLAGD_METRICS_EXPORTER | |
value: otel | |
- name: FLAGD_OTEL_COLLECTOR_URI | |
value: $(OTEL_COLLECTOR_NAME):4317 | |
- name: GOMEMLIMIT | |
value: 60MiB | |
resources: | |
limits: | |
memory: 75Mi | |
command: | |
- "/flagd-build" | |
- "start" | |
- "--port" | |
- "8013" | |
- "--ofrep-port" | |
- "8016" | |
- "--uri" | |
- "file:./etc/flagd/demo.flagd.json" | |
mountedEmptyDirs: | |
- name: config-rw | |
mountPath: /etc/flagd | |
# flagd-ui as a sidecar container in the same pod so the flag json file can be shared | |
sidecarContainers: | |
- name: flagd-ui | |
useDefault: | |
env: true | |
service: | |
port: 4000 | |
env: | |
- name: FLAGD_METRICS_EXPORTER | |
value: otel | |
- name: OTEL_EXPORTER_OTLP_ENDPOINT | |
value: http://$(OTEL_COLLECTOR_NAME):4318 | |
- name: FLAGD_UI_PORT | |
value: "4000" | |
- name: SECRET_KEY_BASE | |
value: yYrECL4qbNwleYInGJYvVnSkwJuSQJ4ijPTx5tirGUXrbznFIBFVJdPl5t6O9ASw | |
- name: PHX_HOST | |
value: localhost | |
resources: | |
limits: | |
memory: 250Mi | |
volumeMounts: | |
- name: config-rw | |
mountPath: /app/data | |
initContainers: | |
- name: init-config | |
image: busybox | |
command: ["sh", "-c", "cp /config-ro/demo.flagd.json /config-rw/demo.flagd.json && cat /config-rw/demo.flagd.json"] | |
volumeMounts: | |
- mountPath: /config-ro | |
name: config-ro | |
- mountPath: /config-rw | |
name: config-rw | |
additionalVolumes: | |
- name: config-ro | |
configMap: | |
name: flagd-config |
Therefore it is exposed by the flagd
service at port 4000, as you can see in the generated manifest:
opentelemetry-helm-charts/charts/opentelemetry-demo/examples/default/rendered/component.yaml
Lines 127 to 157 in b71d101
# Source: opentelemetry-demo/templates/component.yaml | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: flagd | |
labels: | |
helm.sh/chart: opentelemetry-demo-0.38.1 | |
opentelemetry.io/name: flagd | |
app.kubernetes.io/component: flagd | |
app.kubernetes.io/name: flagd | |
app.kubernetes.io/version: "2.1.3" | |
app.kubernetes.io/part-of: opentelemetry-demo | |
app.kubernetes.io/managed-by: Helm | |
spec: | |
type: ClusterIP | |
ports: | |
- port: 8013 | |
name: rpc | |
targetPort: 8013 | |
- port: 8016 | |
name: ofrep | |
targetPort: 8016 | |
- port: 4000 | |
name: tcp-service-0 | |
targetPort: 4000 | |
selector: | |
opentelemetry.io/name: flagd | |
--- |
However, in values.yml
, the frontend-proxy
component points to the flagd-ui
service, which does not exist.
We shall set FLAGD_UI_HOST=flagd
.
opentelemetry-helm-charts/charts/opentelemetry-demo/values.yaml
Lines 400 to 407 in b71d101
- name: FLAGD_HOST | |
value: flagd | |
- name: FLAGD_PORT | |
value: "8013" | |
- name: FLAGD_UI_HOST | |
value: flagd-ui | |
- name: FLAGD_UI_PORT | |
value: "4000" |
This error probably originates from the fact that in the .env
file in https://github.com/open-telemetry/opentelemetry-demo/ they set FLAGD_UI_HOST=flagd-ui
.
But that .env
file is used for their docker-compose deployment, where there is indeed a dedicated service for flagd-ui
.