Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] k8s部署方案支持 Proposal for deployment on kubernetes with Helm #393

Closed
BorisPolonsky opened this issue Jun 16, 2023 · 4 comments
Assignees
Labels
💪 enhancement New feature or request

Comments

@BorisPolonsky
Copy link
Contributor

BorisPolonsky commented Jun 16, 2023

Is your feature request related to a problem? Please describe.

Feature request:
如题,基于k8s的部署方案。
A way to deploy this app on kubernetes besides current docker-compose solution.

Describe the solution you'd like
A clear and concise description of what you want to happen.
已开发一个基于helm chart部署的版本,目前已在集群上测通,支持将前后端组件、数据库,向量搜索,redis等组件一体化拉起,希望与社区共同完善。
I've developed a helm chart, for now it works out of box with default values.yaml configuration. Yet there are things to be improved (e.g. additional support for integrated micro-service for qdrant, document e.t.c.). I suggest that the community shall improve cloud native solution of this app together
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@BorisPolonsky BorisPolonsky changed the title Proposal for deployment on kubernetes with Helm [Feature Request] Proposal for deployment on kubernetes with Helm Jun 16, 2023
@BorisPolonsky BorisPolonsky changed the title [Feature Request] Proposal for deployment on kubernetes with Helm [Feature Request] K8s部署方案支持 Proposal for deployment on kubernetes with Helm Jun 17, 2023
@BorisPolonsky BorisPolonsky changed the title [Feature Request] K8s部署方案支持 Proposal for deployment on kubernetes with Helm [Feature Request] k8s部署方案支持 Proposal for deployment on kubernetes with Helm Jun 17, 2023
@takatost takatost added the 💪 enhancement New feature or request label Jun 17, 2023
@takatost takatost self-assigned this Jun 17, 2023
@takatost
Copy link
Collaborator

Error: INSTALLATION FAILED: template: dify/templates/worker-config.yaml:6:6: executing "dify/templates/worker-config.yaml" at <include "dify.worker.config" .>: error calling include: template: dify/templates/config.tpl:89:4: executing "dify.worker.config" at <include "dify.vectordb.config" .>: error calling include: template: dify/templates/config.tpl:223:40: executing "dify.vectordb.config" at <eq .clusterIP "None">: error calling eq: incompatible types for comparison

Seems like there's a problem with this judgement: (not (eq .clusterIP "None")) which caused the installation to fail.
BTW, can we link the K8s Helm installation directly to your repository(if it passes the test)?

@BorisPolonsky
Copy link
Contributor Author

BorisPolonsky commented Jun 17, 2023

Error: INSTALLATION FAILED: template: dify/templates/worker-config.yaml:6:6: executing "dify/templates/worker-config.yaml" at <include "dify.worker.config" .>: error calling include: template: dify/templates/config.tpl:89:4: executing "dify.worker.config" at <include "dify.vectordb.config" .>: error calling include: template: dify/templates/config.tpl:223:40: executing "dify.vectordb.config" at <eq .clusterIP "None">: error calling eq: incompatible types for comparison

Seems like there's a problem with this judgement: (not (eq .clusterIP "None")) which caused the installation to fail. BTW, can we link the K8s Helm installation directly to your repository(if it passes the test)?

Thanks for your feedback. Feel free to link helm installation to this repo.

I've tested with default configuration again yet I can't replicate the problem above. May I ask what version of kubernetes and helm you are using?

Here's what I got on my side:

helm install test dify/dify -n test2 --create-namespace
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/polonsky/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/polonsky/.kube/config
NAME: test
LAST DEPLOYED: Sat Jun 17 16:54:57 2023
NAMESPACE: test2
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace test2 -l "app.kubernetes.io/name=dify,app.kubernetes.io/instance=test,component=proxy" -o jsonpath="{.items[0].metadata.name}")
  export CONTAINER_PORT=$(kubectl get pod --namespace test2 $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl --namespace test2 port-forward $POD_NAME 8080:$CONTAINER_PORT

And the pods will be in ready state within minutes. (Since postgres and redis takes a while to be up and running so component api and worker may restart a few times in the beginning, no big deal here.)

kubectl get po -n test2
NAME                                READY   STATUS    RESTARTS        AGE
test-dify-api-d95986db5-5thgb       1/1     Running   2 (7m37s ago)   7m51s
test-dify-proxy-7df5d5d588-9r7dp    1/1     Running   0               7m51s
test-dify-web-847cbb5d68-rftdk      1/1     Running   0               7m51s
test-dify-worker-6468b9fcd4-gkkss   1/1     Running   2 (7m36s ago)   7m51s
test-postgresql-primary-0           1/1     Running   0               7m51s
test-postgresql-read-0              1/1     Running   0               7m51s
test-redis-master-0                 1/1     Running   0               7m51s
test-redis-replicas-0               1/1     Running   0               7m51s
test-redis-replicas-1               1/1     Running   0               7m10s
test-redis-replicas-2               1/1     Running   0               6m43s
weaviate-0                          1/1     Running   0               7m51s

Environment:
k8s

kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.9", GitCommit:"a1a87a0a2bcd605820920c6b0e618a8ab7d117d4", GitTreeState:"clean", BuildDate:"2023-04-12T12:16:51Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.2", GitCommit:"5835544ca568b757a8ecae5c153f317e5736700e", GitTreeState:"clean", BuildDate:"2022-09-21T14:27:13Z", GoVersion:"go1.19.1", Compiler:"gc", Platform:"linux/amd64"}

helm

helm version
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/polonsky/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/polonsky/.kube/config
version.BuildInfo{Version:"v3.12.0", GitCommit:"c9f554d75773799f72ceef38c51210f1842a1dea", GitTreeState:"clean", GoVersion:"go1.20.3"}

@takatost
Copy link
Collaborator

I'm using k8s in my m2 macbook's docker desktop. I figured out the problem, my helm version was too old, only v3.7.1. After upgrading to v3.12.1, no more errors.

@takatost
Copy link
Collaborator

Thx so much for ur contribution! I've already added the instructions in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants