Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum

Hi ! I'm trying to deploy casdoor on my kubernetes cluster but I encounter issues... Here is my manifest:

apiVersion: v1
kind: Namespace
metadata:
  name: casdoor
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: casdoor-pvc
  namespace: casdoor
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
  namespace: casdoor
  name: casdoor-svc
  labels:
    app: casdoor
spec:
  ports:
    - port: 8000
      targetPort: 8000
      protocol: TCP
  type: ClusterIP
  selector:
    app: casdoor
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: casdoor-ingress
  namespace: casdoor
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  tls:
  - hosts:
    - auth.example.org
    secretName: casdoor-tls
  ingressClassName: nginx
  rules:
  - host: auth.example.org
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: casdoor-svc
            port:
              number: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: casdoor-deployment
  namespace: casdoor
  labels:
    app: casdoor
spec:
  replicas: 1
  selector:
    matchLabels:
      app: casdoor
  template:
    metadata:
      labels:
        app: casdoor
    spec:
      containers:
        - name: casdoor-container
          resources:
            requests:
              memory: "64Mi"
              cpu: "250m"
            limits:
              memory: "128Mi"
              cpu: "500m"
          image: casbin/casdoor:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8000
          volumeMounts:
            - mountPath: /conf
              name: conf
          env:       
            - name: RUNNING_IN_DOCKER
              value: "true"
      volumes:
        - name: conf
          persistentVolumeClaim:
            claimName: casdoor-pvc

When I check the logs of the pod I got:

panic: The Casdoor config file: "app.conf" was not found, it should be placed at: "//conf/app.conf"

goroutine 1 [running]:
github.com/casdoor/casdoor/object.InitAdapter()
        /go/src/casdoor/object/ormer.go:78 +0x2bc
main.main()
        /go/src/casdoor/main.go:35 +0x50

anyone can help me ?

2views
2users
1 minread

the error is very clear. Did you put the app.conf file in /conf?

nope, but i'm not an expert with kubernete and idk how to put the file in the volume

then don't use k8s if you aren't familiar

or hire someone who are familiar

i'm stuck with this I can't use anything else for the moment and probably for a long time

1 / 5
Oct 2023