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

Add option to enable git-sync under ndc-mongodb, ndc-postgres & ndc-connector-oracle #8

Merged
merged 5 commits into from
Jan 16, 2025
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
2 changes: 1 addition & 1 deletion charts/ndc-connector-oracle/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion charts/ndc-connector-oracle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,33 @@ helm upgrade --install <release-name> \
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 <release-name> \
--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="[email protected]:<org>/<repo>" \
--set initContainers.gitSync.branch="main" \
--set connectorEnvVars.configDirectory="/work-dir/<repo>/app/connector/<connector-name>" \
hasura-ddn/ndc-connector-oracle
```

## Connector ENV Inputs

| Name | Description | Value |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `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

Expand Down Expand Up @@ -63,4 +83,7 @@ helm upgrade --install <release-name> \
| `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 | `` |
| `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) | `[email protected]:<org>/<repo>` |
| `initContainers.gitSync.branch` | Branch to read from (Used when initContainers.gitSync.enabled is set to true) | `main` |
8 changes: 6 additions & 2 deletions charts/ndc-connector-oracle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ securityContext:
runAsUser: 100
fsGroup: 1000

initContainers:
gitSync:
enabled: false
repo: "[email protected]:<org>/<repo>"
branch: "main"

healthChecks:
enabled: false
livenessProbePath: "/healthz"
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/ndc-mongodb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion charts/ndc-mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,32 @@ helm upgrade --install <release-name> \
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. For clarity, `connector-name` is the name that was give to your connector (ie. Check `app/connector` under your Supergraph).

```bash
helm upgrade --install <release-name> \
--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="[email protected]:<org>/<repo>" \
--set initContainers.gitSync.branch="main" \
--set connectorEnvVars.configDirectory="/work-dir/<repo>/app/connector/<connector-name>" \
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

Expand Down Expand Up @@ -62,4 +82,7 @@ helm upgrade --install <release-name> \
| `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 | `` |
| `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) | `[email protected]:<org>/<repo>` |
| `initContainers.gitSync.branch` | Branch to read from (Used when initContainers.gitSync.enabled is set to true) | `main` |
8 changes: 6 additions & 2 deletions charts/ndc-mongodb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ securityContext:
runAsUser: 100
fsGroup: 1000

initContainers:
gitSync:
enabled: false
repo: "[email protected]:<org>/<repo>"
branch: "main"

healthChecks:
enabled: false
livenessProbePath: "/healthz"
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/ndc-postgres/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion charts/ndc-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ helm upgrade --install <release-name> \
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 <release-name> \
--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="[email protected]:<org>/<repo>" \
--set initContainers.gitSync.branch="main" \
--set connectorEnvVars.configDirectory="/work-dir/<repo>/app/connector/<connector-name>" \
hasura-ddn/ndc-postgres
```

## Connector ENV Inputs

| Name | Description | Value |
Expand All @@ -35,6 +54,7 @@ helm upgrade --install <release-name> \
| `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

Expand Down Expand Up @@ -65,4 +85,7 @@ helm upgrade --install <release-name> \
| `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 | `` |
| `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) | `[email protected]:<org>/<repo>` |
| `initContainers.gitSync.branch` | Branch to read from (Used when initContainers.gitSync.enabled is set to true) | `main` |
9 changes: 9 additions & 0 deletions charts/ndc-postgres/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ securityContext:
runAsUser: 100
fsGroup: 1000

initContainers:
gitSync:
enabled: false
repo: "[email protected]:<org>/<repo>"
branch: "main"

healthChecks:
enabled: false
livenessProbePath: "/healthz"
Expand Down Expand Up @@ -144,6 +150,7 @@ connectorEnvVars:
CLIENT_CERT: ""
CLIENT_KEY: ""
ROOT_CERT: ""
configDirectory: /etc/connector

env: |
{{- if .Values.connectorEnvVars.HASURA_SERVICE_TOKEN_SECRET }}
Expand Down Expand Up @@ -181,3 +188,5 @@ env: |
{{- end }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4317
- name: HASURA_CONFIGURATION_DIRECTORY
value: {{ .Values.connectorEnvVars.configDirectory }}
Loading