-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f905657
commit b4583b1
Showing
5 changed files
with
4,213 additions
and
969 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { App } from 'cdk8s'; | ||
|
||
|
||
const app = new App(); | ||
|
||
async function main(): Promise<void> { | ||
// const ns = new NamespaceChart(app, 'namespace', { namespace: 'argo' }); | ||
|
||
// const fluentBit = new FluentBit(app, 'fluentBit', {}); | ||
// fluentBit.addDependency(ns); | ||
// app.synth(); | ||
// } | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {Chart} from 'cdk8s' | ||
|
||
export class ArgoSemaphore extends Chart { | ||
constructor( | ||
Check failure on line 4 in config/charts/argo.semaphores.ts GitHub Actions / Format & Deploy(master)
|
||
scope: Construct, | ||
id: string, | ||
props: ChartProps, | ||
){ | ||
|
||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
mport { getGitBuildInfo } from "./build"; | ||
|
||
|
||
/** | ||
* Generate a collection of standard labels for all components | ||
* @param name The name of the application | ||
* @param version The current version of the application | ||
* @param component The component within the architecture | ||
* @param partOf The name of a higher level application this one is part of | ||
* @returns labels in the form of `app.kubernetes.io/name` | ||
*/ | ||
export function defaultLabels( | ||
name: string, | ||
version: string, | ||
component: string, | ||
partOf: string, | ||
): Record<string, string> { | ||
return { | ||
'app.kubernetes.io/name': name, | ||
// Force a `v` prefix so the yaml doesn't consider it a number | ||
'app.kubernetes.io/version': version.startsWith('v') ? version : `v${version}`, | ||
'app.kubernetes.io/component': component, | ||
'app.kubernetes.io/part-of': partOf, | ||
'app.kubernetes.io/managed-by': 'cdk8s', | ||
'app.kubernetes.io/git-hash': getGitBuildInfo().hash, | ||
'app.kubernetes.io/git-version': getGitBuildInfo().version, | ||
'app.kubernetes.io/build-id': getGitBuildInfo().buildId, | ||
}; | ||
} | ||
|
||
/** | ||
* Generate and apply a collection of standard labels for all components | ||
* @param name The name of the application | ||
* @param version The current version of the application | ||
* @param component The component within the architecture | ||
* @param partOf The name of a higher level application this one is part of | ||
* | ||
* @returns labels in the form of `app.kubernetes.io/name` | ||
*/ | ||
export function applyDefaultLabels<T extends { labels?: Record<string, string> }>( | ||
props: T, | ||
name: string, | ||
version: string, | ||
component: string, | ||
partOf: string, | ||
): T { | ||
return { | ||
...props, | ||
labels: { | ||
...props.labels, | ||
...defaultLabels(name, version, component, partOf), | ||
}, | ||
}; | ||
} |
Oops, something went wrong.