Add unified logs platform with Helm-managed central Elasticsearch.

Deploy cloudhost-logging on cluster registration, ship app and optional service logs to ES with owner isolation, and fix Kibana 8.12 auth via kibana_system.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-15 15:56:33 +03:30
parent 2303985d0c
commit 35dd771f63
31 changed files with 1657 additions and 938 deletions
+6 -2
View File
@@ -1,12 +1,16 @@
import { Module } from '@nestjs/common';
import { Module, forwardRef } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ClustersService } from './clusters.service';
import { ClustersController } from './clusters.controller';
import { Cluster } from './entities/cluster.entity';
import { ClusterPool } from './entities/cluster-pool.entity';
import { KubernetesModule } from '../kubernetes/kubernetes.module';
@Module({
imports: [TypeOrmModule.forFeature([Cluster, ClusterPool])],
imports: [
TypeOrmModule.forFeature([Cluster, ClusterPool]),
forwardRef(() => KubernetesModule),
],
controllers: [ClustersController],
providers: [ClustersService],
exports: [ClustersService],
+9 -1
View File
@@ -1,4 +1,4 @@
import { Injectable, NotFoundException, Logger, BadRequestException } from '@nestjs/common';
import { Injectable, NotFoundException, Logger, BadRequestException, Inject, forwardRef } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { ConfigService } from '@nestjs/config';
import { Repository, DataSource, In } from 'typeorm';
@@ -8,6 +8,7 @@ import { ClusterPool } from './entities/cluster-pool.entity';
import { CreateClusterDto, UpdateClusterDto } from './dto/cluster.dto';
import { CreateClusterPoolDto, UpdateClusterPoolDto } from './dto/cluster-pool.dto';
import { ClusterStatus } from '../common/enums';
import { ElasticsearchService } from '../kubernetes/elasticsearch.service';
@Injectable()
export class ClustersService {
@@ -22,6 +23,8 @@ export class ClustersService {
private poolsRepository: Repository<ClusterPool>,
private dataSource: DataSource,
private configService: ConfigService,
@Inject(forwardRef(() => ElasticsearchService))
private elasticsearchService: ElasticsearchService,
) {}
/**
@@ -81,6 +84,11 @@ export class ClustersService {
this.logger.error(`Failed to bootstrap cluster "${saved.name}": ${err.message}`);
});
// Deploy central logging (Elasticsearch + Kibana) via Helm
this.elasticsearchService.deploy(saved.id).catch((err) => {
this.logger.error(`Failed to deploy central logging on "${saved.name}": ${err.message}`);
});
return saved;
}