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

Unrecognized VM option 'UseCGroupMemoryLimitForHeap' during installation #554

Closed
koromkorom opened this issue May 3, 2021 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@koromkorom
Copy link

koromkorom commented May 3, 2021

Describe the bug
jenkins master wont start. Stays in Pending

To Reproduce
I used thos two yamls:
https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/crds/jenkins_v1alpha2_jenkins_crd.yaml
https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/all-in-one-v1alpha2.yaml

Additional information
Kubernetes version: 1.16.15-gke.14800
Jenkins Operator version: 0.5.0

Logs
I got this from kubectl logs -f -n jenkins jenkins-example

Unrecognized VM option 'UseCGroupMemoryLimitForHeap'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

@koromkorom koromkorom added the bug Something isn't working label May 3, 2021
@prryb
Copy link
Collaborator

prryb commented May 4, 2021

Hey, @koromkorom - could you provide the yaml for your Jenkins instance? The two yaml files you mentioned will install the CRD and the operator, and that works.

On a side note: UseCGroupMemoryLimitForHeap VM option has been removed in JDK 11 (and replaced with UseContainerSupport) - you may be using jdk11 Jenkins image.

UseContainerSupport has been backported into jdk 8u191 and is on by default. If your image uses jdk that has that on, it's safe to remove UseCGroupMemoryLimitForHeap from JAVA_OPTS env var on the container.

@koromkorom
Copy link
Author

Hey, @prryb

Yes I read that this option has been removed. But the only source of setting that option has to be the operator.

I got the Jenkins Instance yaml from here: https://www.jenkins.io/doc/book/installing/kubernetes/#deploy-jenkins-2

apiVersion: jenkins.io/v1alpha2
kind: Jenkins
metadata:
  name: example
spec:
  master:
    containers:
    - name: jenkins-master
      image: jenkins/jenkins:lts-jdk11
      imagePullPolicy: Always
      livenessProbe:
        failureThreshold: 12
        httpGet:
          path: /login
          port: http
          scheme: HTTP
        initialDelaySeconds: 80
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 5
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /login
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      resources:
        limits:
          cpu: 1500m
          memory: 3Gi
        requests:
          cpu: "1"
          memory: 500Mi
  seedJobs:
  - id: jenkins-operator
    targets: "cicd/jobs/*.jenkins"
    description: "Jenkins Operator repository"
    repositoryBranch: master
    repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git

@prryb
Copy link
Collaborator

prryb commented May 4, 2021

The operator sets the JAVA_OPTS env variable to -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -Djenkins.install.runSetupWizard=false -Djava.awt.headless=true. These settings work with the default image that is used.

You can override them by setting:

        env:
          - name: JAVA_OPTS
            value: {your_opts}

on your jenkins-master container.

Thanks for reporting this. Updating the Jenkins image and these default JVM options is on our backlog now.

prryb pushed a commit that referenced this issue May 20, 2021
* Upgrade base plugins
* Upgrade Jenkins image
* Remove deprecated JVM opts
@KorusMateusz
Copy link

Fixed in https://github.com/jenkinsci/kubernetes-operator/releases/tag/v0.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants