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 a healthcheck to the companion #5634

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions packages/@uppy/companion/KUBERNETES.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ spec:
name: companion-env
ports:
- containerPort: 3020
readinessProbe:
httpGet:
path: /health
port: 3020
initialDelaySeconds: 3
periodSeconds: 5
volumeMounts:
- name: companion-data
mountPath: /mnt/companion-data
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/companion/src/companion.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module.exports.app = (optionsArg = {}) => {
}

app.use(cookieParser()) // server tokens are added to cookies
app.get('/health', (req, res) => res.send('OK'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe in the future we want to send some json data here. so users should not expect an "OK" text here.

Suggested change
app.get('/health', (req, res) => res.send('OK'))
app.get('/health', (req, res) => res.end())

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was leaning towards just using /metrics for this Mikael, it’s a more trustworthy check, end we don’t need to introduce a second health-y endoint then

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that sounds good to me


app.use(interceptGrantErrorResponse)

Expand Down