Unable to deploy erpnext kubernetes cluster locally

I have successfully deploy erpnext using the official helm chart to aws eks

But I am having troubled doing the same thing on local using k3d.

I created a new site erp.cluster.local
I have the ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: frappe-bench-erpnext
  namespace: erpnext
  uid: 28865dfd-1d95-4038-a5e0-3dfeab52be27
  resourceVersion: '2597'
  generation: 2
  creationTimestamp: '2022-07-13T08:06:24Z'
  labels:
    app.kubernetes.io/instance: frappe-bench
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: erpnext
    app.kubernetes.io/version: v13.35.2
    helm.sh/chart: erpnext-4.0.38
  annotations:
    meta.helm.sh/release-name: frappe-bench
    meta.helm.sh/release-namespace: erpnext
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/upstream-vhost: erp.cluster.local
  managedFields:
    - manager: helm
      operation: Update
      apiVersion: networking.k8s.io/v1
      time: '2022-07-13T08:06:24Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:meta.helm.sh/release-name: {}
            f:meta.helm.sh/release-namespace: {}
          f:labels:
            .: {}
            f:app.kubernetes.io/instance: {}
            f:app.kubernetes.io/managed-by: {}
            f:app.kubernetes.io/name: {}
            f:app.kubernetes.io/version: {}
            f:helm.sh/chart: {}
    - manager: node-fetch
      operation: Update
      apiVersion: networking.k8s.io/v1
      time: '2022-07-13T08:09:21Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:spec:
          f:rules: {}
    - manager: kubectl-edit
      operation: Update
      apiVersion: networking.k8s.io/v1
      time: '2022-07-13T08:29:30Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            f:nginx.ingress.kubernetes.io/upstream-vhost: {}
  selfLink: /apis/networking.k8s.io/v1/namespaces/erpnext/ingresses/frappe-bench-erpnext
status:
  loadBalancer: {}
spec:
  rules:
    - host: erp.cluster.local
      http:
        paths:
          - path: /*
            pathType: ImplementationSpecific
            backend:
              service:
                name: frappe-bench-erpnext
                port:
                  number: 8080

the ingress controller synced the ingress successfully.

I0713 08:42:23.110398       7 admission.go:149] processed ingress via admission controller {testedIngressLength:3 testedIngressTime:0.025s renderingIngressLength:3 renderingIngressTime:0s admissionTime:29.6kBs testedConfigurationSize:0.025}
I0713 08:42:23.110423       7 main.go:101] "successfully validated configuration, accepting" ingress="erpnext/frappe-bench-erpnext"
I0713 08:43:11.203765       7 status.go:299] "updating Ingress status" namespace="erpnext" ingress="frappe-bench-erpnext" currentValue=[] newValue=[{IP:172.22.0.2 Hostname: Ports:[]}]


I added the domain in /etc/hosts/

172.22.0.2 		erp.cluster.local

However when I am trying to access the site via ‘erp.cluster.local’ the ingress controller does not direct me to the correct service. (it keeps directing me to upstream-default-backend) (nginx-404)

172.22.0.1 - - [13/Jul/2022:08:45:42 +0000] "GET / HTTP/2.0" 404 548 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" 439 0.000 [upstream-default-backend] [] 127.0.0.1:8181 548 0.000 404 5a3960372da538709904f573f0c158c1
172.22.0.1 - - [13/Jul/2022:08:45:43 +0000] "GET / HTTP/2.0" 404 548 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" 16 0.001 [upstream-default-backend] [] 127.0.0.1:8181 548 0.000 404 a34dfb469f97db19fc521dcad1788070

image

Can someone help me on this ?

Best regards

If you created the cluster with -p 80:80@loadbalancer -p 443:443@loadbalancer

e.g.

k3d cluster create devcluster --api-port 127.0.0.1:6443 -p 80:80@loadbalancer -p 443:443@loadbalancer --k3s-arg "--disable=traefik@server:0"

then add 127.0.0.1 erp.cluster.local in /etc/hosts. That seems to work for me.

I create a sites ending with .localhost instead of .cluster.local. By doing that I don’t need to edit /etc/hosts and I can access the sites from host machine.

I use linux. I’ve not used it on any other OS.

Why are you trying it locally? Are you trying to develop any operator?

2 Likes

Hi @revant_one
I tried to do a clean install following your instruction but the same problem happens. Must be some problem with my machine :frowning:
I am just trying to migrate from AWS to onprem server.