Skip to content

fix: config-server helm chart fails installation due to javaOpts placed under resources block #1822

@bhumi46

Description

@bhumi46

Description

Installing the config-server helm chart fails with the following error:

Error: INSTALLATION FAILED: failed to create typed patch object (config-server/config-server; apps/v1, Kind=Deployment):
.spec.template.spec.containers[name="config-server"].resources.javaOpts: field not declared in schema

Root Cause

In helm/config-server/values.yaml, javaOpts is nested inside the resources: block:

resources:
  limits:
    cpu: 300m
    memory: 3000Mi
  requests:
    cpu: 150m
    memory: 1500Mi
  javaOpts: >-        # ← incorrectly placed here
    -XX:+UseZGC ...

The deployment template renders resources via {{ toYaml .Values.resources }}, which dumps javaOpts directly into the Kubernetes container resources: field. Kubernetes only allows limits, requests, and claims under resources — any other key fails schema validation.

Fix

Move javaOpts to a separate top-level additionalResources: key (consistent with other charts in this repo such as idgenerator, ridgenerator, pridgenerator) and render it as a JDK_JAVA_OPTIONS environment variable in deployment.yaml.

values.yaml

resources:
  limits:
    cpu: 300m
    memory: 3000Mi
  requests:
    cpu: 150m
    memory: 1500Mi
additionalResources:
  javaOpts: >-
    -XX:+UseZGC -XX:+ZGenerational ...

deployment.yaml

env:
  - name: JDK_JAVA_OPTIONS
    value: {{ .Values.additionalResources.javaOpts }}

Affected Component

  • helm/config-server/values.yaml
  • helm/config-server/templates/deployment.yaml

Branch

release-1.3.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions