Skip to content

Commit

Permalink
Merge pull request #136 from FlowFuse/log-passthrough
Browse files Browse the repository at this point in the history
Add log passthrough support
  • Loading branch information
hardillb authored Feb 12, 2024
2 parents 0cf4885 + 3cb2c99 commit 35c1d50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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
13 changes: 9 additions & 4 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' })
}

if (this._app.config.driver.options.projectSelector) {
localPod.spec.nodeSelector = this._app.config.driver.options.projectSelector
}
Expand Down Expand Up @@ -602,10 +606,11 @@ module.exports = {
this._projects = {}
this._options = options

this._namespace = this._app.config.driver.options.projectNamespace || 'flowforge'
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._namespace = this._app.config.driver.options?.projectNamespace || 'flowforge'
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 35c1d50

Please sign in to comment.