From ab84ebd9469d13ace4cc4ed43a274b12d05e6d84 Mon Sep 17 00:00:00 2001 From: Tom Skawinski Date: Mon, 13 Jan 2025 11:32:31 -0500 Subject: [PATCH 1/5] Add option to enable git-sync under ndc-mongodb --- charts/ndc-mongodb/Chart.yaml | 2 +- charts/ndc-mongodb/README.md | 25 ++++++++++++++++++++++++- charts/ndc-mongodb/values.yaml | 10 +++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/charts/ndc-mongodb/Chart.yaml b/charts/ndc-mongodb/Chart.yaml index b1884dd..e2257f8 100644 --- a/charts/ndc-mongodb/Chart.yaml +++ b/charts/ndc-mongodb/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-mongodb/README.md b/charts/ndc-mongodb/README.md index f91b249..a36c5f3 100644 --- a/charts/ndc-mongodb/README.md +++ b/charts/ndc-mongodb/README.md @@ -26,12 +26,32 @@ helm upgrade --install \ hasura-ddn/ndc-mongodb ``` +## 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. + +```bash +helm upgrade --install \ + --set namespace="default" \ + --set image.repository="my_repo/ndc-mongodb" \ + --set image.tag="my_custom_image_tag" \ + --set connectorEnvVars.MONGODB_DATABASE_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-mongodb +``` + ## Connector ENV Inputs | Name | Description | Value | | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------- | | `connectorEnvVars.HASURA_SERVICE_TOKEN_SECRET` | Hasura Service Token Secret (Optional) | `""` | | `connectorEnvVars.MONGODB_DATABASE_URI` | Database Connection URI (Required) | `""` | +| `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 @@ -62,4 +82,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 gitSync is enabled) | `git@github.com:/` | +| `initContainers.gitSync.branch` | Branch to read from (Used When gitSync is enabled) | `main` | \ No newline at end of file diff --git a/charts/ndc-mongodb/values.yaml b/charts/ndc-mongodb/values.yaml index 17df087..c0a1c6f 100644 --- a/charts/ndc-mongodb/values.yaml +++ b/charts/ndc-mongodb/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" @@ -142,8 +148,6 @@ connectorEnvVars: HASURA_SERVICE_TOKEN_SECRET: "" MONGODB_DATABASE_URI: "" 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 }} @@ -161,4 +165,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 From 5c5e0cda5eddfeebbb0761fa306b65f54c8745a0 Mon Sep 17 00:00:00 2001 From: Tom Skawinski Date: Mon, 13 Jan 2025 11:40:33 -0500 Subject: [PATCH 2/5] README clarification --- charts/ndc-mongodb/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/ndc-mongodb/README.md b/charts/ndc-mongodb/README.md index a36c5f3..4b11fa1 100644 --- a/charts/ndc-mongodb/README.md +++ b/charts/ndc-mongodb/README.md @@ -30,7 +30,7 @@ helm upgrade --install \ 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. +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 \ @@ -84,5 +84,5 @@ helm upgrade --install \ | `hpa.metrics.resource.name` | Resource name to autoscale on | `` | | `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 gitSync is enabled) | `git@github.com:/` | -| `initContainers.gitSync.branch` | Branch to read from (Used When gitSync is enabled) | `main` | \ No newline at end of file +| `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 From 14c1c212371fc36f66dafd136fcf8aae45bf22e0 Mon Sep 17 00:00:00 2001 From: Tom Skawinski Date: Mon, 13 Jan 2025 14:43:23 -0500 Subject: [PATCH 3/5] 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 From fb76a1a3c9d7eb4b5286f6a0612743e7bb951c8a Mon Sep 17 00:00:00 2001 From: Tom Skawinski Date: Tue, 14 Jan 2025 09:01:31 -0500 Subject: [PATCH 4/5] Address lint errors --- charts/ndc-connector-oracle/values.yaml | 3 ++- charts/ndc-mongodb/values.yaml | 3 ++- charts/ndc-postgres/values.yaml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/charts/ndc-connector-oracle/values.yaml b/charts/ndc-connector-oracle/values.yaml index 05c9150..fcf7db1 100644 --- a/charts/ndc-connector-oracle/values.yaml +++ b/charts/ndc-connector-oracle/values.yaml @@ -170,4 +170,5 @@ env: | - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://localhost:4317 - name: HASURA_CONFIGURATION_DIRECTORY - value: {{ .Values.connectorEnvVars.configDirectory }} \ No newline at end of file + value: {{ .Values.connectorEnvVars.configDirectory }} + \ No newline at end of file diff --git a/charts/ndc-mongodb/values.yaml b/charts/ndc-mongodb/values.yaml index c0a1c6f..acc6ed3 100644 --- a/charts/ndc-mongodb/values.yaml +++ b/charts/ndc-mongodb/values.yaml @@ -165,4 +165,5 @@ env: | - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://localhost:4317 - name: HASURA_CONFIGURATION_DIRECTORY - value: {{ .Values.connectorEnvVars.configDirectory }} \ No newline at end of file + value: {{ .Values.connectorEnvVars.configDirectory }} + \ No newline at end of file diff --git a/charts/ndc-postgres/values.yaml b/charts/ndc-postgres/values.yaml index 76620b6..378812d 100644 --- a/charts/ndc-postgres/values.yaml +++ b/charts/ndc-postgres/values.yaml @@ -189,4 +189,5 @@ env: | - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://localhost:4317 - name: HASURA_CONFIGURATION_DIRECTORY - value: {{ .Values.connectorEnvVars.configDirectory }} \ No newline at end of file + value: {{ .Values.connectorEnvVars.configDirectory }} + \ No newline at end of file From c33a8b7e8f650d00a129e0863dd5f5be0aebaf07 Mon Sep 17 00:00:00 2001 From: Tom Skawinski Date: Tue, 14 Jan 2025 09:05:38 -0500 Subject: [PATCH 5/5] More lint --- charts/ndc-connector-oracle/values.yaml | 1 - charts/ndc-mongodb/values.yaml | 1 - charts/ndc-postgres/values.yaml | 1 - 3 files changed, 3 deletions(-) diff --git a/charts/ndc-connector-oracle/values.yaml b/charts/ndc-connector-oracle/values.yaml index fcf7db1..d27c9cc 100644 --- a/charts/ndc-connector-oracle/values.yaml +++ b/charts/ndc-connector-oracle/values.yaml @@ -171,4 +171,3 @@ env: | value: http://localhost:4317 - name: HASURA_CONFIGURATION_DIRECTORY value: {{ .Values.connectorEnvVars.configDirectory }} - \ No newline at end of file diff --git a/charts/ndc-mongodb/values.yaml b/charts/ndc-mongodb/values.yaml index acc6ed3..a7d18b4 100644 --- a/charts/ndc-mongodb/values.yaml +++ b/charts/ndc-mongodb/values.yaml @@ -166,4 +166,3 @@ env: | value: http://localhost:4317 - name: HASURA_CONFIGURATION_DIRECTORY value: {{ .Values.connectorEnvVars.configDirectory }} - \ No newline at end of file diff --git a/charts/ndc-postgres/values.yaml b/charts/ndc-postgres/values.yaml index 378812d..187bce5 100644 --- a/charts/ndc-postgres/values.yaml +++ b/charts/ndc-postgres/values.yaml @@ -190,4 +190,3 @@ env: | value: http://localhost:4317 - name: HASURA_CONFIGURATION_DIRECTORY value: {{ .Values.connectorEnvVars.configDirectory }} - \ No newline at end of file