Skip to content

Commit

Permalink
Add Persistent Redis
Browse files Browse the repository at this point in the history
  • Loading branch information
joyliu-q committed Oct 26, 2023
1 parent a91b872 commit 9d57017
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
20 changes: 3 additions & 17 deletions k8s/main.ts
Original file line number Diff line number Diff line change
@@ -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');

Expand All @@ -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: {
Expand All @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions k8s/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -28,4 +28,4 @@
"ts-jest": "^26.5.6",
"typescript": "^4.6.3"
}
}
}
8 changes: 4 additions & 4 deletions k8s/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9d57017

Please sign in to comment.