Skip to content

Commit

Permalink
chore(server): add labels to ingress resources (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow authored Nov 8, 2023
1 parent 103c3bd commit 4afea1e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
5 changes: 3 additions & 2 deletions server/src/gateway/ingress/bucket-ingress.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ export class BucketGatewayService {
metadata: {
name,
namespace,
annotations: {
labels: {
[LABEL_KEY_APP_ID]: appid,
'laf.dev/bucket.name': domain.bucketName,
'laf.dev/ingress.type': 'bucket',
},
annotations: {
// apisix ingress annotations
'k8s.apisix.apache.org/cors-expose-headers': '*',
'k8s.apisix.apache.org/svc-namespace': namespace,

// k8s nginx ingress annotations
// websocket is enabled by default in k8s nginx ingress
Expand Down
5 changes: 3 additions & 2 deletions server/src/gateway/ingress/runtime-ingress.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ export class RuntimeGatewayService {
metadata: {
name,
namespace,
annotations: {
labels: {
[LABEL_KEY_APP_ID]: appid,
'laf.dev/ingress.type': 'runtime',
},
annotations: {
// apisix ingress annotations
'k8s.apisix.apache.org/enable-websocket': 'true',
'k8s.apisix.apache.org/svc-namespace': namespace,

// k8s nginx ingress annotations
// websocket is enabled by default in k8s nginx ingress
Expand Down
6 changes: 1 addition & 5 deletions server/src/gateway/ingress/website-ingress.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,10 @@ export class WebsiteHostingGatewayService {
metadata: {
name,
namespace,
annotations: {
labels: {
[LABEL_KEY_APP_ID]: appid,
'laf.dev/bucket.name': website.bucketName,
'laf.dev/ingress.type': 'website',
// apisix ingress annotations
'k8s.apisix.apache.org/svc-namespace': namespace,

// k8s nginx ingress annotations
},
},
spec: { ingressClassName, rules: [rule], tls },
Expand Down
13 changes: 0 additions & 13 deletions server/src/instance/instance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ export class InstanceService {
public async create(appid: string) {
const app = await this.applicationService.findOneUnsafe(appid)
const labels: Record<string, string> = this.getRuntimeLabel(appid)
// const region = app.region

// // Although a namespace has already been created during application creation,
// // we still need to check it again here in order to handle situations where the cluster is rebuilt.
// const namespace = await this.cluster.getAppNamespace(region, appid)
// if (!namespace) {
// this.logger.debug(`Creating namespace for application ${appid}`)
// await this.cluster.createAppNamespace(
// region,
// appid,
// app.createdBy.toString(),
// )
// }

// ensure deployment created
const res = await this.get(app.appid)
Expand Down

0 comments on commit 4afea1e

Please sign in to comment.