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 *.iml
out out
gen gen
!/.idea/
!/.idea/*
/nacos-k8s.iml /nacos-k8s.iml
.DS_Store .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 apiVersion: v2
appVersion: "1.0" appVersion: "3.0.1"
description: A Helm chart for Kubernetes description: A Helm chart for Kubernetes
name: nacos name: nacos
version: 0.1.5 version: 1.0.0
maintainers: maintainers:
- name: arrowfeng - name: arrowfeng
- name: paderlol - 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`: To install the chart with `release name`:
```shell ```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. 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.
@ -65,15 +65,15 @@ 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. The following table lists the configurable parameters of the Skywalking chart and their default values.
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------------------------|--------------------------------------------------------------------|-------------------------------------| |-------------------------------------------------|------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| `global.mode` | Run Mode (~~quickstart,~~ standalone, cluster; ) | `standalone` | | `global.mode` | Run Mode (~~quickstart,~~ standalone, cluster; ) | `standalone` |
| `resources` | The [resources] to allocate for nacos container | `{}` | | `resources` | The [resources] to allocate for nacos container | `{}` |
| `nodeSelector` | Nacos labels for pod assignment | `{}` | | `nodeSelector` | Nacos labels for pod assignment | `{}` |
| `affinity` | Nacos affinity policy | `{}` | | `affinity` | Nacos affinity policy | `{}` |
| `tolerations` | Nacos tolerations | `{}` | | `tolerations` | Nacos tolerations | `{}` |
| `resources.requests.cpu`|nacos requests cpu resource|`500m`| | `resources.requests.cpu` | nacos requests cpu resource | `500m` |
| `resources.requests.memory`|nacos requests memory resource|`2G`| | `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.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.repository` | Nacos container image name | `nacos/nacos-server` |
| `nacos.image.tag` | Nacos container image tag | `latest` | | `nacos.image.tag` | Nacos container image tag | `latest` |
| `nacos.image.pullPolicy` | Nacos container image pull policy | `IfNotPresent` | | `nacos.image.pullPolicy` | Nacos container image pull policy | `IfNotPresent` |
@ -81,8 +81,13 @@ The following table lists the configurable parameters of the Skywalking chart an
| `nacos.plugin.image.repository` | Nacos cluster plugin image name | `nacos/nacos-peer-finder-plugin` | | `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.plugin.image.tag` | Nacos cluster plugin image tag | `1.1` |
| `nacos.health.enabled` | Enable health check or not | `false` | | `nacos.health.enabled` | Enable health check or not | `false` |
| `nacos.env.preferhostmode` | Enable Nacos cluster node domain name support | `hostname` | | `nacos.preferHostMode` | Enable Nacos cluster node domain name support | `hostname` |
| `nacos.env.serverPort` | Nacos port | `8848` | | `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.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.host` | mysql host | |
| `nacos.storage.db.name` | mysql database name | | | `nacos.storage.db.name` | mysql database name | |

View File

@ -7,14 +7,14 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- else if contains "NodePort" .Values.service.type }} {{- 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}") 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 }} {{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available. 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}') 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 }} {{- 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}") 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" echo "Visit http://127.0.0.1:8080 to use your application"

View File

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

View File

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

View File

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

View File

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

View File

@ -4,14 +4,15 @@
global: global:
mode: standalone mode: standalone
# deploymentType: merge
# mode: cluster # mode: cluster
############################nacos########################### ############################nacos###########################
namespace: default #namespace: default
nacos: nacos:
image: image:
repository: nacos/nacos-server repository: nacos/nacos-server
tag: latest tag: v3.0.1
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
plugin: plugin:
enable: true enable: true
@ -22,8 +23,13 @@ nacos:
replicaCount: 1 replicaCount: 1
podManagementPolicy: Parallel podManagementPolicy: Parallel
domainName: cluster.local domainName: cluster.local
preferhostmode: hostname preferHostMode: hostname
serverPort: 8848 serverPort: 8848
consolePort: 8080
mcpPort: 9080
authToken: nil
identityKey: nil
identityValue: nil
health: health:
enabled: false enabled: false
storage: 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 # 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. # follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0 appVersion: 1.16.0
home: https://nacos.io/
icon: https://img.alicdn.com/imgextra/i4/O1CN01rW3vAB1FDWKSOiFf0_!!6000000000453-2-tps-204-40.png