> ## Documentation Index
> Fetch the complete documentation index at: https://grandcentral.backbase.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure a custom connector

> Configure connectors for deployment in Kubernetes environments

Custom connectors require various configurations to function correctly within a Kubernetes environment. These configurations define how the connector interacts with external services, manages security-sensitive data, and optimizes runtime behavior.

## Key configuration areas

<CardGroup cols={2}>
  <Card title="Secrets management" icon="lock">
    Securely store sensitive data using SOPS encryption
  </Card>

  <Card title="Connector properties" icon="sliders">
    Define external service details and feature toggles
  </Card>

  <Card title="Traits" icon="puzzle-piece">
    Control deployment-specific parameters
  </Card>

  <Card title="Resources" icon="file-code">
    Specify transformation files and custom logic
  </Card>
</CardGroup>

## Prerequisites

Before configuring a custom connector, ensure you have:

* Built a connector successfully
* Access to the `gc-devhub-${installation}-applications-live` repository
* Understanding of your target deployment environment

## Secrets management with SOPS

To securely store sensitive data in Kubernetes secrets, use SOPS for encryption. ArgoCD automatically applies encrypted secrets placed in the `secrets` folder as part of the `secrets-app` app.

### Managing secrets

1. Follow the guide in your installation for the specific runtime at:
   ```
   baas-devops-<installation>/gc-devhub-${installation}-applications-live/blob/main/runtimes/<runtime>/secrets/README.md
   ```

2. Configure a secret in the connector by adding the secret name in `values.yaml`:

```yaml theme={"system"}
connector:
  existingSecretName: servicebus-credentials
```

## Connector properties

Define connector configuration values in the Helm `values.yaml` file in the `gc-devhub-${installation}-applications-live` repository.

### Example properties configuration

```yaml theme={"system"}
connector:
  existingSecretName: uat-secret
  properties:
    connector.baseUrl: https://base-url/
    connector.id: vendor-specific-id
    connector.security-token-type: Oauth2
    enableValidation: false
    isEncryptionRequired: false
```

### Common properties

| Property                        | Description                   | Example                   |
| ------------------------------- | ----------------------------- | ------------------------- |
| `connector.baseUrl`             | Base URL for external service | `https://api.example.com` |
| `connector.id`                  | Vendor-specific identifier    | `vendor-123`              |
| `connector.security-token-type` | Authentication type           | `Oauth2`, `Bearer`        |
| `enableValidation`              | Enable request validation     | `true`, `false`           |
| `isEncryptionRequired`          | Require encryption            | `true`, `false`           |

## Traits configuration

Traits control deployment-specific parameters such as auto-scaling, logging, health monitoring, and telemetry.

### Supported traits

Grand Central supports the following [Camel traits](https://camel.apache.org/camel-k/2.6.x/traits/traits.html):

* `affinity` - Pod scheduling preferences
* `container` - Container resource limits
* `health` - Health check configuration
* `knativeservice` - Knative-specific settings
* `logging` - Logging configuration
* `prometheus` - Metrics collection
* `telemetry` - Distributed tracing

### Example traits configuration

```yaml theme={"system"}
connector:
  traits:
    knativeservice:
      minScale: 1
      enabled: true
    logging:
      color: false
      enabled: true
      level: INFO
    addons:
      telemetry:
        auto: true
        enabled: true
    health:
      enabled: true
      livenessProbeEnabled: true
      livenessInitialDelay: 30
      livenessTimeout: 30
      livenessPeriod: 5
      livenessSuccessThreshold: 1
      livenessFailureThreshold: 3
      readinessProbeEnabled: true
      readinessInitialDelay: 5
      readinessTimeout: 30
      readinessPeriod: 5
      readinessSuccessThreshold: 1
      readinessFailureThreshold: 3
      startupProbeEnabled: false
      startupInitialDelay: 5
      startupTimeout: 30
      startupPeriod: 5
      startupSuccessThreshold: 1
      startupFailureThreshold: 3
    prometheus:
      enabled: false
```

### Health check configuration

Configure health, liveness, and readiness probes:

* **Liveness Probe:** Detects if the connector is alive
* **Readiness Probe:** Determines if the connector can accept traffic
* **Startup Probe:** Checks if the app has started successfully

## Resource configurations

Specify additional resources such as transformation files, validation rules, and custom processing logic.

### Supported transformation libraries

Grand Central supports the following transformation libraries for processing request and response payloads:

* [Jolt](https://github.com/bazaarvoice/jolt) - JSON-to-JSON transformation
* [XSLT](https://www.w3.org/TR/xslt/) - XML transformation

### JOLT transformation example

Map a user's first and last name into a single `fullName` field:

```json theme={"system"}
{
  "operation": "shift",
  "spec": {
    "user": {
      "firstName": "fullName.first",
      "lastName": "fullName.last"
    }
  }
}
```

### XSLT transformation example

Convert an XML `<user>` element into a `<customer>` element:

```xml theme={"system"}
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/user">
        <customer>
            <name>
                <xsl:value-of select="firstName"/> <xsl:value-of select="lastName"/>
            </name>
        </customer>
    </xsl:template>
</xsl:transform>
```

## Configuration best practices

<AccordionGroup>
  <Accordion title="Security">
    * Always use SOPS for sensitive data
    * Never commit secrets to version control
    * Rotate credentials regularly
  </Accordion>

  <Accordion title="Resource management">
    * Set appropriate resource limits
    * Configure auto-scaling based on load
    * Monitor resource utilization
  </Accordion>

  <Accordion title="Health checks">
    * Enable all probe types
    * Set realistic timeout values
    * Test probe configurations thoroughly
  </Accordion>

  <Accordion title="Logging">
    * Use appropriate log levels
    * Enable structured logging
    * Configure log retention policies
  </Accordion>
</AccordionGroup>

## Next steps

Once you have completed your connectors configuration, you are ready to:

* [Test and validate](/platform/developer-guides/build/test-and-validate) your connector
* Deploy the connector to your environment
* Verify logs to ensure it's running correctly

## Related resources

* [Camel Traits Configuration](https://camel.apache.org/camel-k/2.6.x/traits/traits.html)
* [Jolt Transformation Library](https://github.com/bazaarvoice/jolt)
* [XSLT Transformation Library](https://www.w3.org/TR/xslt/)
