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

App is crashing in k8s setup #234

Open
organismen opened this issue Jun 30, 2021 · 1 comment
Open

App is crashing in k8s setup #234

organismen opened this issue Jun 30, 2021 · 1 comment

Comments

@organismen
Copy link

organismen commented Jun 30, 2021

Im struggeling with getting nodebb to run in kubernetes cluster. I was very glad to find your project but sadly I'm not getting it to work at the moment. I was hoping if you could give some suggestions where to look next.

I've setup a deployment with persistant storage (GKE). when I deploy it crashes with nothing special in the log, see image below. Its hard to see exactly where it loops but it seems to be after the first mongo error.

image: nibrev/nodebb:v1.17.1

image

Deployment yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    meta.helm.sh/release-name: nodebb
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2021-06-30T21:17:07Z"
  generation: 1
  labels:
    app.kubernetes.io/instance: nodebb
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: nrb-forum
    app.kubernetes.io/version: v1.17.1
    helm.sh/chart: xxx-1.17.1
  managedFields:
  - apiVersion: apps/v1
    fieldsType: FieldsV1
    fieldsV1:
     ...
    manager: Go-http-client
    operation: Update
    time: "2021-06-30T21:17:07Z"
  - apiVersion: apps/v1
    fieldsType: FieldsV1
    fieldsV1:
     ...
    manager: kube-controller-manager
    operation: Update
    time: "2021-06-30T21:43:37Z"
  name: nodebb-nrb-forum
  namespace: default
  resourceVersion: "183755718"
  uid: 50938ec4-235a-4db1-9761-e3d87c8bba7e
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: nodebb
      app.kubernetes.io/name: nrb-forum
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: nodebb
        app.kubernetes.io/name: nrb-forum
    spec:
      containers:
      - env:
        - name: DATABASE
          value: mongo
        - name: DB_NAME
          value: nodebb
        - name: DB_USER
          value: test
        - name: DB_PASSWORD
          value: test
        - name: DB_HOST
          value: mongo-mongodb # resolves properly when i exec into the machine and run $ host mongo-mongodb
        - name: DB_PORT
          value: "27017"
        - name: URL
          value: https://my-url.example.com # got a proper one here
        image: nibrev/nodebb:v1.17.1
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: http
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        name: nrb-forum
        ports:
        - containerPort: 4567
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: http
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources: {}
        securityContext: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /data
          name: beta-nodebb-pv
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: nodebb-nrb-forum
      serviceAccountName: nodebb-nrb-forum
      terminationGracePeriodSeconds: 30
      volumes:
      - name: beta-nodebb-pv
        persistentVolumeClaim:
          claimName: beta-nodebb-pv-claim
status:
  conditions:
  - lastTransitionTime: "2021-06-30T21:17:07Z"
    lastUpdateTime: "2021-06-30T21:26:15Z"
    message: ReplicaSet "nodebb-nrb-forum-65dfdf6597" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  - lastTransitionTime: "2021-06-30T21:43:37Z"
    lastUpdateTime: "2021-06-30T21:43:37Z"
    message: Deployment does not have minimum availability.
    reason: MinimumReplicasUnavailable
    status: "False"
    type: Available
  observedGeneration: 1
  replicas: 1
  unavailableReplicas: 1
  updatedReplicas: 1
@organismen
Copy link
Author

organismen commented Jul 1, 2021

I've managed to get it to work with the provided docker-compose file, everything starting up OK.

Reviewing the log, it seems that the next log output after my crashpoint above is:

nodebb_1   | No categories found, populating instance with default categories

Is that clue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant