Skip to content

Commit

Permalink
feat: support advertising with IP to bypass DNS problems (#105)
Browse files Browse the repository at this point in the history
Signed-off-by: arkbriar <[email protected]>
  • Loading branch information
arkbriar authored Jul 18, 2024
1 parent e2121fd commit 91ec47d
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/risingwave/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.65
version: 0.1.66

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 4 additions & 0 deletions charts/risingwave/templates/compute-sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ spec:
- name: RW_LISTEN_ADDR
value: "0.0.0.0:{{ .Values.ports.compute.svc }}"
- name: RW_ADVERTISE_ADDR
{{- if .Values.computeComponent.advertisingWithIP }}
value: "$(POD_IP):{{ .Values.ports.compute.svc }}"
{{- else }}
value: "$(POD_NAME).{{ include "risingwave.computeHeadlessServiceName" . }}.$(POD_NAMESPACE).svc:{{ .Values.ports.compute.svc }}"
{{- end }}
- name: RW_PROMETHEUS_LISTENER_ADDR
value: "0.0.0.0:{{ .Values.ports.compute.metrics }}"
- name: RW_META_ADDR
Expand Down
4 changes: 4 additions & 0 deletions charts/risingwave/templates/meta-sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ spec:
- name: RW_LISTEN_ADDR
value: {{ printf "0.0.0.0:%d" (.Values.ports.meta.svc | int)}}
- name: RW_ADVERTISE_ADDR
{{- if .Values.metaComponent.advertisingWithIP }}
value: "$(POD_IP):{{ .Values.ports.meta.svc }}"
{{- else }}
value: "$(POD_NAME).{{ include "risingwave.metaHeadlessServiceName" . }}.$(POD_NAMESPACE).svc:{{ .Values.ports.meta.svc }}"
{{- end }}
- name: RW_PROMETHEUS_HOST
value: "0.0.0.0:{{ .Values.ports.meta.metrics }}"
- name: RW_STATE_STORE
Expand Down
50 changes: 50 additions & 0 deletions charts/risingwave/tests/advertising_with_ip_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
suite: Test HorizontalPodAutoscaler
templates:
- meta-sts.yaml
- compute-sts.yaml
chart:
appVersion: 1.0.0
version: 0.0.1
tests:
- it: Advertising with IP affects the advertising address (meta)
templates:
- meta-sts.yaml
set:
metaComponent:
advertisingWithIP: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: RW_ADVERTISE_ADDR
value: "$(POD_IP):5690"
- it: Advertising with IP affects the advertising address (compute)
templates:
- compute-sts.yaml
set:
computeComponent:
advertisingWithIP: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: RW_ADVERTISE_ADDR
value: "$(POD_IP):5688"
- it: Advertising with IP changes nothing by default (meta)
templates:
- meta-sts.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: RW_ADVERTISE_ADDR
value: "$(POD_NAME).RELEASE-NAME-risingwave-meta-headless.$(POD_NAMESPACE).svc:5690"
- it: Advertising with IP changes nothing by default (compute)
templates:
- compute-sts.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: RW_ADVERTISE_ADDR
value: "$(POD_NAME).RELEASE-NAME-risingwave-compute-headless.$(POD_NAMESPACE).svc:5688"
10 changes: 10 additions & 0 deletions charts/risingwave/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,11 @@ metaComponent:
whenDeleted: Delete
whenScaled: Delete

## @param metaComponent.advertisingWithIP Enable advertising with IP.
## Defaults to false.
##
advertisingWithIP: false

frontendComponent:
## @param frontendComponent.podLabels Labels to add to the component pods.
##
Expand Down Expand Up @@ -1074,6 +1079,11 @@ computeComponent:
## @param autoDeregistration.enabled Enable auto-deregistration.
enabled: false

## @param metaComponent.advertisingWithIP Enable advertising with IP.
## Defaults to false.
##
advertisingWithIP: false

compactorComponent:
## @param compactorComponent.podLabels Labels to add to the component pods.
##
Expand Down

0 comments on commit 91ec47d

Please sign in to comment.