Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Commit

Permalink
Build new version of sentry-discord-webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasK33 committed Nov 20, 2020
1 parent 5d583ac commit f4c7efa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 21 deletions.
13 changes: 9 additions & 4 deletions devops/kubernetes/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class Fortify extends Chart {
name: "postgres-config",
},
data: {
POSTGRES_USER: "postgres",
POSTGRES_HOST: "postgres.postgres",
POSTGRES_PORT: "5432",
POSTGRES_DATABASE: "postgres",
Expand Down Expand Up @@ -86,7 +87,7 @@ export class Fortify extends Chart {

const vaultConfig = new ConfigMap(this, "vault-config", {
data: {
VAULT_ADDR: "https://vault.default:8200",
VAULT_ADDR: "http://vault.default:8200",
VAULT_ENVIRONMENT: `/${ENVIRONMENT}`,
},
});
Expand Down Expand Up @@ -204,6 +205,10 @@ export class Fortify extends Chart {
namespace: "fortify",
match: `Host(\`${DOMAIN}\`)`,
},

// TODO: Implement probes
livenessProbe: null,
readinessProbe: null,
});

new WebService(this, "gsi-receiver", {
Expand Down Expand Up @@ -239,7 +244,7 @@ export class Fortify extends Chart {
new WebService(this, "sentry-discord-webhook", {
name: "sentry-discord-webhook",
replicas: 1,
version: "1.0.0",
version: "1.1.0",
env: [
{ name: "LISTEN_ADDRESS", value: ":8080" },
{ name: "WEBHOOK_ENV", value: "prod" },
Expand All @@ -264,8 +269,8 @@ export class Fortify extends Chart {
new WebService(this, "sentry-discord-dev-webhook", {
name: "sentry-discord-dev-webhook",
replicas: 1,
version: "1.0.0",
image: REGISTRY + "sentry-discord-webhook:1.0.0",
version: "1.1.0",
image: REGISTRY + "sentry-discord-webhook:1.1.0",
env: [
{ name: "LISTEN_ADDRESS", value: ":8080" },
{
Expand Down
45 changes: 29 additions & 16 deletions devops/kubernetes/src/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
PodDisruptionBudget,
Secret,
ConfigMap,
Probe,
} from "../imports/k8s";

const { REGISTRY } = process.env;
Expand Down Expand Up @@ -34,6 +35,9 @@ export interface FortifyDeploymentOptions {

readonly minAvailable?: number;
readonly maxUnavailable?: number;

livenessProbe?: Probe | null;
readinessProbe?: Probe | null;
}

export class FortifyDeployment extends Construct {
Expand All @@ -44,6 +48,29 @@ export class FortifyDeployment extends Construct {
) {
super(scope, ns);

let { livenessProbe, readinessProbe } = options;

if (livenessProbe === undefined) {
livenessProbe = {
httpGet: {
path: "/live",
port: 9000,
},
initialDelaySeconds: 5,
periodSeconds: 10,
};
}
if (readinessProbe === undefined) {
readinessProbe = {
httpGet: {
path: "/ready",
port: 9000,
},
initialDelaySeconds: 5,
periodSeconds: 10,
};
}

const selectorLabels = {
app: Node.of(this).uniqueId,
};
Expand Down Expand Up @@ -128,22 +155,8 @@ export class FortifyDeployment extends Construct {
})),
],
env,
livenessProbe: {
httpGet: {
path: "/live",
port: 9000,
},
initialDelaySeconds: 5,
periodSeconds: 10,
},
readinessProbe: {
httpGet: {
path: "/ready",
port: 9000,
},
initialDelaySeconds: 5,
periodSeconds: 10,
},
livenessProbe: livenessProbe || undefined,
readinessProbe: readinessProbe || undefined,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion services/sentry-discord-webhook/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
discord-webhook:
image: ghcr.io/fortify-labs/fortify/sentry-discord-webhook:1.0.0
image: ghcr.io/fortify-labs/fortify/sentry-discord-webhook:1.1.0
build: .

ports:
Expand Down

0 comments on commit f4c7efa

Please sign in to comment.