Skip to content

Feature / Add healthcheck configuration #598

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

Merged
merged 2 commits into from
Jan 16, 2025
Merged
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: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ More [Screenshots](https://www.kubero.dev/docs/screenshots) and a full video on

## Features ([DEMO](https://demo.kubero.dev))
- Create unlimited CI/CD pipelines with up to 4 separate **staging environments** for all your applications
- Automatically build, start, and cleanup **review-apps** after opening/closing a pull request
- Automatically build, start, and cleanup **review-apps** after opening/closing a pull request (GitOps)
- Automatic **redeployment** of the app based on a push to a branch or tag
- Create scheduled tasks as **cronjobs**
- Deploy well known apps with **templates** [(WordPress, Grafana, ...)](https://www.kubero.dev/templates)
Expand All @@ -29,7 +29,9 @@ More [Screenshots](https://www.kubero.dev/docs/screenshots) and a full video on
- Comes with an **API and CLI** to integrate with your existing tools and CI/CD
- Built-in **container web console**
- Build and deployment **Notifications** to Discord/Slack/Webhooks
- Integrated **metrics and monitoring**
- Integrated application **metrics and monitoring**
- **Multi-tenancy** support
- Simple configuration of **Basic Auth** for your application
- **SSO** with GitHub and Oauth2


Expand Down
76 changes: 76 additions & 0 deletions client/src/components/apps/form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,68 @@
</v-row>
</v-expansion-panel-text>
</v-expansion-panel>

<!-- HEALTHCHECK -->
<v-expansion-panel bg-color="rgb(var(--v-theme-on-surface-variant))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel-title class="text-uppercase text-caption-2 font-weight-medium" color="secondary">Health check</v-expansion-panel-title>
<v-expansion-panel-text color="secondary">

<v-row>
<v-col
cols="12"
md="3"
>
<v-switch
v-model="healthcheck.enabled"
label="Health Check Enabled"
color="primary"
></v-switch>
</v-col>
</v-row>
<v-row>
<v-col
cols="12"
md="3"
>
<v-text-field
v-model="healthcheck.path"
label="Path"
:counter="60"
></v-text-field>
</v-col>
<v-col
cols="12"
md="3"
>
<v-text-field
v-model="healthcheck.startupSeconds"
label="Startup Seconds"
:counter="60"
></v-text-field>
</v-col>
<v-col
cols="12"
md="3"
>
<v-text-field
v-model="healthcheck.timeoutSeconds"
label="Timeout Seconds"
:counter="60"
></v-text-field>
</v-col>
<v-col
cols="12"
md="3"
>
<v-text-field
v-model="healthcheck.periodSeconds"
label="Interval Seconds"
:counter="60"
></v-text-field>
</v-col>
</v-row>
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>

<!-- ADDONS -->
Expand Down Expand Up @@ -1727,6 +1789,13 @@ export default defineComponent({
'SYSLOG',
'WAKE_ALARM',
],
healthcheck: {
enabled: true,
path: '/',
startupSeconds: 90,
timeoutSeconds: 30,
periodSeconds: 10,
},
nameRules: [
(v: any) => !!v || 'Name is required',
(v: any) => v.length <= 60 || 'Name must be less than 60 characters',
Expand Down Expand Up @@ -1846,6 +1915,10 @@ export default defineComponent({
this.cronjobs = response.data.cronjobs;
this.addons = response.data.addons;

if (this.healthcheck) {
this.healthcheck = response.data.healthcheck;
}

if (response.data.image.build) {
//console.log("buildpack build", response.data.image.build);
this.buildpack.build = response.data.image.build;
Expand Down Expand Up @@ -2094,6 +2167,7 @@ export default defineComponent({
this.addons= response.data.spec.addons || [];
this.security.vulnerabilityScans = response.data.spec.vulnerabilityscan.enabled;
this.ingress = response.data.spec.ingress || {};
this.healthcheck = response.data.spec.healthcheck || { enabled: true, path: '/', startupSeconds: 90, timeoutSeconds: 30, periodSeconds: 10 };

// iterate over ingress hosts and fill sslIndex
for (let i = 0; i < this.ingress.hosts.length; i++) {
Expand Down Expand Up @@ -2235,6 +2309,7 @@ export default defineComponent({
addons: this.addons,
security: this.security,
ingress: this.ingress,
healthcheck: this.healthcheck,
}

if (typeof postdata.image.run.securityContext.runAsUser === 'string') {
Expand Down Expand Up @@ -2333,6 +2408,7 @@ export default defineComponent({
addons: this.addons,
security: this.security,
ingress: this.ingress,
healthcheck: this.healthcheck,
}

if (postdata.image.run == undefined) {
Expand Down
10 changes: 10 additions & 0 deletions server/src/modules/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ export class App implements IApp{
};
private tolerations: [];

public healthcheck: {
enabled: boolean,
path: string,
startupSeconds: number,
timeoutSeconds: number,
periodSeconds: number,
};

constructor(
app: IApp
) {
Expand Down Expand Up @@ -236,6 +244,8 @@ export class App implements IApp{
type: 'ClusterIP'
},
this.tolerations= []

this.healthcheck = app.healthcheck
}
}

Expand Down
2 changes: 2 additions & 0 deletions server/src/routes/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ function createApp(req: Request) : IApp {
addons: req.body.addons,
resources: req.body.podsize.resources,
vulnerabilityscan: getVulnerabilityScan(req.body.security.vulnerabilityScans),
healthcheck: req.body.healthcheck,
};
normalizeAddonName(appconfig);

Expand Down Expand Up @@ -296,6 +297,7 @@ Router.put('/pipelines/:pipeline/:phase/:app', authMiddleware, async function (r
addons: req.body.addons,
resources: req.body.podsize.resources,
vulnerabilityscan: getVulnerabilityScan(req.body.security.vulnerabilityScans),
healthcheck: req.body.healthcheck,
};
// WARNING: renaming the addon will cause dataloss !!!
//normalizeAddonName(appconfig);
Expand Down
7 changes: 7 additions & 0 deletions server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ export interface IApp {
name: string,
},
//tolerations: [],
healthcheck: {
enabled: boolean,
path: string,
startupSeconds: number,
timeoutSeconds: number,
periodSeconds: number,
},
}


Expand Down