Domain Routing in ERPNext - Kubernetes

Dear Developers,

Sir @revant_one

I am trying to add domain to my Erpnext site in Kubernetes but having some issues.

I am able to access using domain but through nodeport,

for eg, mydomain.com:3233

but I want to directly access without nodeport.

Here is all running services,

Example

I’m using this ingress code,

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test1-ingress
namespace: default
annotations:
cert-manager.io/cluster-issuer: “letsencrypt-prod”
kubernetes.io/ingress.class: nginx
spec:
tls:

rules:

  • host: domain.example.com
    http:
    paths:
    • path: “/”
      pathType: Prefix
      backend:
      service:
      name: erpnext-erpnext
      port:
      number: 80

Looking for guidance,

Thanks & Regards
Jack

no need for ERPNext service to be of type loadbalancer. let it be clusterip.

let only the ingress controller be the loadbalancer.

to add a site, run the site creation job and add ingress

also change the secret name

secretName: letsencrypt-prod

to secretName: domain-example-com-tls

Thank You sir, I will try this way

Sir, I tried the following

I patched erpnext-erpnext from LoadBalancer to ClusterIP

Eg. erpnext-erpnext ClusterIP 10.103.22.253 x.x.x.x 80/TCP

Changed, secretName to domain-example-com-tls

Describe Ingress CMD shows:

cert-manager Successfully created Certificate “domain-com-tls”
nginx-ingress-controller Scheduled for sync

Errors:

default-http-backend:80 (<error: endpoints “default-http-backend” not found>)

Visiting Domain: ERR_EMPTY_RESPONSE

it should be erpnext-erpnext:80

what version of kubernetes are you using?

check version specific changes to ingress.

can you check if any ingress is created?

erpnext-erpnext:80 not found error popup if i add ingress in different namespace then the default where erpnext is installed.

Kubernetes version: 1.22.3

Site Ingress gets created, If I describe the ingress using - kubectl describe ingress —

log shows this error:

default-http-backend:80 (<error: endpoints “default-http-backend” not found>)

Maybe this error is coming when ingress is not able to find service/port correctly.

can you share the current yaml for Ingress

kubectl get ingress ingressname -o yaml

Thank you for your time,

There was an issue with the NGINX Setup,
Now its working I used the NGINX Configuration file for Bare-Metal Server.

@revant_one I have a similar issue in google cloud, and the problemas is that the ingress is not showing the files

Error:

No assets loaded…

GET https cloud001.aguacate.codes/assets/js/bootstrap-4-web.min.js net::ERR_ABORTED 404
  • ingress.yaml file

    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
    name: ingress-cloud001.aguacate.codes
    # Optional Labels
    labels:
    _app.kubernetes.io/instance: frappe-bench-0001-erpnext
    namespace: erpnext
    annotations:
    # required for cert-manager letsencrypt
    _cert-manager.io/cluster-issuer: letsencrypt-prod
    # other annotations as needed, e.g timestamp
    _kubernetes.io/ingress.class: nginx
    _kubernetes.io/tls-acme: “true”
    _nginx.ingress.kubernetes.io/upstream-vhost: cloud001.aguacate.codes
    spec:
    rules:
    - host: cloud001.aguacate.codes
    http:
    paths:
    - backend:
    serviceName: frappe-bench-0001-erpnext
    servicePort: 8000
    path: /
    tls:
    - hosts:
    - cloud001.aguacate.codes
    secretName: frappe-bench-0001-erpnext-tls

All sites and components are running withany issue.

— Note
I added underscores to avoid link detection (ex: _nginx.)

8000?

use 8080. On 8080 it uses nginx reverse proxies + assets.
on 8000 it just serves gunicorn

Also use the latest ingress apiVersion: networking.k8s.io/v1 instead of apiVersion: extensions/v1beta1 on newer clusters.

I tried, but it didnt work… Bu already setup cluster on docker swarm (also I found the issue in docker swarm)

If you can give me access to your cluster or swarm I can check.

All my ERPNext setups on swarms and clusters are running as expected on AWS, scaleway, digitalocean, local ISP.

hello @revant_one, is working good in docker swarm but I could not install a custom app that is a theme.

Can you help me? I can give you access to it.

I generally show people a diff of working images:

  1. https://github.com/castlecraft/custom_frappe_docker/compare/main...isppme
  2. https://github.com/castlecraft/custom_frappe_docker/compare/main...agriculture

If you share the app url with me, I’ll share the diff.

Thanks so much, I got it and I could make it.

You awesome.

Now I am buildig and image to install custom apps easily and share it.

Thanks.