Giter VIP home page Giter VIP logo

Comments (5)

sFritsch09 avatar sFritsch09 commented on June 16, 2024 1

Thanks it is working now :)
COOKIE_DOMAIN was not the main issue but I needed to put every service to their own DNS. I found some bugs, but after comparing them to the Cloud version, they appear to be identical.

I will add a step by step Guide here and then we can close this šŸš€

from vrite.

areknawo avatar areknawo commented on June 16, 2024

I don't have much experience with K8S so I won't be able to help. That said, I plan on improving the backend/self-hosting logs. As-is, it's been enough for the Cloud and simple Docker-based self-hosting, but it's indeed a bit limited.

If you have any suggestions on that front, I'm happy to hear them.

from vrite.

sFritsch09 avatar sFritsch09 commented on June 16, 2024

That's alright just for the protocol:

  • I changed livenessProbe and readinessProbe of api to /swagger.json
  • For assets I removed liveness- and readinessProbe

Once it is working for me I will share the configuration for your documentation on how to deploy to K8s :)

Now besides Kubernetes, I set a subdomain for App to app.mydomain.com and API to api.mydomain.com and I try to register in the frontend but get 500 in the console:

POST https://app.mydomain.com/api/v1/auth.register?batch=1 500 (Internal Server Error)

In Mongodb I could see the entry of the user in users collection with db.users.find()

Is this the right endpoint for the frontend, because in the Swagger Docu I didn't see such endpoint?

from vrite.

areknawo avatar areknawo commented on June 16, 2024

The REST API (documented here and in the Swagger spec) is used primarly as a public API. The app uses primarly a separate, internal API, with endpoints like the one you've listed.

Not exactly sure what could be causing the issue but, if you're using multiple subdomains, be sure to set the COOKIE_DOMAIN env var to, following your examples, mydomain.com.

from vrite.

sFritsch09 avatar sFritsch09 commented on June 16, 2024

How To Deploy Vrite On K8s:

It is beneficial to set the right envs and TLS for all Vrite Services.

Requirements

Helm Creation

The optimal approach is to generate a Helm Chart using Helm create vrite. This command will establish a Helm framework within your present directory under the release name vrite. The initial chart will serve as the frontend. To complete the setup, you must create three additional services within the vrite chart as SubCharts, namely vrite-api, vrite-collab, and vrite-assets.

Environments

You need the following envs as configMap or Secret:
HOST: "0.0.0.0"
PORT: "4444"
NODE_ENV: production
COOKIE_DOMAIN: BASEURL
SECRET: GENERATED_SECRET
MONGO_URL: mongodb://user:[email protected]:27017/vrite
REDIS_URL: redis://:[email protected]:6379
SENDER_EMAIL: [email protected]
SENDER_NAME: Sebastian Fritsch
SMTP_HOST: smtp.gmail.com
SMTP_PORT: "587"
SMTP_USERNAME: [email protected]
SMTP_PASSWORD: APP_PASS
SMTP_SECURE: "true"
PUBLIC_COLLAB_URL: http://VRITE_HELM_RELEASE_NAME.namespace.svc.cluster.local:5555
PUBLIC_APP_URL: http://VRITE_HELM_RELEASE_NAME.namespace.svc.cluster.local:3333
PUBLIC_API_URL: http://VRITE_HELM_RELEASE_NAME.namespace.svc.cluster.local:4444
PUBLIC_ASSETS_URL: http://VRITE_HELM_RELEASE_NAME.namespace.svc.cluster.local:8888
S3_BUCKET: vrite-images
S3_ENDPOINT: http://minio.namespace.svc.cluster.local:9000
S3_REGION: us-east-1
S3_ACCESS_KEY: USER
S3_SECRET_KEY: PASS
S3_FORCE_PATH_STYLE: true"

Liveness- and ReadinessProbe

For Vrite-API you can set Liveness- and ReadinessProbe to /swagger.json:

livenessProbe:
            httpGet:
              path: /swagger.json
              port: http
              scheme: HTTP

for Vrite-Assets you need to remove Liveness- and ReadinessProbe, the other ones can be set to path: /

from vrite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.