Skip to content

Commit 2af58aa

Browse files
committed
docs: show how to mount GitHub App private key in Kubernetes
BATON_APP_PRIVATEKEY_PATH was documented without showing how the key file actually gets onto the container filesystem. Add a Secret + volume mount example, consistent with the pattern already used in other connector docs.
1 parent 5d37fcd commit 2af58aa

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

docs/connector.mdx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ stringData:
387387
# GitHub credentials if configuring with a GitHub app
388388
BATON_APP_ID: <GitHub app ID>
389389
# Supply the private key one of two ways:
390-
BATON_APP_PRIVATEKEY_PATH: <Path to the private key file for the GitHub app>
390+
BATON_APP_PRIVATEKEY_PATH: /etc/baton-github/keys/private-key.pem
391391
# ...or pass the raw PEM contents directly (takes precedence when both are set):
392392
# BATON_APP_PRIVATEKEY: <Raw PEM contents of the private key for the GitHub app>
393393
BATON_ORGS: <Name of the single GitHib org the app was created for>
@@ -401,8 +401,21 @@ stringData:
401401
# Optional: enable for orgs with thousands of repos or members to reduce sync time.
402402
# See "Optimize sync for large organizations" below for trade-offs.
403403
BATON_DIRECT_COLLABORATORS_ONLY: true
404+
405+
---
406+
# baton-github-app-key-secret.yaml
407+
apiVersion: v1
408+
kind: Secret
409+
metadata:
410+
name: baton-github-app-key
411+
type: Opaque
412+
stringData:
413+
private-key.pem: |
414+
<Contents of the GitHub app's private key (.pem) file>
404415
```
405416
417+
If you're using `BATON_APP_PRIVATEKEY_PATH`, the private key must be mounted into the container as a file rather than passed as an environment variable. The manifest above stores the key in its own Secret so it can be mounted as a volume in the deployment configuration below. Set `BATON_APP_PRIVATEKEY_PATH` to the path where the key will be mounted. If you use `BATON_APP_PRIVATEKEY` instead, the raw PEM contents are passed directly and no volume mount is needed.
418+
406419
See the connector's README or run `--help` to see all available configuration flags and environment variables.
407420

408421
#### Deployment configuration
@@ -436,8 +449,18 @@ spec:
436449
envFrom:
437450
- secretRef:
438451
name: baton-github-secrets
452+
volumeMounts:
453+
- name: github-app-key
454+
mountPath: /etc/baton-github/keys
455+
readOnly: true
456+
volumes:
457+
- name: github-app-key
458+
secret:
459+
secretName: baton-github-app-key
439460
```
440461

462+
The `volumeMounts` and `volumes` entries above are only needed if you're configuring the connector with a GitHub app using `BATON_APP_PRIVATEKEY_PATH`. Omit them if you're using an access token or `BATON_APP_PRIVATEKEY` instead.
463+
441464
### Step 3: Deploy the connector
442465

443466
<Steps>

0 commit comments

Comments
 (0)