0

I would like run a local Maven proxy with JFrog on my Microk8s instance. I get the following error message:

ERROR: Max number of open files 1024, is too low. Cannot run Artifactory!

My deployment yaml file looks like this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jfrog
spec:
  selector:
    matchLabels:
      app: jfrog
  template:
    metadata:
      labels:
        app: jfrog
    spec:
      containers:
      - name: jfrog
        image: docker.bintray.io/jfrog/artifactory-oss:latest
        env:
        - name: TZ
          value: Europe/Berlin
        - name: EXTRA_JAVA_OPTIONS
          value: -Dartifactory.maven.suppressPomConsistencyChecks=true
        ports:
          - name: http
            containerPort: 8081
            protocol: TCP
        resources:
          limits:
            cpu: 400m
            memory: 2Gi
          requests:
            cpu: 200m
            memory: 512Mi

The recommended setting for open files is 32000 and the minimum to get the services started is 10000. The container image for JFrog is started as a non-root user. Anyone an idea how to solve this problem?

Thank you in advance

indigo
  • 338
  • 1
  • 9
  • What is the output of `microk8s.kubectl exec -- cat /proc/sys/fs/file-max`? – Crou Jan 08 '19 at 13:26
  • For the reason the container crashes on startup, I've added a `command` directive in the deployment file like this: `command: - /bin/cat - /proc/sys/fs/file-max` On startup I get the output of `1000000` in the log output. – indigo Jan 08 '19 at 14:51
  • Where do you get the `ERROR: Max number of open files...` from? Can you share more details regarding your build and how your are running it? – Crou Jan 08 '19 at 15:01
  • Sure, I run the container image provided by JFrog. Fortunately the Dockerfile how they build the image is included and I've extracted it here: https://gist.github.com/indigo423/45b2c790c7bd38a3660b215984b0c882 I have also extracted the entry point script which runs a function called `checkULimits` which is the reason for the error message see here: https://gist.github.com/indigo423/f7441e5c40fdc62d15e9499b71031147#file-entrypoint-artifactory-sh-L54 – indigo Jan 08 '19 at 15:10
  • But where do you see the error message, in which logs? – Crou Jan 08 '19 at 15:17
  • Sorry, here is the procedure what I do to get this error message: 1. `microk8s.kubectl create -f deployment.yaml` 2. `microk8s.kubectl get pods` to get the frog pod name 3. `microk8s.kubectl logs ` – indigo Jan 08 '19 at 15:37
  • Here is the full output of the logs output: https://gist.github.com/indigo423/c30c6241b6a39230264e466a540d4f8b – indigo Jan 08 '19 at 15:44

1 Answers1

0

Comment out the following line in /etc/sysconfig/docker:

OPTIONS="--default-ulimit nofile=1024:4096"
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68