Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enhance client deployment to receive custom server url #57

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions templates/deployment-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ spec:
- name: UVICORN_NUM_WORKERS
value: "1"
{{- if .Values.server }}
{{- if .Values.client.serverUrl }}
- name: OPAL_SERVER_URL
value: {{ .Values.client.serverUrl | quote }}
{{- else }}
- name: OPAL_SERVER_URL
value: {{ printf "http://%s:%v" (include "opal.serverName" .) .Values.server.port | quote }}
{{- end}}
{{- if not (or (.Values.server.dataConfigSources.external_source_url) (.Values.server.dataConfigSources.config) (hasKey .Values.client.extraEnv "OPAL_DATA_UPDATER_ENABLED") ) }}
- name: OPAL_DATA_UPDATER_ENABLED
value: "False"
Expand Down
4 changes: 4 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@
"opaStartupData": {
"type": "object", "title": "client startup data for embedded opa", "default": null
},
"serverUrl": {
"type": "string",
"title": "opal server url for client to connect to"
},
"secrets": {
"type": "array",
"title": "name of a kubernetes secret from where to fetch secret environment variables.",
Expand Down
6 changes: 4 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ server:
# external_source_url: "https://your-api.com/path/to/api/endpoint"

# Option #3 - Example static data sources (endpoint is empty by default)
# config:
# config:
# entries:
# - url: http://opal-server:7002/policy-data
# topics: ["policy_data"]
Expand All @@ -47,4 +47,6 @@ client:
port: 7000
opaPort: 8181
replicas: 1
extraEnv: {}
# If you need to specify a custom hostname for the opal-sever, configure the serverUrl property
# serverUrl: http://custom-hostname-for-opal:opal-port
extraEnv: {}
Loading