From e95cfe4019e8d43b3b54b72dfc7a51d56e01b76a Mon Sep 17 00:00:00 2001 From: Cristi Buzec Date: Mon, 18 Dec 2023 08:37:01 +0200 Subject: [PATCH 1/2] feat: Enhance client deployment to receive custom server url --- templates/deployment-client.yaml | 5 +++++ values.schema.json | 4 ++++ values.yaml | 6 ++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/templates/deployment-client.yaml b/templates/deployment-client.yaml index 4744aad..45a982a 100644 --- a/templates/deployment-client.yaml +++ b/templates/deployment-client.yaml @@ -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" diff --git a/values.schema.json b/values.schema.json index 65376ca..f138b52 100644 --- a/values.schema.json +++ b/values.schema.json @@ -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.", diff --git a/values.yaml b/values.yaml index 058a349..dd6b9ff 100644 --- a/values.yaml +++ b/values.yaml @@ -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"] @@ -47,4 +47,6 @@ client: port: 7000 opaPort: 8181 replicas: 1 - extraEnv: {} \ No newline at end of file + # 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: {} From 694fe9f988a2d31429c4d5f881f51fc10f6e15b4 Mon Sep 17 00:00:00 2001 From: Razco Date: Mon, 18 Dec 2023 11:40:46 +0200 Subject: [PATCH 2/2] fixing lint --- .github/workflows/release.yaml | 2 +- values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fcab98f..f77f447 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,7 +34,7 @@ jobs: npx release-it --ci env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: opal version + - name: opal versionpj id: opalVersion run: | cat /tmp/opal.version diff --git a/values.yaml b/values.yaml index 058a349..eb7d732 100644 --- a/values.yaml +++ b/values.yaml @@ -47,4 +47,4 @@ client: port: 7000 opaPort: 8181 replicas: 1 - extraEnv: {} \ No newline at end of file + extraEnv: {}