This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Gary van Woerkens <[email protected]> Co-authored-by: Douglas Duteil <[email protected]>
- Loading branch information
1 parent
866e53c
commit 7f41655
Showing
46 changed files
with
322 additions
and
737 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { create } from "@socialgouv/kosko-charts/components/namespace"; | ||
import env from "@kosko/env"; | ||
import { createNamespace } from "@socialgouv/kosko-charts/utils/createNamespace"; | ||
|
||
const params = env.component("namespace"); | ||
const { namespace } = create(params); | ||
const manifests = createNamespace(); | ||
|
||
export default [namespace]; | ||
export default manifests; |
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,12 @@ | ||
import env from "@kosko/env"; | ||
import { ok } from "assert"; | ||
|
||
import { create } from "@socialgouv/kosko-charts/components/azure-pg"; | ||
|
||
let params = env.component("pg"); | ||
|
||
const manifests = create({ | ||
env, | ||
}); | ||
|
||
export default manifests; |
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,45 @@ | ||
import env from "@kosko/env"; | ||
import { ok } from "assert"; | ||
import { Deployment } from "kubernetes-models/apps/v1/Deployment"; | ||
|
||
import { create } from "@socialgouv/kosko-charts/components/app"; | ||
import { addPostgresUserSecret } from "@socialgouv/kosko-charts/utils/addPostgresUserSecret"; | ||
import { addWaitForPostgres } from "@socialgouv/kosko-charts/utils/addWaitForPostgres"; | ||
|
||
const manifests = create("pgweb", { | ||
env, | ||
config: { | ||
image: "sosedoff/pgweb:latest", | ||
containerPort: 8081, | ||
subDomainPrefix: "pgweb-", | ||
}, | ||
deployment: { | ||
container: { | ||
livenessProbe: { | ||
httpGet: { | ||
path: "/", | ||
port: "http", | ||
}, | ||
initialDelaySeconds: 5, | ||
timeoutSeconds: 3, | ||
}, | ||
readinessProbe: { | ||
httpGet: { | ||
path: "/", | ||
port: "http", | ||
}, | ||
initialDelaySeconds: 5, | ||
timeoutSeconds: 3, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
// DEV: add secret to access DB | ||
const deployment = manifests.find( | ||
(manifest): manifest is Deployment => manifest.kind === "Deployment" | ||
); | ||
ok(deployment); | ||
addPostgresUserSecret(deployment); | ||
addWaitForPostgres(deployment); | ||
export default manifests; |
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 |
---|---|---|
@@ -1,71 +1,24 @@ | ||
import { ok } from "assert"; | ||
import { create } from "@socialgouv/kosko-charts/components/app"; | ||
import { metadataFromParams } from "@socialgouv/kosko-charts/components/app/metadata"; | ||
import env from "@kosko/env"; | ||
import { addToEnvFrom } from "@socialgouv/kosko-charts/utils/addToEnvFrom"; | ||
import { ConfigMap } from "kubernetes-models/v1/ConfigMap"; | ||
import { EnvFromSource } from "kubernetes-models/v1/EnvFromSource"; | ||
import { SealedSecret } from "@kubernetes-models/sealed-secrets/bitnami.com/v1alpha1/SealedSecret"; | ||
import { loadYaml } from "../getEnvironmentComponent"; | ||
|
||
ok(process.env.CI_COMMIT_SHORT_SHA, "Expect CI_COMMIT_SHORT_SHA to be defined"); | ||
|
||
const params = env.component("app"); | ||
const { deployment, ingress, service } = create(params); | ||
import { create } from "@socialgouv/kosko-charts/components/app"; | ||
|
||
const secret = new SealedSecret({ | ||
...loadYaml(env, "app-env.sealed-secret.yaml"), | ||
metadata: { | ||
...metadataFromParams(params), | ||
name: `app-env`, | ||
annotations: { | ||
"sealedsecrets.bitnami.com/cluster-wide": "true", | ||
const manifests = create("app", { | ||
env, | ||
config: { containerPort: 3030 }, | ||
deployment: { | ||
container: { | ||
resources: { | ||
requests: { | ||
cpu: "1m", | ||
memory: "64Mi", | ||
}, | ||
limits: { | ||
cpu: "50m", | ||
memory: "128Mi", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
const configMap = new ConfigMap({ | ||
...loadYaml(env, "app-env.configmap.yaml"), | ||
metadata: { | ||
...metadataFromParams(params), | ||
name: `app-env`, | ||
}, | ||
data: { | ||
FRONTEND_HOST: ingress.spec!.rules![0].host!, | ||
}, | ||
}); | ||
|
||
// | ||
|
||
const secretSource = new EnvFromSource({ | ||
secretRef: { | ||
name: `app-env`, | ||
}, | ||
}); | ||
|
||
const configMapSource = new EnvFromSource({ | ||
configMapRef: { | ||
name: `app-env`, | ||
}, | ||
}); | ||
|
||
addToEnvFrom({ | ||
deployment, | ||
data: [secretSource, configMapSource], | ||
}); | ||
|
||
if (process.env.ENABLE_AZURE_POSTGRES) { | ||
const azureSecretSource = new EnvFromSource({ | ||
secretRef: { | ||
name: `azure-pg-user-${process.env.CI_COMMIT_SHORT_SHA}`, | ||
}, | ||
}); | ||
addToEnvFrom({ | ||
deployment, | ||
data: [azureSecretSource], | ||
}); | ||
} | ||
|
||
// | ||
|
||
export default [secret, configMap, deployment, ingress, service]; | ||
export default manifests; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.