Skip to content

Commit

Permalink
Merge pull request #169 from fengxsong/support_extra_env
Browse files Browse the repository at this point in the history
feat: support extra runtime configs with env
  • Loading branch information
heqingpan authored Nov 14, 2024
2 parents 9b061ca + 414592e commit 5d846da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions deploy/k8s/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ data:
export RNACOS_RAFT_NODE_ID=$(expr 1 + $(echo $MY_POD_NAME | grep -o '[0-9]\+$'))
export RNACOS_RAFT_JOIN_ADDR={{ include "rnacos.fullname" . }}-0.{{ include "rnacos.fullname" . }}-headless:9848
# export RNACOS_RAFT_AUTO_INIT=true
export RUST_LOG={{ .Values.rancosConfig.rustLog }}
export RNACOS_HTTP_WORKERS={{ .Values.rancosConfig.httpWorkers }}
export RNACOS_CONSOLE_LOGIN_ONE_HOUR_LIMIT={{ .Values.rancosConfig.consoleLoginOneHourLimit }}
export RUST_LOG={{ .Values.rnacosConfig.rustLog }}
export RNACOS_HTTP_WORKERS={{ .Values.rnacosConfig.httpWorkers }}
export RNACOS_CONSOLE_LOGIN_ONE_HOUR_LIMIT={{ .Values.rnacosConfig.consoleLoginOneHourLimit }}
echo $RNACOS_RAFT_NODE_ADDR
echo $RNACOS_RAFT_NODE_ID
echo $RNACOS_RAFT_JOIN_ADDR
Expand Down
5 changes: 3 additions & 2 deletions deploy/k8s/helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ spec:
readinessProbe:
tcpSocket:
port: 9848
service: ""
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 9848
service: ""
initialDelaySeconds: 15
periodSeconds: 20
env:
Expand All @@ -57,6 +55,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- with .Values.extraEnvVars }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: podinfo
mountPath: /etc/podinfo
Expand Down
6 changes: 5 additions & 1 deletion deploy/k8s/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

rancosConfig:
rnacosConfig:
rustLog: info
httpWorkers: 8
consoleLoginOneHourLimit: 5

# more configs from environment variables
# https://r-nacos.github.io/docs/notes/env_config/#%E8%BF%90%E8%A1%8C%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E
extraEnvVars: []

persistence:
size: 20Gi
storageClass: default
Expand Down

0 comments on commit 5d846da

Please sign in to comment.