Skip to content

Environment Variables

TRIGRA can be configured using environment variables, which are set via Kubernetes secrets or ConfigMaps.

VariableDescriptionDefault
WEBHOOK_SECRETSecret key for GitHub webhook validationRequired
VariableDescriptionDefault
GITHUB_TOKENGitHub token for private repositories""
PORTHTTP server port8080
NAMESPACETarget namespace for deploymentsdefault
LOG_LEVELLogging verbosity (debug, info, warn, error)info

The recommended way to set sensitive values:

apiVersion: v1
kind: Secret
metadata:
name: trigra-secret
type: Opaque
stringData:
WEBHOOK_SECRET: "your-webhook-secret-here"
GITHUB_TOKEN: "ghp_xxxxxxxxxxxx"

Apply:

Terminal window
kubectl apply -f secret.yaml

Or create directly:

Terminal window
kubectl create secret generic trigra-secret \
--from-literal=WEBHOOK_SECRET="$(openssl rand -hex 32)" \
--from-literal=GITHUB_TOKEN="your-token"

For non-sensitive configuration:

apiVersion: v1
kind: ConfigMap
metadata:
name: trigra-config
data:
NAMESPACE: "production"
LOG_LEVEL: "debug"

Reference in your deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
name: trigra
spec:
template:
spec:
containers:
- name: trigra
image: taiwrash/trigra:latest
env:
# From Secret
- name: WEBHOOK_SECRET
valueFrom:
secretKeyRef:
name: trigra-secret
key: WEBHOOK_SECRET
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: trigra-secret
key: GITHUB_TOKEN
# From ConfigMap
- name: NAMESPACE
valueFrom:
configMapKeyRef:
name: trigra-config
key: NAMESPACE
# Direct value
- name: LOG_LEVEL
value: "info"

When using Helm, values are automatically mapped to environment variables:

Terminal window
helm install trigra ./helm/trigra \
--set github.webhookSecret="your-secret" \
--set github.token="your-token" \
--set namespace="production"

Required. Used to validate incoming GitHub webhooks.

Generate a secure secret:

Terminal window
# Using OpenSSL
openssl rand -hex 32
# Using /dev/urandom
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1

This must match the secret configured in your GitHub webhook settings.

Optional. Required only for private repositories.

Create a token at: GitHub Settings → Developer settings → Personal access tokens

Required scopes:

  • repo - For private repositories
  • read:org - If using organization repositories

The HTTP port the server listens on. Defaults to 8080.

The default namespace where resources are deployed when not specified in the YAML.

Terminal window
# Deploy to staging namespace
--set namespace=staging

Control logging verbosity:

LevelDescription
debugVerbose output, useful for troubleshooting
infoStandard operational logs
warnWarnings and errors only
errorErrors only

To rotate the webhook secret:

  1. Generate new secret:

    Terminal window
    NEW_SECRET=$(openssl rand -hex 32)
  2. Update Kubernetes secret:

    Terminal window
    kubectl create secret generic trigra-secret \
    --from-literal=WEBHOOK_SECRET="$NEW_SECRET" \
    --dry-run=client -o yaml | kubectl apply -f -
  3. Restart deployment:

    Terminal window
    kubectl rollout restart deployment/trigra
  4. Update GitHub webhook with new secret