Skip to content
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 for eureka and nacos registry #46

Merged
merged 4 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ data:
reportBatchMaxTime: 1s
# Set enableTracing to false to disable request tracing.
enableTracing: true

configSources:
- address: xds://slime-hango.{{ .Values.namespace }}.svc:16010?types=serviceentry
- address: k8s://

# Set accessLogFile to empty string to disable access log.
accessLogFile: "/tmp/gateway-proxy-envoy-access.log"
Expand Down Expand Up @@ -266,11 +268,13 @@ metadata:
apiVersion: v1
data:
cfg: |
{"bundle":{"modules":[{"kind":"limiter","name":"limiter"},{"kind":"plugin","name":"plugin"}]},"enable":true,"global":{"configSources":[{"address":"ss://"}],"log":{"logLevel":"info"}},"name":"bundle"}
{"bundle":{"modules":[{"name":"plugin","kind":"plugin"},{"name":"limiter","kind":"limiter"},{"name":"meshregistry","kind":"meshregistry"}]},"enable":true,"global":{"service":"","istioNamespace":"hango-system","slimeNamespace":"hango-system","istioRev":"","configRev":"mesh-reg","configSources":[{"address":"ss://"}],"log":{"klogLevel":5,"logLevel":"info"},"misc":{"pathRedirect":"/ready->/meshregistry/ready,/pc->/meshregistry/pc,/nc->/meshregistry/nc,/zk->/meshregistry/zk,/zks->/meshregistry/zks,/xdsCache->/meshregistry/xdsCache","xdsSourceEnableIncPush":"true"}},"name":"bundle"}
cfg_limiter: |
{"enable":true,"general":{"disableAdaptive":true,"disableGlobalRateLimit":true,"disableInsertGlobalRateLimit":true},"kind":"limiter","mode":"BundleItem","name":"limiter"}
cfg_plugin: |
{"enable":true,"kind":"plugin","mode":"BundleItem","name":"plugin"}
cfg_meshregistry: |
{"name":"meshregistry","kind":"meshregistry","enable":true,"mode":"BundleItem","general":{"LEGACY":{"MeshConfigFile":"","RevCrds":"","Mcp":{},"K8SSource":{"Enabled":false},"EurekaSource":{"Enabled":{{ .Values.registry.eureka.enable }},"Address":[{{ .Values.registry.eureka.address }}],"RefreshPeriod":"{{ .Values.registry.eureka.refresh_period }}","GatewayModel":true},"NacosSource":{"Enabled":{{ .Values.registry.nacos.enable }},"Address":[{{ .Values.registry.nacos.address }}],"GatewayModel":true,"Group":"{{ .Values.registry.nacos.service_group }}"}}}}
kind: ConfigMap
metadata:
name: slime-hango
Expand Down Expand Up @@ -334,3 +338,9 @@ data:
4,
'已上线'
);
{{ if .Values.registry.nacos.enable }}
INSERT INTO apigw_gportal_registry_center (`registry_type`, `registry_addr`, `registry_alias`) VALUES ('Nacos', '-', 'nacos');
{{- end }}
{{ if .Values.registry.eureka.enable }}
INSERT INTO apigw_gportal_registry_center (`registry_type`, `registry_addr`, `registry_alias`) VALUES ('Eureka', '-', 'eureka');
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ spec:
value: "false"
- name: PILOT_ENABLE_CDS_CACHE
value: "false"
- name: CONFIG_REVISION
value: mesh-reg
image: "{{ .Values.images.istiod_image }}"
name: discovery
ports:
Expand Down Expand Up @@ -346,6 +348,20 @@ spec:
value: "true"
- name: GODEBUG
value: gctrace=1
- name: ENABLE_INC_PUSH
value: "true"
- name: LOCALITY_LABELS
value: system.msha/region,system.msha/zone,system.msha/cluster
- name: CLUSTER_ID
value: cluster1
- name: XDS_SEND_TIMEOUT
value: 40s
- name: SENT_NONCE_RECORD_NUM
value: "10"
- name: MESH_REG_ISTIO_REVISION
value: mesh-reg
- name: NSF_COLOR_ENDPOINT_LABEL
value: nsf.skiff.netease.com/mark
ports:
- name: http
containerPort: 80
Expand All @@ -356,6 +372,9 @@ spec:
- name: log-source-port
containerPort: 8082
protocol: TCP
- containerPort: 16010
name: mcp-over-xds
protocol: TCP
readinessProbe:
httpGet:
path: "/modules/readyz"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ spec:
targetPort: aux-port
protocol: TCP
name: aux-port
- name: mcp-over-xds
port: 16010
protocol: TCP
targetPort: 16010
selector:
app: slime-hango

Expand Down
24 changes: 20 additions & 4 deletions install/helm/hango-gateway/charts/hango-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ data_dir: /data
cluster_dns_domain: cluster.local

images:
hango_apiplane_image: docker.io/hangoio/api-plane:latest
hango_portal_image: docker.io/hangoio/hango-portal:latest
hango_ui_image: docker.io/hangoio/hango-ui:v1.0.1-f7ddf75e
hango_apiplane_image: docker.io/hangoio/api-plane:1.1.0
hango_portal_image: docker.io/hangoio/hango-portal:v1.0.3-40b0cdb96
hango_ui_image: docker.io/hangoio/hango-ui:v1.0.3-1e003c49
istiod_image: docker.io/hangoio/istiod:hango-1.0.0-rc1
slime_image: docker.io/slimeio/slime-bundle-hango:v0.5.0_linux_amd64
slime_image: docker.io/slimeio/slime-bundle-hango:hango-ee2bff9_linux_amd64
hango_proxy_image: hangoio/envoy-proxy:v1.1.0-46f6660-amd64


Expand All @@ -28,3 +28,19 @@ slime:
logLevel: info
misc:
seLabelSelectorKeys: projectName

registry:
nacos:
## nacosע�����Ĺ��ܿ��أ�true �� false��
enable: false
## ע������ʵ����ַ����ʽ��������Ӣ�ĵ����Ű�����������ַ��Ӣ��˫���Ű����������ַ��Ӣ�Ķ��ŷָ�
address: '"http://127.0.0.1:8848"'
## nacos�ͻ��˷������ڷ���
service_group: hango_demo
eureka:
## eurekaע�����Ĺ��ܿ��أ�true �� false��
enable: false
## ˢ��eureka���񻺴��ʱ�����ڣ�Ĭ��15s����ʽΪ: [������]s
refresh_period: 15s
## ע������ʵ����ַ����ʽ��������Ӣ�ĵ����Ű�����������ַ��Ӣ��˫���Ű����������ַ��Ӣ�Ķ��ŷָ�
address: '"http://127.0.0.1:8761/eureka"'