-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support nacos storage #796
base: main
Are you sure you want to change the base?
Changes from 7 commits
bd58388
625c61d
d848bb8
e8888cb
d01a220
d8bb8d3
5aed7f4
0ffcc30
c0c4e38
8eb8f5b
9bb4920
31ca385
b5fd8a7
85b8274
370d386
01c08fe
06651de
35c5db1
9449862
ecb2672
62c421a
2e72259
0c83d5f
0715626
62cb1dd
8ce8df9
cd3527e
4b5cd88
a3ecec7
9349772
a3b114b
41bd16a
598aaf0
a8af197
6cd64b4
5575512
81810c0
daba6c7
32a6786
0a425dd
0f270ce
b306f61
688442b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- if .Values.nacos.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.nacos.name }}-service | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
type: {{ .Values.nacos.service.type }} | ||
ports: | ||
- port: {{ .Values.nacos.service.port }} | ||
targetPort: {{ .Values.nacos.service.port }} | ||
protocol: TCP | ||
name: http | ||
- port: {{ add .Values.nacos.service.port 1000}} | ||
name: client-rpc | ||
targetPort: {{add .Values.nacos.service.port 1000}} | ||
- port: {{add .Values.nacos.service.port 1001}} | ||
name: raft-rpc | ||
targetPort: {{add .Values.nacos.service.port 1001}} | ||
- port: 7848 | ||
name: old-raft-rpc | ||
targetPort: 7848 | ||
protocol: TCP | ||
{{- if eq .Values.nacos.service.type "NodePort" }} | ||
nodePort: {{ .Values.nacos.service.nodePort }} | ||
{{- end }} | ||
selector: | ||
app.kubernetes.io/name: {{ .Values.nacos.name }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{{- if .Values.nacos.enabled }} | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ .Values.nacos.name }} | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
{{- toYaml .Values.nacos.annotations | indent 4 }} | ||
spec: | ||
serviceName: {{ .Values.nacos.name }}-service | ||
replicas: {{ .Values.nacos.replica }} | ||
{{- if .Values.nacos.podManagementPolicy }} | ||
podManagementPolicy: {{ .Values.nacos.podManagementPolicy }} | ||
{{- else}} | ||
podManagementPolicy: OrderedReady | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ .Values.nacos.name }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ .Values.nacos.name }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
spec: | ||
{{- with .Values.nacos.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nacos.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nacos.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Values.nacos.name }} | ||
image: "{{ .Values.nacos.hub }}:{{ .Values.nacos.tag }}" | ||
imagePullPolicy: {{ .Values.nacos.pullPolicy }} | ||
startupProbe: | ||
initialDelaySeconds: 180 | ||
periodSeconds: 5 | ||
timeoutSeconds: 10 | ||
httpGet: | ||
scheme: HTTP | ||
port: {{ .Values.nacos.service.port }} | ||
path: /nacos/v1/console/health/readiness | ||
livenessProbe: | ||
initialDelaySeconds: 10 | ||
periodSeconds: 5 | ||
timeoutSeconds: 10 | ||
httpGet: | ||
scheme: HTTP | ||
port: {{ .Values.nacos.service.port }} | ||
path: /nacos/v1/console/health/liveness | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.nacos.service.port }} | ||
protocol: TCP | ||
- containerPort: {{ add .Values.nacos.service.port 1000}} | ||
name: client-rpc | ||
- containerPort: {{ add .Values.nacos.service.port 1001 }} | ||
name: raft-rpc | ||
- containerPort: 7848 | ||
name: old-raft-rpc | ||
resources: | ||
{{- toYaml .Values.nacos.resources | nindent 12 }} | ||
env: | ||
- name: NACOS_SERVER_PORT | ||
value: {{ .Values.nacos.service.port | quote }} | ||
- name: NACOS_APPLICATION_PORT | ||
value: {{ .Values.nacos.service.port | quote }} | ||
- name: PREFER_HOST_MODE | ||
value: {{ .Values.nacos.preferHostMode | quote }} | ||
- name: MODE | ||
value: "standalone" | ||
- name: EMBEDDED_STORAGE | ||
value: embedded | ||
volumeMounts: | ||
- name: data | ||
mountPath: /home/nacos/plugins/peer-finder | ||
subPath: peer-finder | ||
- name: data | ||
mountPath: /home/nacos/data | ||
subPath: data | ||
- name: data | ||
mountPath: /home/nacos/logs | ||
subPath: logs | ||
{{- if not .Values.nacos.persistence.enabled }} | ||
volumes: | ||
- name: data | ||
emptyDir: { } | ||
{{- end }} | ||
{{- if .Values.nacos.persistence.enabled }} | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: data | ||
spec: | ||
{{- toYaml .Values.nacos.persistence.data | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -651,7 +651,7 @@ apiserver: | |
imagePullPolicy: IfNotPresent | ||
securePort: 8443 | ||
storage: nacos | ||
serverAddr: http://127.0.0.1:8848 | ||
serverAddr: http://higress-nacos-service.higress-system.svc.cluster.local:8848 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. serverAddr 建议改名为 storageAddr,否则容易误解。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我觉得可以的。之前也考虑过能不能让 nacos 直接支持这种配置方式。短时间可以在生成配置的时候处理一下。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 只让用户配置 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 或者直接让用户配置 |
||
username: "" | ||
password: "" | ||
namespaceID: "" | ||
|
@@ -663,3 +663,35 @@ skywalking: | |
service: | ||
address: ~ | ||
port: 11800 | ||
|
||
# nacos config settings | ||
nacos: | ||
name: "higress-nacos" | ||
enabled: false | ||
hub: nacos/nacos-server | ||
tag: latest | ||
pullPolicy: IfNotPresent | ||
replica: 1 | ||
podManagementPolicy: Parallel | ||
nodeSelector: { } | ||
affinity: { } | ||
tolerations: [ ] | ||
persistence: | ||
enabled: false | ||
data: | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClassName: manual | ||
resources: | ||
requests: | ||
storage: 5Gi | ||
service: | ||
port: 8848 | ||
type: NodePort | ||
nodePort: 30000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 默认需要开NodePort吗? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不需要的,也可以改成clusterip,我给改一下 |
||
annotations: {} | ||
preferHostMode: hostname | ||
resources: | ||
requests: | ||
cpu: 500m | ||
memory: 2Gi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,9 @@ metadata: | |
spec: | ||
containers: | ||
- name: nacos-standlone-rc3 | ||
image: swsk33/nacos-standalone:2.2.3 | ||
image: registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3:1.0.0-RC3 | ||
CH3CHO marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ports: | ||
- containerPort: 8848 | ||
- containerPort: 9848 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
|
@@ -48,5 +47,3 @@ spec: | |
ports: | ||
- name: foo # name is not required for single-port Services | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 现在已经不是单端口服务了,name 还是好好取一个吧 |
||
port: 8848 | ||
- name: bar | ||
port: 9848 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里格式处理一下吧。另外,什么情况下需要用到 NodePort 呢,还只有 7848?