From 14c1c212371fc36f66dafd136fcf8aae45bf22e0 Mon Sep 17 00:00:00 2001 From: Tom Skawinski Date: Mon, 13 Jan 2025 14:43:23 -0500 Subject: [PATCH] Enable git-sync under ndc-postgres & ndc-connector-oracle --- charts/ndc-connector-oracle/Chart.yaml | 2 +- charts/ndc-connector-oracle/README.md | 25 ++++++++++++++++++++++++- charts/ndc-connector-oracle/values.yaml | 10 +++++++--- charts/ndc-postgres/Chart.yaml | 2 +- charts/ndc-postgres/README.md | 25 ++++++++++++++++++++++++- charts/ndc-postgres/values.yaml | 9 +++++++++ 6 files changed, 66 insertions(+), 7 deletions(-) diff --git a/charts/ndc-connector-oracle/Chart.yaml b/charts/ndc-connector-oracle/Chart.yaml index be6d199..35e3569 100644 --- a/charts/ndc-connector-oracle/Chart.yaml +++ b/charts/ndc-connector-oracle/Chart.yaml @@ -15,7 +15,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: v2025.01.10 +version: v2025.01.14 # 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 diff --git a/charts/ndc-connector-oracle/README.md b/charts/ndc-connector-oracle/README.md index f6963bb..315e7ce 100644 --- a/charts/ndc-connector-oracle/README.md +++ b/charts/ndc-connector-oracle/README.md @@ -26,6 +26,25 @@ helm upgrade --install \ hasura-ddn/ndc-connector-oracle ``` +## Enabling git-sync + +Follow the pre-requisite [here](../../README.md#using-git-for-metadata-files) which has to be done once and deployed on the cluster. + +Replace `org`, `repo` placeholders in the below command to suit your git repository. Additionally, ensure that `connectorEnvVars.configDirectory` is set to the given path below, providing that you are also replacing `repo` and `connector-name` placeholders within it. For clarity, `connector-name` is the name that was give to your connector (ie. Check `app/connector` under your Supergraph). + +```bash +helm upgrade --install \ + --set namespace="default" \ + --set image.repository="my_repo/ndc-jvm-oracle" \ + --set image.tag="my_custom_image_tag" \ + --set connectorEnvVars.JDBC_URL="jdbc_url" \ + --set initContainers.gitSync.enabled="true" \ + --set initContainers.gitSync.repo="git@github.com:/" \ + --set initContainers.gitSync.branch="main" \ + --set connectorEnvVars.configDirectory="/work-dir//app/connector/" \ + hasura-ddn/ndc-connector-oracle +``` + ## Connector ENV Inputs | Name | Description | Value | @@ -33,6 +52,7 @@ helm upgrade --install \ | `connectorEnvVars.HASURA_SERVICE_TOKEN_SECRET` | Hasura Service Token Secret (Optional) | `""` | | `connectorEnvVars.JDBC_URL` | The JDBC URL to connect to the database (Required) | `""` | | `connectorEnvVars.JDBC_SCHEMAS` | A comma-separated list of schemas to include in the metadata (Optional) | `""` | +| `connectorEnvVars.configDirectory` | Connector config directory (See [Enabling git-sync](README.md#enabling-git-sync) when initContainers.gitSync.enabled is set to true) | `"/etc/connector"` | ## Additional Parameters @@ -63,4 +83,7 @@ helm upgrade --install \ | `hpa.minReplicas` | minReplicas setting for HPA | `2` | | `hpa.maxReplicas` | maxReplicas setting for HPA | `4` | | `hpa.metrics.resource.name` | Resource name to autoscale on | `` | -| `hpa.metrics.resource.target.averageUtilization` | Utilization target on specific resource type | `` | \ No newline at end of file +| `hpa.metrics.resource.target.averageUtilization` | Utilization target on specific resource type | `` | +| `initContainers.gitSync.enabled` | Enable reading connector config files from a git repository | `false` | +| `initContainers.gitSync.repo` | Git repository to read from (Used when initContainers.gitSync.enabled is set to true) | `git@github.com:/` | +| `initContainers.gitSync.branch` | Branch to read from (Used when initContainers.gitSync.enabled is set to true) | `main` | \ No newline at end of file diff --git a/charts/ndc-connector-oracle/values.yaml b/charts/ndc-connector-oracle/values.yaml index bfc23f0..05c9150 100644 --- a/charts/ndc-connector-oracle/values.yaml +++ b/charts/ndc-connector-oracle/values.yaml @@ -19,6 +19,12 @@ securityContext: runAsUser: 100 fsGroup: 1000 +initContainers: + gitSync: + enabled: false + repo: "git@github.com:/" + branch: "main" + healthChecks: enabled: false livenessProbePath: "/healthz" @@ -143,8 +149,6 @@ connectorEnvVars: JDBC_URL: "" JDBC_SCHEMAS: "" configDirectory: /etc/connector -# Configure as below when using git-sync w here ddn-example is the repo name - # configDirectory: /work-dir/ddn-example/app/connector/mongodb env: | {{- if .Values.connectorEnvVars.HASURA_SERVICE_TOKEN_SECRET }} @@ -166,4 +170,4 @@ env: | - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://localhost:4317 - name: HASURA_CONFIGURATION_DIRECTORY - value: {{ .Values.connectorEnvVars.configDirectory }} + value: {{ .Values.connectorEnvVars.configDirectory }} \ No newline at end of file diff --git a/charts/ndc-postgres/Chart.yaml b/charts/ndc-postgres/Chart.yaml index 5768467..2c0fa58 100644 --- a/charts/ndc-postgres/Chart.yaml +++ b/charts/ndc-postgres/Chart.yaml @@ -15,7 +15,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: v2025.01.10 +version: v2025.01.14 # 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 diff --git a/charts/ndc-postgres/README.md b/charts/ndc-postgres/README.md index 53fb624..12c74e6 100644 --- a/charts/ndc-postgres/README.md +++ b/charts/ndc-postgres/README.md @@ -26,6 +26,25 @@ helm upgrade --install \ hasura-ddn/ndc-postgres ``` +## Enabling git-sync + +Follow the pre-requisite [here](../../README.md#using-git-for-metadata-files) which has to be done once and deployed on the cluster. + +Replace `org`, `repo` placeholders in the below command to suit your git repository. Additionally, ensure that `connectorEnvVars.configDirectory` is set to the given path below, providing that you are also replacing `repo` and `connector-name` placeholders within it. For clarity, `connector-name` is the name that was give to your connector (ie. Check `app/connector` under your Supergraph). + +```bash +helm upgrade --install \ + --set namespace="default" \ + --set image.repository="my_repo/ndc-postgres" \ + --set image.tag="my_custom_image_tag" \ + --set connectorEnvVars.CONNECTION_URI="db_connection_string" \ + --set initContainers.gitSync.enabled="true" \ + --set initContainers.gitSync.repo="git@github.com:/" \ + --set initContainers.gitSync.branch="main" \ + --set connectorEnvVars.configDirectory="/work-dir//app/connector/" \ + hasura-ddn/ndc-postgres +``` + ## Connector ENV Inputs | Name | Description | Value | @@ -35,6 +54,7 @@ helm upgrade --install \ | `connectorEnvVars.CLIENT_CERT` | Database Client cert (Optional) | `""` | | `connectorEnvVars.CLIENT_KEY` | Database Client key (Optional) | `""` | | `connectorEnvVars.ROOT_CERT` | Database Root cert (Optional) | `""` | +| `connectorEnvVars.configDirectory` | Connector config directory (See [Enabling git-sync](README.md#enabling-git-sync) when initContainers.gitSync.enabled is set to true) | `"/etc/connector"` | ## Additional Parameters @@ -65,4 +85,7 @@ helm upgrade --install \ | `hpa.minReplicas` | minReplicas setting for HPA | `2` | | `hpa.maxReplicas` | maxReplicas setting for HPA | `4` | | `hpa.metrics.resource.name` | Resource name to autoscale on | `` | -| `hpa.metrics.resource.target.averageUtilization` | Utilization target on specific resource type | `` | \ No newline at end of file +| `hpa.metrics.resource.target.averageUtilization` | Utilization target on specific resource type | `` | +| `initContainers.gitSync.enabled` | Enable reading connector config files from a git repository | `false` | +| `initContainers.gitSync.repo` | Git repository to read from (Used when initContainers.gitSync.enabled is set to true) | `git@github.com:/` | +| `initContainers.gitSync.branch` | Branch to read from (Used when initContainers.gitSync.enabled is set to true) | `main` | \ No newline at end of file diff --git a/charts/ndc-postgres/values.yaml b/charts/ndc-postgres/values.yaml index 94444dc..76620b6 100644 --- a/charts/ndc-postgres/values.yaml +++ b/charts/ndc-postgres/values.yaml @@ -19,6 +19,12 @@ securityContext: runAsUser: 100 fsGroup: 1000 +initContainers: + gitSync: + enabled: false + repo: "git@github.com:/" + branch: "main" + healthChecks: enabled: false livenessProbePath: "/healthz" @@ -144,6 +150,7 @@ connectorEnvVars: CLIENT_CERT: "" CLIENT_KEY: "" ROOT_CERT: "" + configDirectory: /etc/connector env: | {{- if .Values.connectorEnvVars.HASURA_SERVICE_TOKEN_SECRET }} @@ -181,3 +188,5 @@ env: | {{- end }} - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://localhost:4317 + - name: HASURA_CONFIGURATION_DIRECTORY + value: {{ .Values.connectorEnvVars.configDirectory }} \ No newline at end of file