diff --git a/.gitignore b/.gitignore index 3d7d33d3c..7c3095d08 100644 --- a/.gitignore +++ b/.gitignore @@ -148,6 +148,7 @@ ENV/ env.bak/ venv.bak/ mise.toml +deployment/helm/values-local.yml # Spyder project settings .spyderproject diff --git a/deployment/helm/README.md b/deployment/helm/README.md index 6ee79cc80..3b496c54b 100644 --- a/deployment/helm/README.md +++ b/deployment/helm/README.md @@ -1,6 +1,7 @@ -# cognee-infra-helm -General infrastructure setup for Cognee on Kubernetes using a Helm chart. +# Example helm chart +Example Helm chart fro Cognee with PostgreSQL and pgvector extension +It is not ready for production usage ## Prerequisites Before deploying the Helm chart, ensure the following prerequisites are met:  @@ -13,13 +14,22 @@ Before deploying the Helm chart, ensure the following prerequisites are met:  Clone the Repository Clone this repository to your local machine and navigate to the directory. -## Deploy Helm Chart: +## Example deploy Helm Chart: ```bash - helm install cognee ./cognee-chart + helm upgrade --install cognee deployment/helm \ + --namespace cognee --create-namespace \ + --set cognee.env.LLM_API_KEY="$YOUR_KEY" ``` **Uninstall Helm Release**: ```bash helm uninstall cognee ``` + +## Port forwarding +To access cognee, run +``` +kubectl port-forward svc/cognee-service -n cognee 8000 +``` +it will be available at localhost:8000 diff --git a/deployment/helm/templates/cognee_deployment.yaml b/deployment/helm/templates/cognee_deployment.yaml index f16a475ec..cf44d7301 100644 --- a/deployment/helm/templates/cognee_deployment.yaml +++ b/deployment/helm/templates/cognee_deployment.yaml @@ -20,12 +20,35 @@ spec: ports: - containerPort: {{ .Values.cognee.port }} env: + - name: ENABLE_BACKEND_ACCESS_CONTROL + value: "false" - name: HOST value: {{ .Values.cognee.env.HOST }} - name: ENVIRONMENT value: {{ .Values.cognee.env.ENVIRONMENT }} - name: PYTHONPATH value: {{ .Values.cognee.env.PYTHONPATH }} + - name: VECTOR_DB_PROVIDER + value: pgvector + - name: DB_HOST + value: {{ .Release.Name }}-postgres + - name: DB_PORT + value: "{{ .Values.postgres.port }}" + - name: DB_NAME + value: {{ .Values.postgres.env.POSTGRES_DB }} + - name: DB_USERNAME + value: {{ .Values.postgres.env.POSTGRES_USER }} + - name: DB_PASSWORD + value: {{ .Values.postgres.env.POSTGRES_PASSWORD }} + - name: LLM_API_KEY + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-llm-api-key + key: LLM_API_KEY + - name: LLM_MODEL + value: {{ .Values.cognee.env.LLM_MODEL }} + - name: LLM_PROVIDER + value: {{ .Values.cognee.env.LLM_PROVIDER }} resources: limits: cpu: {{ .Values.cognee.resources.cpu }} diff --git a/deployment/helm/templates/cognee_service.yaml b/deployment/helm/templates/cognee_service.yaml index 21e9e470e..b3ecbd5e3 100644 --- a/deployment/helm/templates/cognee_service.yaml +++ b/deployment/helm/templates/cognee_service.yaml @@ -5,7 +5,7 @@ metadata: labels: app: {{ .Release.Name }}-cognee spec: - type: NodePort + type: ClusterIP ports: - port: {{ .Values.cognee.port }} targetPort: {{ .Values.cognee.port }} diff --git a/deployment/helm/templates/secrets.yml b/deployment/helm/templates/secrets.yml new file mode 100644 index 000000000..1088865d2 --- /dev/null +++ b/deployment/helm/templates/secrets.yml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-llm-api-key +type: Opaque +data: + LLM_API_KEY: {{ .Values.cognee.env.LLM_API_KEY | b64enc | quote }} diff --git a/deployment/helm/values.yaml b/deployment/helm/values.yaml index 278312373..4a8fd4622 100644 --- a/deployment/helm/values.yaml +++ b/deployment/helm/values.yaml @@ -7,9 +7,11 @@ cognee: HOST: "0.0.0.0" ENVIRONMENT: "local" PYTHONPATH: "." + LLM_MODEL: "openai/gpt-4o-mini" + LLM_PROVIDER: "openai" resources: cpu: "4.0" - memory: "8Gi" + memory: "2Gi" # Configuration for the 'postgres' database service postgres: @@ -19,4 +21,4 @@ postgres: POSTGRES_USER: "cognee" POSTGRES_PASSWORD: "cognee" POSTGRES_DB: "cognee_db" - storage: "8Gi" + storage: "2Gi"