Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

feat: kosko v2 #363

Merged
merged 61 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
360601d
generate yaml with create_db
gary-van-woerkens Jul 19, 2020
ed55b9a
add toml parser
gary-van-woerkens Jul 19, 2020
e3fb042
[skip ci] WIP: trying to trigger kosko generate from function call
gary-van-woerkens Jul 20, 2020
ab1e0e9
wip
Jul 24, 2020
e26560d
wip
Jul 24, 2020
d18be1e
wip
Jul 24, 2020
9c61802
progrss
Jul 24, 2020
eb777f0
progress
Jul 24, 2020
4e84b91
progress
Jul 24, 2020
e5ad489
progress
Jul 24, 2020
5988f4c
progress
Jul 25, 2020
e4d8ef4
simpler DB
Jul 25, 2020
6ec3620
add prod env files
Jul 25, 2020
655842c
cleanup
Jul 25, 2020
509d6d4
use registered images
Jul 25, 2020
a0b9089
add pg user to pgweb+hasura
Jul 25, 2020
7ed0eb2
cleanup
Jul 25, 2020
1b45142
fix module mode
Jul 27, 2020
ac8e184
update kosko-charts
Jul 27, 2020
c37bc2f
fix dev/app.sealed-secret.yaml
Jul 27, 2020
79e03b5
use @socialgouv/kosko-charts:v2.0.0-alpha.13
Jul 27, 2020
9862b7e
lock: use @socialgouv/kosko-charts:v2.0.0-alpha.13
Jul 27, 2020
674f70e
fix dev/*.sealed-secret.yaml
Jul 27, 2020
60bc52e
fix: use default images names
Jul 27, 2020
d5eea8d
fix: update pg admin secrets
Jul 27, 2020
09f5be6
fix: update pg admin secrets
Jul 27, 2020
37e6510
fix: update pg admin secrets
Jul 27, 2020
796af74
fix: update pg admin secrets
Jul 27, 2020
b365a53
fix: update pg admin secrets
Jul 27, 2020
4f40672
fix: update pg admin secrets
Jul 27, 2020
d43cd8b
fix: azure secrets
Jul 27, 2020
364a301
fix: FRONTEND_PORT
Jul 27, 2020
ed60603
fix: ACCOUNT_EMAIL_WEBHOOK_URL HASURA_GRAPHQL_JWT_SECRET
Jul 27, 2020
80da313
fix: increase hasura probe delays
Jul 27, 2020
93de6a4
fix: increase hasura probe delays
Jul 27, 2020
2cceb33
fix: fix hasura secret
Jul 27, 2020
e8483cf
fix: up @socialgouv/kosko-charts:v2.0.0-alpha.14
Jul 27, 2020
ccdc9e9
WORKIN
Jul 27, 2020
56c76f1
fix: up @socialgouv/kosko-charts:v2.0.0-alpha.15
Jul 28, 2020
98976d4
fix: use components/hasura
Jul 28, 2020
83c6caa
fix: up @socialgouv/kosko-charts:v2.0.0-alpha.16
Jul 28, 2020
c261d8e
fix: move pgweb and azure-pg to dev only
Jul 28, 2020
f5096bb
fix: up @socialgouv/kosko-charts:v2.0.0-alpha.17
Jul 28, 2020
7e0cdfd
fix: up @socialgouv/kosko-charts:v2.0.0-alpha.18
Jul 28, 2020
8224bb8
upgrade kosko-charts
Jul 29, 2020
63ddc76
upgrade kosko-charts
Jul 29, 2020
b9f7d22
build(k8s): add typing help
douglasduteil Jul 29, 2020
8733a23
fix(k8s): update @socialgouv/kosko-charts to 2.0.0-alpha.23
douglasduteil Jul 29, 2020
a88cd0b
fix(k8s): rename _azure-pg to _pg
douglasduteil Jul 29, 2020
7604c6c
build(pgweb): remove hard coded url
douglasduteil Jul 29, 2020
5361250
fix(k8s): update @socialgouv/kosko-charts to 2.0.0-alpha.24
douglasduteil Jul 29, 2020
9f922d1
fix(k8s): update @socialgouv/kosko-charts to 2.0.0-alpha.26
douglasduteil Jul 29, 2020
8054aa2
rename pg secrets
Jul 29, 2020
5768603
upgrade kosko-charts, small fixes
Jul 29, 2020
248110e
fix: use @socialgouv/kosko-charts:2.0.0-alpha.27
Jul 29, 2020
79ac315
fix: use @socialgouv/kosko-charts:2.0.0-alpha.28
Jul 29, 2020
1df2989
build(k8s): add subDomainPrefix
douglasduteil Jul 29, 2020
3d975ef
build(k8s): symlink the dev and preprod env
douglasduteil Jul 29, 2020
442aa9c
feat: add prod/pg.sealed-secret.yaml
Jul 29, 2020
a5b6ca8
feat: add prod/pg.sealed-secret.yaml
Jul 29, 2020
a33da16
fix: remove envs/local
Jul 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ Test:
rules:
- when: never

Register image:
extends: .autodevops_register_image
variables:
IMAGE_NAME: $CI_REGISTRY_IMAGE/app

Register image Hasura:
extends: .autodevops_register_image
dependencies: []
Expand Down
40 changes: 0 additions & 40 deletions .k8s/app.values.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .k8s/components/.drop-db.ts

This file was deleted.

8 changes: 3 additions & 5 deletions .k8s/components/_namespace.ts
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;
12 changes: 12 additions & 0 deletions .k8s/components/_pg.ts
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;
45 changes: 45 additions & 0 deletions .k8s/components/_pgweb.ts
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;
81 changes: 17 additions & 64 deletions .k8s/components/app.ts
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;
33 changes: 0 additions & 33 deletions .k8s/components/azure-pg-admin-user.sealed-secret.ts

This file was deleted.

17 changes: 0 additions & 17 deletions .k8s/components/create-db.ts

This file was deleted.

Loading