Skip to content

Commit

Permalink
Merge pull request #43 from litencatt/inj-redis-host
Browse files Browse the repository at this point in the history
Injct redis host and port env
  • Loading branch information
litencatt authored Dec 18, 2023
2 parents a3e115a + 6b2f825 commit 4d061b0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install-sealed-secrets:

secret-init:
kubectl create secret generic notion-bot --dry-run=client --from-env-file=.env -o yaml > manifests/secrets/non-encrypted-secrets.yml
kubectl apply -f manifests/secrets/secrets.yaml

secret-update:
cat manifests/secrets/non-encrypted-secrets.yml | kubeseal --controller-name=notion-bot-sealed-secrets --controller-namespace=kube-system --format yaml > manifests/secrets/secrets.yaml
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
SLACK_BOT_TOKEN: $SLACK_BOT_TOKEN
SLACK_APP_TOKEN: $SLACK_APP_TOKEN
NOTION_TOKEN: $NOTION_TOKEN
REDIS_HOST: redis
REDIS_PORT: 6379
volumes:
- .:/app
working_dir: /app
Expand Down
16 changes: 16 additions & 0 deletions manifests/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,19 @@ spec:
secretKeyRef:
name: notion-bot
key: NOTION_TOKEN
- name: REDIS_HOST
value: localhost
- name: REDIS_PORT
value: "6379"
- name: redis
image: redis:7.2-alpine
imagePullPolicy: Always
ports:
- containerPort: 6379
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 200m
memory: 200Mi
4 changes: 2 additions & 2 deletions src/redis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Redis = require("ioredis")
export const redis = new Redis({
port: 6379,
host: "redis",
port: process.env.REDIS_PORT,
host: process.env.REDIS_HOST,
})

0 comments on commit 4d061b0

Please sign in to comment.