33import * as k8s from '@pulumi/kubernetes' ;
44import {
55 appsAffinityAndTolerations ,
6- CloudPostgres ,
76 DOCKER_REPO ,
8- ExactNamespace ,
97 HELM_MAX_HISTORY_SIZE ,
108 imagePullSecretByNamespaceNameForServiceAccount ,
119 infraAffinityAndTolerations ,
@@ -20,7 +18,6 @@ import yaml from 'js-yaml';
2018
2119import { createCachePvc } from './cache' ;
2220import { ghaConfig } from './config' ;
23- import { createCloudSQLInstanceForPerformanceTests } from './performanceTests' ;
2421
2522type ResourcesSpec = {
2623 requests ?: {
@@ -406,8 +403,7 @@ function installK8sRunnerScaleSet(
406403 cachePvcName : string ,
407404 resources : ResourcesSpec ,
408405 serviceAccountName : string ,
409- dependsOn : Resource [ ] ,
410- performanceTestsDb : CloudPostgres
406+ dependsOn : Resource [ ]
411407) : Release {
412408 const podConfigMapName = `${ name } -pod-config` ;
413409 // A configMap that will be mounted to runner pods and provide additional pod spec for the workflow pods
@@ -538,21 +534,6 @@ function installK8sRunnerScaleSet(
538534 name : 'ACTIONS_RUNNER_CONTAINER_HOOK_TEMPLATE' ,
539535 value : '/pod.yaml' ,
540536 } ,
541- {
542- name : 'PERFORMANCE_TESTS_DB_HOST' ,
543- value : performanceTestsDb . address ,
544- } ,
545- {
546- name : 'PERFORMANCE_TESTS_DB_USER' ,
547- value : 'cnadmin' ,
548- } ,
549- {
550- name : 'PERFORMANCE_TESTS_DB_PASSWORD' ,
551- valueFrom : {
552- key : 'postgresPassword' ,
553- name : performanceTestsDb . secretName ,
554- } ,
555- } ,
556537 ] ,
557538 volumeMounts : [
558539 {
@@ -720,10 +701,9 @@ function installK8sRunnerScaleSets(
720701 runnersNamespace : Namespace ,
721702 tokenSecret : Secret ,
722703 cachePvcName : string ,
723- serviceAccountName : string ,
724- performanceTestsDb : CloudPostgres
704+ serviceAccountName : string
725705) : void {
726- const dependsOn = [ controller , runnersNamespace , tokenSecret , performanceTestsDb ] ;
706+ const dependsOn = [ controller , runnersNamespace , tokenSecret ] ;
727707
728708 runnerSpecs
729709 . filter ( spec => spec . k8s )
@@ -735,8 +715,7 @@ function installK8sRunnerScaleSets(
735715 cachePvcName ,
736716 spec . resources ,
737717 serviceAccountName ,
738- dependsOn ,
739- performanceTestsDb
718+ dependsOn
740719 ) ;
741720 } ) ;
742721}
@@ -775,17 +754,12 @@ function installPodMonitor(runnersNamespace: Namespace) {
775754 ) ;
776755}
777756
778- const GHA_NAMESPACE_NAME = 'gha-runners' ;
779757export function installRunnerScaleSets ( controller : k8s . helm . v3 . Release ) : void {
780- const runnersNamespace = new Namespace ( GHA_NAMESPACE_NAME , {
758+ const runnersNamespace = new Namespace ( 'gha-runners' , {
781759 metadata : {
782- name : GHA_NAMESPACE_NAME ,
760+ name : 'gha-runners' ,
783761 } ,
784762 } ) ;
785- const exactNs : ExactNamespace = {
786- ns : runnersNamespace ,
787- logicalName : GHA_NAMESPACE_NAME ,
788- } ;
789763
790764 const tokenSecret = new k8s . core . v1 . Secret (
791765 'gh-access-token' ,
@@ -817,15 +791,7 @@ export function installRunnerScaleSets(controller: k8s.helm.v3.Release): void {
817791 const saName = 'k8s-runners' ;
818792 installRunnersServiceAccount ( runnersNamespace , saName ) ;
819793
820- const performanceTestsDb = createCloudSQLInstanceForPerformanceTests ( exactNs ) ;
821794 installDockerRunnerScaleSets ( controller , runnersNamespace , tokenSecret , cachePvc , saName ) ;
822- installK8sRunnerScaleSets (
823- controller ,
824- runnersNamespace ,
825- tokenSecret ,
826- cachePvcName ,
827- saName ,
828- performanceTestsDb
829- ) ;
795+ installK8sRunnerScaleSets ( controller , runnersNamespace , tokenSecret , cachePvcName , saName ) ;
830796 installPodMonitor ( runnersNamespace ) ;
831797}
0 commit comments