Skip to content

Commit

Permalink
test: config files
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed Oct 10, 2024
1 parent fe9e561 commit e6f1a4e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 49 deletions.
6 changes: 3 additions & 3 deletions infra/cdk8s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function main(): Promise<void> {
githubPat: '/eks/github/linz-li-bot/pat',

// Argo Database connection password
argoDbPassword: '/eks/argo/postgres/password',
//argoDbPassword: '/eks/argo/postgres/password',
}),
describeCluster(ClusterName),
]);
Expand Down Expand Up @@ -75,8 +75,8 @@ async function main(): Promise<void> {
clusterName: ClusterName,
saName: cfnOutputs[CfnOutputKeys.ArgoRunnerServiceAccountName],
tempBucketName: ScratchBucketName,
argoDbEndpoint: cfnOutputs[CfnOutputKeys.ArgoDbEndpoint],
argoDbPassword: ssmConfig.argoDbPassword,
// argoDbEndpoint: cfnOutputs[CfnOutputKeys.ArgoDbEndpoint],
// argoDbPassword: ssmConfig.argoDbPassword,
});

new ArgoExtras(app, 'argo-extras', {
Expand Down
75 changes: 37 additions & 38 deletions infra/charts/argo.workflows.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Chart, ChartProps, Duration, Helm } from 'cdk8s';
import { Secret } from 'cdk8s-plus-30';
import { Construct } from 'constructs';

import { ArgoDbName, ArgoDbUser, DefaultRegion } from '../constants.js';
import { DefaultRegion } from '../constants.js';
import { applyDefaultLabels } from '../util/labels.js';

export interface ArgoWorkflowsProps {
Expand All @@ -24,18 +23,18 @@ export interface ArgoWorkflowsProps {
* @example "Workflows"
*/
clusterName: string;
/**
* The Argo database endpoint
*
* @example "argodb-argodb4be14fa2-p8yjinijwbro.cmpyjhgv78aj.ap-southeast-2.rds.amazonaws.com"
*/
argoDbEndpoint: string;
/**
* The Argo database password
*
* @example "eighoo5room0aeM^ahz0Otoh4aakiipo"
*/
argoDbPassword: string;
// /**
// * The Argo database endpoint
// *
// * @example "argodb-argodb4be14fa2-p8yjinijwbro.cmpyjhgv78aj.ap-southeast-2.rds.amazonaws.com"
// */
// argoDbEndpoint: string;
// /**
// * The Argo database password
// *
// * @example "eighoo5room0aeM^ahz0Otoh4aakiipo"
// */
// argoDbPassword: string;
}

/**
Expand Down Expand Up @@ -72,29 +71,29 @@ export class ArgoWorkflows extends Chart {
},
};

const argoDbSecret = new Secret(this, 'argo-postgres-config', {});
argoDbSecret.addStringData('username', ArgoDbUser);
argoDbSecret.addStringData('password', props.argoDbPassword);
// const argoDbSecret = new Secret(this, 'argo-postgres-config', {});
// argoDbSecret.addStringData('username', ArgoDbUser);
// argoDbSecret.addStringData('password', props.argoDbPassword);

const persistence = {
connectionPool: {
maxIdleConns: 100,
maxOpenConns: 0,
},
nodeStatusOffLoad: true,
archive: true,
archiveTTL: '', // never expire archived workflows
postgresql: {
host: props.argoDbEndpoint,
port: 5432,
database: ArgoDbName,
tableName: 'argo_workflows',
userNameSecret: { name: argoDbSecret.name, key: 'username' },
passwordSecret: { name: argoDbSecret.name, key: 'password' },
ssl: true,
sslMode: 'require',
},
};
// const persistence = {
// connectionPool: {
// maxIdleConns: 100,
// maxOpenConns: 0,
// },
// nodeStatusOffLoad: true,
// archive: true,
// archiveTTL: '', // never expire archived workflows
// postgresql: {
// host: props.argoDbEndpoint,
// port: 5432,
// database: ArgoDbName,
// tableName: 'argo_workflows',
// userNameSecret: { name: argoDbSecret.name, key: 'username' },
// passwordSecret: { name: argoDbSecret.name, key: 'password' },
// ssl: true,
// sslMode: 'require',
// },
// };

const DefaultNodeSelector = {
'eks.amazonaws.com/capacityType': 'ON_DEMAND',
Expand Down Expand Up @@ -131,7 +130,7 @@ export class ArgoWorkflows extends Chart {
extraArgs: [],
// FIXME: workaround for https://github.com/argoproj/argo-workflows/issues/11657
extraEnv: [{ name: 'WATCH_CONTROLLER_SEMAPHORE_CONFIGMAPS', value: 'false' }],
persistence,
// persistence,
replicas: 2,
workflowDefaults: {
spec: {
Expand All @@ -157,7 +156,7 @@ export class ArgoWorkflows extends Chart {
},
},
workflow: {
rbac: { create: true },
//rbac: { create: true },
serviceAccount: { create: false, name: props.saName },
},
},
Expand Down
16 changes: 8 additions & 8 deletions infra/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
export const ClusterName = 'WorkflowsNP';
/** LINZ conventional name for Argo Workflows artifact bucket */
export const ScratchBucketName = `linz-${ClusterName.toLowerCase()}-scratch`;
/** Argo Database Instance name */
export const ArgoDbInstanceName = 'ArgoDb';
/** Argo Database name */
export const ArgoDbName = 'argo';
/** Argo Database user */
export const ArgoDbUser = 'argo_user';
/** AWS default region for our stack */
// /** Argo Database Instance name */
// export const ArgoDbInstanceName = 'ArgoDb';
// /** Argo Database name */
// export const ArgoDbName = 'argo';
// /** Argo Database user */
// export const ArgoDbUser = 'argo_user';
// /** AWS default region for our stack */
export const DefaultRegion = 'ap-southeast-2';

/**
Expand All @@ -22,7 +22,7 @@ export const UseNodeLocalDns = true;
export const CfnOutputKeys = {
ClusterEndpoint: 'ClusterEndpoint',

ArgoDbEndpoint: 'ArgoDbEndpoint',
// ArgoDbEndpoint: 'ArgoDbEndpoint',

KarpenterServiceAccountName: 'KarpenterServiceAccountName',
KarpenterServiceAccountRoleArn: 'KarpenterServiceAccountRoleArn',
Expand Down

0 comments on commit e6f1a4e

Please sign in to comment.