From 6e638fe2454295b28ea89245cb6d156889c4917a Mon Sep 17 00:00:00 2001 From: Joy Liu <34288846+joyliu-q@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:15:08 -0700 Subject: [PATCH] Add Persistent Redis (#599) --- k8s/main.ts | 20 +++----------------- k8s/package.json | 4 ++-- k8s/yarn.lock | 8 ++++---- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/k8s/main.ts b/k8s/main.ts index a718e8064..95b7f9405 100644 --- a/k8s/main.ts +++ b/k8s/main.ts @@ -1,8 +1,6 @@ import { Construct } from 'constructs'; import { App } from 'cdk8s'; import { CronJob, DjangoApplication, PennLabsChart, ReactApplication, RedisApplication } from '@pennlabs/kittyhawk'; -import { KubeConfigMap } from '@pennlabs/kittyhawk/lib/imports/k8s'; -import dedent from "ts-dedent"; const cronTime = require('cron-time-generator'); @@ -18,20 +16,6 @@ export class MyChart extends PennLabsChart { const clubsSecret = 'penn-clubs'; const clubsDomain = 'pennclubs.com'; - /** Redis ConfigMap */ - new KubeConfigMap(this, 'redis-config', { - data: { - 'redis.conf': dedent` - apiVersion: v1 - kind: ConfigMap - metadata: - name: redis-config - data: - redis-config: "" - `, - } - }); - /** Ingress HTTPS Enforcer */ const ingressProps = { annotations: { @@ -40,7 +24,9 @@ export class MyChart extends PennLabsChart { } } - new RedisApplication(this, 'redis', {}); + new RedisApplication(this, 'redis', { + persistData: true, + }); new DjangoApplication(this, 'django-wsgi', { deployment: { diff --git a/k8s/package.json b/k8s/package.json index da08504c4..b0e11bdb3 100644 --- a/k8s/package.json +++ b/k8s/package.json @@ -16,7 +16,7 @@ "upgrade:next": "npm i cdk8s@next cdk8s-cli@next" }, "dependencies": { - "@pennlabs/kittyhawk": "^1.1.8", + "@pennlabs/kittyhawk": "^1.1.9", "cdk8s": "^2.2.63", "constructs": "^10.0.119", "ts-dedent": "^2.2.0" @@ -28,4 +28,4 @@ "ts-jest": "^26.5.6", "typescript": "^4.6.3" } -} +} \ No newline at end of file diff --git a/k8s/yarn.lock b/k8s/yarn.lock index dc254f0e4..dc6f740a3 100644 --- a/k8s/yarn.lock +++ b/k8s/yarn.lock @@ -661,10 +661,10 @@ dependencies: "@octokit/openapi-types" "^12.11.0" -"@pennlabs/kittyhawk@^1.1.8": - version "1.1.8" - resolved "https://registry.yarnpkg.com/@pennlabs/kittyhawk/-/kittyhawk-1.1.8.tgz#4bb509b94b50f7e237a2f81b864aea92dc5228b2" - integrity sha512-YiNSXHr9j1u9VxAItslzTY1yvKc57PZ6+ypQ9JIlB/TBg/l/YpVCqhqlRmm/PcrRIogq8bNvpRzVowX53VE0FQ== +"@pennlabs/kittyhawk@^1.1.9": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@pennlabs/kittyhawk/-/kittyhawk-1.1.9.tgz#843c72bf8a45a14c7017f67fade3859bb842933a" + integrity sha512-1kmxRuy5KPCD2/MLu2lKafWPT60RNDdQ4XYON/e0p5zB+nvWowzzdGY/O3udqGBewtwYMVRKd96Ys/m9Zyc8yw== dependencies: cdk8s "^2.2.59" cdk8s-cli "^1.0.143"