nacos-group / nacos-k8s

This project contains a Nacos Docker image meant to facilitate the deployment of Nacos on Kubernetes using StatefulSets.
578 stars 468 forks source link

How to set environment variables in Nacos Operator? #443

Closed panzhc closed 5 months ago

panzhc commented 5 months ago

I tried the following configuration according to the documentation: Custom configuration

apiVersion: nacos.io/v1alpha1
kind: Nacos
metadata:
  name: nacos
spec:
  type: standalone
  env:
  - key: JVM_XMS
    value: 2g

When creating a Nacos object, the following error message is reported:

Nacos in version "v1alpha1" cannot be handled as a Nacos: strict decoding error: unknown field "spec.env[0].key"

How to configure environment variables in Nacos Operator? Or how can I change the JVM configuration?

Operator Image: nacos/nacos-operator:latest. Kubernetes Version: v1.26.6.

panzhc commented 5 months ago

Wrong document, should change the key to name:

apiVersion: nacos.io/v1alpha1
kind: Nacos
metadata:
  name: nacos
spec:
  type: standalone
  env:
  - name: JVM_XMS
    value: 2g