Compare commits

...

2 Commits

Author SHA1 Message Date
paderlol 07eb931eac
Merge pull request #489 from YunWZ/master
Support nacos 3.0.1 #488
2025-05-29 14:29:59 +08:00
yunweizhan 1b98fe67a4 add `home` and `icon` info.
update .gitignore
upgrade helm version to v3;
update appVersion to 3.0.1;
update chart version to 1.0.0;
support deploy nacos 3.0.1
Supplementary documentation
2025-05-29 01:10:28 +08:00
10 changed files with 180 additions and 62 deletions

84
.gitignore vendored
View File

@ -6,8 +6,88 @@
*.iml
out
gen
!/.idea/
!/.idea/*
/nacos-k8s.iml
.DS_Store
### VisualStudioCode template
.vscode/*
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/*
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Go template
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work
go.work.sum
# env file
.env
### Helm template
# Chart dependencies
**/charts/*.tgz

View File

@ -1,9 +1,11 @@
apiVersion: v1
appVersion: "1.0"
apiVersion: v2
appVersion: "3.0.1"
description: A Helm chart for Kubernetes
name: nacos
version: 0.1.5
version: 1.0.0
maintainers:
- name: arrowfeng
- name: paderlol
- name: yunye
home: https://nacos.io/
icon: https://img.alicdn.com/imgextra/i4/O1CN01rW3vAB1FDWKSOiFf0_!!6000000000453-2-tps-204-40.png

View File

@ -22,7 +22,7 @@ If you use a custom database, please initialize the database script yourself fir
To install the chart with `release name`:
```shell
$ helm install `release name` ./nacos
$ helm install `release name` ./ --set nacos.authToken="{base64 string}",nacos.identityKey={key},nacos.identityValue={value}
```
The command deploys Nacos on the Kubernetes cluster in the default configuration. It will run without a mysql chart and persistent volume. The [configuration](#configuration) section lists the parameters that can be configured during installation.
@ -64,42 +64,47 @@ The command removes all the Kubernetes components associated with the chart and
The following table lists the configurable parameters of the Skywalking chart and their default values.
| Parameter | Description | Default |
|---------------------------------------|--------------------------------------------------------------------|-------------------------------------|
| `global.mode` | Run Mode (~~quickstart,~~ standalone, cluster; ) | `standalone` |
| `resources` | The [resources] to allocate for nacos container | `{}` |
| `nodeSelector` | Nacos labels for pod assignment | `{}` |
| `affinity` | Nacos affinity policy | `{}` |
| `tolerations` | Nacos tolerations | `{}` |
| `resources.requests.cpu`|nacos requests cpu resource|`500m`|
| `resources.requests.memory`|nacos requests memory resource|`2G`|
| `nacos.replicaCount` | Number of desired nacos pods, the number should be 1 as run standalone mode| `1` |
| `nacos.image.repository` | Nacos container image name | `nacos/nacos-server` |
| `nacos.image.tag` | Nacos container image tag | `latest` |
| `nacos.image.pullPolicy` | Nacos container image pull policy | `IfNotPresent` |
| `nacos.plugin.enable` | Nacos cluster plugin that is auto scale | `true` |
| `nacos.plugin.image.repository` | Nacos cluster plugin image name | `nacos/nacos-peer-finder-plugin` |
| `nacos.plugin.image.tag` | Nacos cluster plugin image tag | `1.1` |
| `nacos.health.enabled` | Enable health check or not | `false` |
| `nacos.env.preferhostmode` | Enable Nacos cluster node domain name support | `hostname` |
| `nacos.env.serverPort` | Nacos port | `8848` |
| `nacos.storage.type` | Nacos data storage method `mysql` or `embedded`. The `embedded` supports either standalone or cluster mode | `embedded` |
| `nacos.storage.db.host` | mysql host | |
| `nacos.storage.db.name` | mysql database name | |
| `nacos.storage.db.port` | mysql port | 3306 |
| `nacos.storage.db.username` | username of database | |
| `nacos.storage.db.password` | password of database | |
| `nacos.storage.db.param` | Database url parameter | `characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false` |
| `persistence.enabled` | Enable the nacos data persistence or not | `false` |
| `persistence.data.accessModes` | Nacos data pvc access mode | `ReadWriteOnce` |
| `persistence.data.storageClassName` | Nacos data pvc storage class name | `manual` |
| `persistence.data.resources.requests.storage` | Nacos data pvc requests storage | `5G` |
| `service.type` | http service type | `NodePort` |
| `service.port` | http service port | `8848` |
| `service.nodePort` | http service nodeport | `30000` |
| `ingress.enabled` | Enable ingress or not | `false` |
| `ingress.annotations` | The annotations used in ingress | `{}` |
| `ingress.hosts` | The host of nacos service in ingress rule | `nacos.example.com` |
| Parameter | Description | Default |
|-------------------------------------------------|------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| `global.mode` | Run Mode (~~quickstart,~~ standalone, cluster; ) | `standalone` |
| `resources` | The [resources] to allocate for nacos container | `{}` |
| `nodeSelector` | Nacos labels for pod assignment | `{}` |
| `affinity` | Nacos affinity policy | `{}` |
| `tolerations` | Nacos tolerations | `{}` |
| `resources.requests.cpu` | nacos requests cpu resource | `500m` |
| `resources.requests.memory` | nacos requests memory resource | `2G` |
| `nacos.replicaCount` | Number of desired nacos pods, the number should be 1 as run standalone mode | `1` |
| `nacos.image.repository` | Nacos container image name | `nacos/nacos-server` |
| `nacos.image.tag` | Nacos container image tag | `latest` |
| `nacos.image.pullPolicy` | Nacos container image pull policy | `IfNotPresent` |
| `nacos.plugin.enable` | Nacos cluster plugin that is auto scale | `true` |
| `nacos.plugin.image.repository` | Nacos cluster plugin image name | `nacos/nacos-peer-finder-plugin` |
| `nacos.plugin.image.tag` | Nacos cluster plugin image tag | `1.1` |
| `nacos.health.enabled` | Enable health check or not | `false` |
| `nacos.preferHostMode` | Enable Nacos cluster node domain name support | `hostname` |
| `nacos.serverPort` | Nacos pod's port | `8848` |
| `nacos.consolePort` | Nacos console main port | `8080` |
| `nacos.mcpPort` | Nacos mcp registry port | `9080` |
| `nacos.authToken` | Nacos auth plugin token secret key | *Must* be setting manually |
| `nacos.identityKey` | Nacos auth server identity key | *Must* be setting manually |
| `nacos.identityValue` | Nacos auth server identity value | *Must* be setting manually |
| `nacos.storage.type` | Nacos data storage method `mysql` or `embedded`. The `embedded` supports either standalone or cluster mode | `embedded` |
| `nacos.storage.db.host` | mysql host | |
| `nacos.storage.db.name` | mysql database name | |
| `nacos.storage.db.port` | mysql port | 3306 |
| `nacos.storage.db.username` | username of database | |
| `nacos.storage.db.password` | password of database | |
| `nacos.storage.db.param` | Database url parameter | `characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false` |
| `persistence.enabled` | Enable the nacos data persistence or not | `false` |
| `persistence.data.accessModes` | Nacos data pvc access mode | `ReadWriteOnce` |
| `persistence.data.storageClassName` | Nacos data pvc storage class name | `manual` |
| `persistence.data.resources.requests.storage` | Nacos data pvc requests storage | `5G` |
| `service.type` | http service type | `NodePort` |
| `service.port` | http service port | `8848` |
| `service.nodePort` | http service nodeport | `30000` |
| `ingress.enabled` | Enable ingress or not | `false` |
| `ingress.annotations` | The annotations used in ingress | `{}` |
| `ingress.hosts` | The host of nacos service in ingress rule | `nacos.example.com` |
## Example

View File

@ -7,14 +7,14 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services nacos-cs)
export NODE_PORT=$(kubectl get svc nacos-cs --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[3].nodePort}" )
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/nacos
echo http://$NODE_IP:$NODE_PORT/index.html
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "nacos.fullname" . }}'
You can watch the status of by running 'kubectl get svc nacos-cs --namespace {{ .Release.Namespace }} -w {{ include "nacos.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "nacos.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
echo http://$SERVICE_IP:{{ .Values.service.port }}/v3/console/index.html
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "nacos.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"

View File

@ -3,7 +3,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: nacos-cm
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
data:
{{- with .Values.nacos.storage.db }}
mysql.db.host: {{.host}}

View File

@ -4,7 +4,7 @@ apiVersion: {{ .Values.ingress.apiVersion }}
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "nacos.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}

View File

@ -3,7 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: nacos-hs
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
spec:
clusterIP: None
publishNotReadyAddresses: true
@ -18,6 +18,12 @@ spec:
- port: {{add .Values.service.port 1001}}
name: raft-rpc
targetPort: {{add .Values.nacos.serverPort 1001}}
- port: {{ .Values.nacos.consolePort}}
name: console
targetPort: {{ .Values.nacos.consolePort }}
- port: {{ .Values.nacos.mcpPort}}
name: mcp
targetPort: {{ .Values.nacos.mcpPort }}
## 兼容1.4.x版本的选举端口
- port: 7848
name: old-raft-rpc
@ -32,7 +38,7 @@ apiVersion: v1
kind: Service
metadata:
name: nacos-cs
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- toYaml .Values.service.labels | nindent 4 }}
annotations:
@ -50,6 +56,12 @@ spec:
- port: {{add .Values.service.port 1001}}
name: raft-rpc
targetPort: {{add .Values.nacos.serverPort 1001}}
- port: 8080
name: console
targetPort: {{ .Values.nacos.consolePort }}
- port: 9080
name: mcp
targetPort: {{ .Values.nacos.mcpPort }}
## 兼容1.4.x版本的选举端口
- port: 7848
name: old-raft-rpc

View File

@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "nacos.fullname" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
annotations:
{{- toYaml .Values.annotations | indent 4 }}
spec:
@ -59,18 +59,18 @@ spec:
timeoutSeconds: 10
httpGet:
scheme: HTTP
port: {{ .Values.nacos.serverPort }}
path: /nacos/v1/console/health/readiness
port: {{ .Values.nacos.consolePort }}
path: /v3/console/health/readiness
livenessProbe:
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
httpGet:
scheme: HTTP
port: {{ .Values.nacos.serverPort }}
path: /nacos/v1/console/health/liveness
port: {{ .Values.nacos.consolePort }}
path: /v3/console/health/liveness
ports:
- name: http
- name: client-http
containerPort: {{ .Values.nacos.serverPort }}
protocol: TCP
- containerPort: {{ add .Values.nacos.serverPort 1000}}
@ -79,15 +79,26 @@ spec:
name: raft-rpc
- containerPort: 7848
name: old-raft-rpc
- containerPort: {{ .Values.nacos.consolePort}}
name: console
protocol: TCP
- containerPort: {{ .Values.nacos.mcpPort }}
name: mcp
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{ toYaml .Values.resources | nindent 12 }}
env:
- name: NACOS_SERVER_PORT
value: {{ .Values.nacos.serverPort | quote }}
- name: NACOS_APPLICATION_PORT
value: {{ .Values.nacos.serverPort | quote }}
- name: PREFER_HOST_MODE
value: {{ .Values.nacos.preferhostmode | quote }}
value: {{ .Values.nacos.preferHostMode | quote }}
- name: NACOS_AUTH_TOKEN
value: {{ .Values.nacos.authToken | quote }}
- name: NACOS_AUTH_IDENTITY_KEY
value: {{ .Values.nacos.identityKey | quote }}
- name: NACOS_AUTH_IDENTITY_VALUE
value: {{ .Values.nacos.identityValue | quote }}
{{- if eq .Values.global.mode "standalone" }}
- name: MODE
value: "standalone"

View File

@ -4,14 +4,15 @@
global:
mode: standalone
# deploymentType: merge
# mode: cluster
############################nacos###########################
namespace: default
#namespace: default
nacos:
image:
repository: nacos/nacos-server
tag: latest
tag: v3.0.1
pullPolicy: IfNotPresent
plugin:
enable: true
@ -22,8 +23,13 @@ nacos:
replicaCount: 1
podManagementPolicy: Parallel
domainName: cluster.local
preferhostmode: hostname
preferHostMode: hostname
serverPort: 8848
consolePort: 8080
mcpPort: 9080
authToken: nil
identityKey: nil
identityValue: nil
health:
enabled: false
storage:

View File

@ -21,3 +21,5 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0
home: https://nacos.io/
icon: https://img.alicdn.com/imgextra/i4/O1CN01rW3vAB1FDWKSOiFf0_!!6000000000453-2-tps-204-40.png