Skip to content

Commit

Permalink
feat(server): add sealos manager labels to rumtime manifest(#1577)
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 authored Oct 12, 2023
1 parent 14540c1 commit f71ea31
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions server/src/instance/instance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class InstanceService {

public async create(appid: string) {
const app = await this.applicationService.findOneUnsafe(appid)
const labels = { [LABEL_KEY_APP_ID]: appid }
const labels = this.getRuntimeLabel(appid)
// const region = app.region

// // Although a namespace has already been created during application creation,
Expand Down Expand Up @@ -557,10 +557,21 @@ export class InstanceService {
hpa,
)
} else {
const labels = { [LABEL_KEY_APP_ID]: appid }
const labels = this.getRuntimeLabel(appid)
await this.createHorizontalPodAutoscaler(app, labels)
}
this.logger.log(`reapply k8s hpa ${app.appid}`)
}
}

private getRuntimeLabel(appid: string) {
const SEALOS = 'cloud.sealos.io/app-deploy-manager'
const labels = {
[LABEL_KEY_APP_ID]: appid,
[SEALOS]: appid,
app: appid,
}

return labels
}
}

0 comments on commit f71ea31

Please sign in to comment.