Skip to content

Commit

Permalink
Add log passthrough support
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Feb 6, 2024
1 parent 0cf4885 commit 83f6b1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ driver:
certManagerIssuer: lets-encrypt
k8sDelay: 1000
k8sRetries: 10
logPassthrough: true
```
- `registry` is the Docker Registry to load Stack Containers from
Expand All @@ -32,6 +33,7 @@ AWS EKS specific annotation for ALB Ingress.
- `certManagerIssuer` name of the ClusterIssuer to use to create HTTPS certs for instances (default not set)
- `k8sRetries` how many times to retry actions against the K8s API
- `k8sDelay` how long to wait (in ms) between retries to the K8s API
- `logPassthrough` Have Node-RED logs printed in JSON format to container stdout (default false)

Expects to pick up K8s credentials from the environment

Expand Down
5 changes: 5 additions & 0 deletions kubernetes.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ const createDeployment = async (project, options) => {
localPod.spec.containers[0].env.push({ name: 'FORGE_NR_SECRET', value: credentialSecret })
}

if (this._logPassthrough) {
localPod.spec.containers[0].env.push({ name: "FORGE_LOG_PASSTHROUGH", value: "true" })

Check failure on line 286 in kubernetes.js

View workflow job for this annotation

GitHub Actions / build / build (16.x)

Strings must use singlequote

Check failure on line 286 in kubernetes.js

View workflow job for this annotation

GitHub Actions / build / build (16.x)

Strings must use singlequote
}

if (this._app.config.driver.options.projectSelector) {
localPod.spec.nodeSelector = this._app.config.driver.options.projectSelector
}
Expand Down Expand Up @@ -606,6 +610,7 @@ module.exports = {
this._k8sDelay = this._app.config.driver.options.k8sDelay || 1000
this._k8sRetries = this._app.config.driver.options.k8sRetries || 10
this._certManagerIssuer = this._app.config.driver.options.certManagerIssuer
this._logPassthrough = this._app.config.driver.options.logPassthrough || false

const kc = new k8s.KubeConfig()

Expand Down

0 comments on commit 83f6b1c

Please sign in to comment.