Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log passthrough support #136

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' })
}

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
Loading