Websocket auth, pass access token in gke configs

This commit is contained in:
Hristo 2024-05-10 19:32:35 -04:00
parent 4e20c4ac56
commit c56a058a74
6 changed files with 49 additions and 11 deletions

View file

@ -15,8 +15,8 @@ APP_IMAGE_TAG=$(GCP_REPO)/$(GCP_PROJECT_ID)/$(PREFIX)-app:latest
CLUSTER_NAME=$(PREFIX)-cluster
.PHONY: build-deplpy
build-deplpy: docker-build-all deploy
.PHONY: build-deploy
build-deploy: docker-build-all deploy
.PHONY: docker-build-all
@ -34,7 +34,8 @@ show_config:
&& echo $(APP_IMAGE_TAG) \
&& echo $(SEARCH_PORT) \
&& echo $(BACKEND_PORT) \
&& echo $(OPENAI)
&& echo $(OPENAI) \
&& echo $(SUPER_SECRET_KEY)
.PHONY: docker-build-push-searxng
docker-build-push-searxng:
@ -72,6 +73,7 @@ deploy:
&& export TF_VAR_search_port=$(SEARCH_PORT) \
&& export TF_VAR_backend_port=$(BACKEND_PORT) \
&& export TF_VAR_open_ai=$(OPENAI) \
&& export TF_VAR_secret_key=$(SUPER_SECRET_KEY) \
&& terraform apply

View file

@ -136,6 +136,11 @@ resource "kubernetes_deployment" "backend" {
name = "PORT"
value = var.backend_port
}
env {
# Access key for backend
name = "SUPER_SECRET_KEY"
value = var.secret_key
}
}
}
}
@ -205,6 +210,11 @@ variable "open_ai" {
type = string
}
variable "secret_key" {
description = "Access key to secure backend endpoints"
type = string
}
variable "search_port" {
description = "Port for searxng service"
type = number