Skip to content

Commit

Permalink
GDB-10778 Add GraphDB configuring examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Nikolov committed Sep 2, 2024
1 parent d97e4a0 commit 1938110
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 0 deletions.
77 changes: 77 additions & 0 deletions examples/configuring/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Configuring GraphDB
===

## Note

All GraphDB configuration options can be found [here](https://graphdb.ontotext.com/documentation/10.0/configuring-graphdb.html#configuration-properties).

## Properties

```yaml
configuration:
properties:
graphdb.workbench.importDirectory: "/opt/graphdb/home/graphdb-import"
graphdb.cluster.sync.timeoutS: 600
graphdb.workbench.maxConnections: 10
```
## Secret Properties
```yaml
configuration:
secretProperties:
graphdb.connector.keystorePass: "xxxx"
```
**Note: This method of configuring GraphDB is strongly discouraged, as it may lead to secrets being exposed or stored insecurely!**
## Extra Properties
The resources mentioned in this section can be found in the [resources.yaml](./resources.yaml) file.
The appropriate resources are used for each specific case.
### Using existing configmap
```yaml
configuration:
extraProperties:
existingConfigmap: custom-graphdb-properties
# configmapKey: graphdb.properties # Default key
```

### Using existing secret

```yaml
configuration:
extraProperties:
existingSecret: custom-graphdb-secret-properties
secretKey: graphdb-secrets.properties
```
## Java Arguments
```yaml
configuration:
javaArguments: "-Xms4G -Xmx4G"
```
## Extra Environment Variables from a source
The resources mentioned in this section can be found in the [resources.yaml](./resources.yaml) file.
```yaml
extraEnvFrom:
- configMapRef:
name: "connector-properties"
- secretRef:
name: "connector-secret-properties"
```
## Extra Environment Variables
```yaml
extraEnv:
- name: "graphdb.workbench.importDirectory"
value: "/opt/graphdb/home/graphdb-import"
```
40 changes: 40 additions & 0 deletions examples/configuring/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This YAML defines two ConfigMaps and two Secrets for a Kubernetes cluster.
# - ConfigMap "custom-graphdb-properties" stores non-sensitive properties for GraphDB.
# - Secret "custom-graphdb-secret-properties" stores sensitive properties for GraphDB, base64-encoded.
# - ConfigMap "connector-properties" stores non-sensitive properties for a connector, including GPT model settings.
# - Secret "connector-secret-properties" stores a sensitive token for the connector, base64-encoded.

apiVersion: v1
kind: ConfigMap
metadata:
name: custom-graphdb-properties
data:
graphdb.properties: |-
graphdb.connector.port=7200
---
apiVersion: v1
kind: Secret
metadata:
name: custom-graphdb-secret-properties
data:
graphdb-secrets.properties: {{ "graphdb.connector.keystorePass: xxxx" | b64enc }}

---
apiVersion: v1
kind: ConfigMap
metadata:
name: connector-properties
data:
graphdb.connector.port: "7201"
graphdb.gpt.model: "gpt-3.5-turbo"
graphdb.gpt.timeout: "180"
graphdb.gpt.url: "https://api.openai.com/v1/chat/completions"

---
apiVersion: v1
kind: Secret
metadata:
name: connector-secret-properties
data:
graphdb.gpt.token: {{ "<secret-token>" | b64enc }}

0 comments on commit 1938110

Please sign in to comment.