Skip to content

Commit ee76b2e

Browse files
committed
feat(frontstage): move clerk key to kube secrets
1 parent 9bfa65e commit ee76b2e

File tree

5 files changed

+40
-2
lines changed

5 files changed

+40
-2
lines changed

k8s/frontstage.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ spec:
2828
value: "http://launchpad-service"
2929
- name: LOGS_BACKEND_API_HOST
3030
value: "http://logify-service"
31+
- name: NEXT_PUBLIC_CLERK_SIGN_IN_URL
32+
value: "/sign-in"
33+
- name: NEXT_PUBLIC_CLERK_SIGN_UP_URL
34+
value: "/sign-up"
35+
- name: NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL
36+
value: "/dashboard"
37+
- name: NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL
38+
value: "/dashboard"
39+
- name: NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
40+
valueFrom:
41+
secretKeyRef:
42+
name: clerk-keys
43+
key: NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
44+
- name: CLERK_SECRET_KEY
45+
valueFrom:
46+
secretKeyRef:
47+
name: clerk-keys
48+
key: CLERK_SECRET_KEY
3149
resources:
3250
limits:
3351
cpu: 500m

src/forge/cmd/worker/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
)
1212

1313
func main() {
14-
1514
appEnv := os.Getenv("APP_ENV")
1615
if appEnv == "local" {
1716
if err := godotenv.Load(); err != nil {

src/frontstage/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ COPY --from=builder /app/public ./public
2525
COPY --from=builder /app/package.json ./package.json
2626
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
2727
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
28-
COPY .env.local ./
2928

3029
USER nextjs
3130

tf/main.tf

+12
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ resource "kubernetes_secret" "aws_credentials" {
163163
}
164164
}
165165

166+
resource "kubernetes_secret" "clerk_keys" {
167+
metadata {
168+
name = "clerk-keys"
169+
namespace = "aether"
170+
}
171+
172+
data = {
173+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY = base64encode(var.next_public_clerk_publishable_key)
174+
CLERK_SECRET_KEY = base64encode(var.clerk_secret_key)
175+
}
176+
}
177+
166178
resource "null_resource" "delete_eks_resources" {
167179
triggers = {
168180
cluster_name = aws_eks_cluster.main.name

tf/variables.tf

+10
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,13 @@ variable "aws_session_token" {
106106
type = string
107107
sensitive = true
108108
}
109+
110+
variable "next_public_clerk_publishable_key" {
111+
description = "Publishable key for Clerk"
112+
type = string
113+
}
114+
115+
variable "clerk_secret_key" {
116+
description = "Secret key for Clerk"
117+
type = string
118+
}

0 commit comments

Comments
 (0)