Skip to content

Commit

Permalink
refactor: default service type to ClusterIP (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
omBratteng authored Jan 15, 2025
1 parent 8864591 commit 8350ac5
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 76 deletions.
135 changes: 73 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
"dependencies": {
"@google-cloud/pubsub": "^4.9.0",
"@pulumi/gcp": "^8.13.1",
"@pulumi/kubernetes": "^4.19.0",
"@pulumi/kubernetes": "^4.20.0",
"@pulumi/pulumi": "^3.145.0",
"knex": "^3.1.0",
"mysql": "^2.18.1",
"pg": "^8.13.1",
"yaml": "^2.7.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.2",
"prettier": "^3.4.2",
"typescript": "^5.7.3"
}
Expand Down
2 changes: 1 addition & 1 deletion src/k8s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export const createAutoscaledExposedApplication = ({
serviceTimeout,
shouldCreatePDB = true,
provider,
serviceType = 'NodePort',
serviceType = 'ClusterIP',
strategy = {
type: 'RollingUpdate',
rollingUpdate: {
Expand Down
8 changes: 2 additions & 6 deletions src/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ function deployApplication(
imageTag,
containerOpts,
provider,
vpcNative,
isAdhocEnv,
}: ApplicationContext,
{
Expand Down Expand Up @@ -336,7 +335,7 @@ function deployApplication(
if (shouldCreateService) {
return createAutoscaledExposedApplication({
...appArgs,
serviceType: vpcNative ? 'ClusterIP' : serviceType,
serviceType,
enableCdn,
serviceTimeout,
backendConfig,
Expand All @@ -361,7 +360,6 @@ export function deployApplicationSuiteToProvider({
apps,
provider,
resourcePrefix = '',
vpcNative = false,
migration,
migrations,
debezium,
Expand Down Expand Up @@ -482,7 +480,6 @@ export function deployApplicationSuiteToProvider({
imageTag,
image,
provider,
vpcNative,
isAdhocEnv,
};
// Deploy the applications
Expand Down Expand Up @@ -514,7 +511,7 @@ export function deployApplicationSuiteToProvider({
export function deployApplicationSuite(
suite: Omit<
ApplicationSuiteArgs,
'provider' | 'resourcePrefix' | 'vpcNative' | 'shouldBindIamUser'
'provider' | 'resourcePrefix' | 'shouldBindIamUser'
>,
vpcNativeProvider?: GkeCluster,
): ApplicationReturn[][] {
Expand All @@ -531,7 +528,6 @@ export function deployApplicationSuite(
shouldBindIamUser: true,
provider: (vpcNativeProvider || getVpcNativeCluster()).provider,
resourcePrefix: 'vpc-native-',
vpcNative: true,
});
return [vpcNativeApps];
}
Expand Down
2 changes: 0 additions & 2 deletions src/suite/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export type ApplicationSuiteArgs = {
apps: ApplicationArgs[];
provider?: ProviderResource;
resourcePrefix?: string;
vpcNative?: boolean;
migration?: MigrationArgs;
migrations?: { [key: string]: MigrationArgs };
debezium?: DebeziumArgs;
Expand All @@ -128,6 +127,5 @@ export type ApplicationContext = {
imageTag: string;
containerOpts: ContainerOptions;
provider?: ProviderResource;
vpcNative: boolean;
isAdhocEnv?: boolean;
};

0 comments on commit 8350ac5

Please sign in to comment.