2-11同步
This commit is contained in:
@@ -33,7 +33,7 @@ data:
|
||||
host: ${NODE_NAME}
|
||||
- decode_json_fields:
|
||||
fields: ["message"]
|
||||
target: "mylog"
|
||||
target: ""
|
||||
overwrite_keys: true
|
||||
add_error_key: true
|
||||
- drop_fields:
|
||||
@@ -74,9 +74,9 @@ data:
|
||||
- add_kubernetes_metadata:
|
||||
host: ${NODE_NAME}
|
||||
- dissect:
|
||||
tokenizer: '%{timestamp} %{level} %{pid} --- [%{thread}] %{class} : [%{app_name->}] %{message}'
|
||||
tokenizer: '%{timestamp} %{level} %{pid} --- [%{thread}] %{class} : [%{app_name->}] %{log_message}'
|
||||
field: "message"
|
||||
target_prefix: "mylog"
|
||||
target_prefix: ""
|
||||
ignore_missing: true
|
||||
overwrite_keys: true
|
||||
- drop_fields:
|
||||
@@ -111,9 +111,9 @@ data:
|
||||
- add_kubernetes_metadata:
|
||||
host: ${NODE_NAME}
|
||||
- dissect:
|
||||
tokenizer: '%{timestamp} %{level} %{pid} --- [%{thread}] %{class} : %{message}'
|
||||
tokenizer: '%{timestamp} %{level} %{pid} --- [%{thread}] %{class} : %{log_message}'
|
||||
field: "message"
|
||||
target_prefix: "mylog"
|
||||
target_prefix: ""
|
||||
ignore_missing: true
|
||||
overwrite_keys: true
|
||||
- drop_fields:
|
||||
|
||||
@@ -11,7 +11,7 @@ filebeat.autodiscover:
|
||||
- regexp:
|
||||
kubernetes.namespace: "^(sit|apex-evaluation)$"
|
||||
- regexp:
|
||||
kubernetes.labels.app: "^(lessie-go-api|apex|lessie-review-service)$"
|
||||
kubernetes.labels.app: "^(lessie-go-api|apex)$"
|
||||
config:
|
||||
- type: filestream
|
||||
id: "container-${data.kubernetes.container.id}"
|
||||
|
||||
27
k8s_yaml/double admin/01_dubbo_admin_ConfigMap.yaml
Normal file
27
k8s_yaml/double admin/01_dubbo_admin_ConfigMap.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: dubbo-admin-config
|
||||
namespace: opt
|
||||
data:
|
||||
application.properties: |
|
||||
# Dubbo Admin 服务端配置
|
||||
server.port=8080
|
||||
spring.application.name=dubbo-admin
|
||||
|
||||
# Nacos 注册中心配置(集群模式 - 使用 server-addr 参数)
|
||||
admin.registry.address=nacos://10.0.0.10:8848?namespace=sit&username=nacos&password=sRf6RtgwycTQRTGs&server-addr=10.0.0.10:8848;10.0.0.15:8848;10.0.0.8:8848
|
||||
|
||||
# Nacos 配置中心
|
||||
admin.config-center=nacos://10.0.0.10:8848?namespace=sit&username=nacos&password=sRf6RtgwycTQRTGs&server-addr=10.0.0.10:8848;10.0.0.15:8848;10.0.0.8:8848
|
||||
|
||||
# Nacos 元数据中心
|
||||
admin.metadata-report.address=nacos://10.0.0.10:8848?namespace=sit&username=nacos&password=sRf6RtgwycTQRTGs&server-addr=10.0.0.10:8848;10.0.0.15:8848;10.0.0.8:8848
|
||||
|
||||
# Dubbo Admin 登录密码(用户名默认为 root)
|
||||
admin.root.user.name=root
|
||||
admin.root.user.password=7sG4dPDggYFH
|
||||
|
||||
# 日志配置
|
||||
logging.level.root=INFO
|
||||
logging.level.org.apache.dubbo=INFO
|
||||
75
k8s_yaml/double admin/02_dubbo_admin_deployment.yaml
Normal file
75
k8s_yaml/double admin/02_dubbo_admin_deployment.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: dubbo-admin
|
||||
namespace: opt
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: dubbo-admin
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: dubbo-admin
|
||||
spec:
|
||||
containers:
|
||||
- name: dubbo-admin
|
||||
image: apache/dubbo-admin:0.6.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: JAVA_OPTS
|
||||
value: "-Xms512m -Xmx512m -Dfile.encoding=UTF-8"
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /config
|
||||
readOnly: true
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "1000m"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: dubbo-admin-config
|
||||
items:
|
||||
- key: application.properties
|
||||
path: application.properties
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: dubbo-admin-svc
|
||||
namespace: opt
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8080
|
||||
nodePort: 30080
|
||||
selector:
|
||||
app: dubbo-admin
|
||||
93
k8s_yaml/double admin/nacos_application.properties
Normal file
93
k8s_yaml/double admin/nacos_application.properties
Normal file
@@ -0,0 +1,93 @@
|
||||
########################################
|
||||
# Nacos 服务基础端口
|
||||
########################################
|
||||
# 服务主端口
|
||||
nacos.server.main.port=8848
|
||||
# 控制台端口
|
||||
nacos.console.port=8081
|
||||
# 控制台访问路径
|
||||
nacos.server.contextPath=/nacos
|
||||
|
||||
########################################
|
||||
# 数据源配置(使用外部 MySQL)
|
||||
########################################
|
||||
spring.datasource.platform=mysql
|
||||
db.num=1
|
||||
db.url.0=jdbc:mysql://10.0.0.4:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
|
||||
db.user=nacos
|
||||
db.password=s1nGohcFoJs@3h7s
|
||||
|
||||
########################################
|
||||
# Nacos 集群身份识别(必须一致)
|
||||
########################################
|
||||
nacos.core.auth.server.identity.key=serverIdentity
|
||||
nacos.core.auth.server.identity.value=nacos-cluster
|
||||
|
||||
########################################
|
||||
# 启用认证系统(JWT)配置
|
||||
########################################
|
||||
# 开启权限认证
|
||||
nacos.core.auth.enabled=true
|
||||
# 开启管理员 API 权限校验
|
||||
nacos.core.auth.admin.enabled=true
|
||||
# 开启控制台登录认证
|
||||
nacos.core.auth.console.enabled=true
|
||||
# 使用默认 nacos 认证方式
|
||||
nacos.core.auth.system.type=nacos
|
||||
|
||||
# JWT 密钥(长度必须 ≥ 32 字节,Base64 编码)
|
||||
nacos.core.auth.plugin.nacos.token.secret.key=RWZpVfZ7Uu98Edhz93hVdkGEO+3OZkZcXWld5Cz6U54=
|
||||
# Token 有效期(秒)
|
||||
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
|
||||
|
||||
########################################
|
||||
# 服务注册配置
|
||||
########################################
|
||||
# 自动清理空服务
|
||||
nacos.naming.empty-service.auto-clean=true
|
||||
nacos.naming.empty-service.clean.initial-delay-ms=50000
|
||||
nacos.naming.empty-service.clean.period-time-ms=30000
|
||||
# 启动时热加载注册信息
|
||||
nacos.naming.data.warmup=true
|
||||
# 实例健康检查(过期剔除)
|
||||
nacos.naming.expireInstance=true
|
||||
|
||||
########################################
|
||||
# 集群相关配置
|
||||
########################################
|
||||
# 如使用 cluster.conf,请确保存在于 conf/ 目录,格式为 IP:PORT,每行一个节点
|
||||
# 例如:
|
||||
# 192.168.31.10:8848
|
||||
# 192.168.31.11:8848
|
||||
# 192.168.31.12:8848
|
||||
|
||||
########################################
|
||||
# Web 服务配置
|
||||
########################################
|
||||
# 启用访问日志
|
||||
server.tomcat.accesslog.enabled=true
|
||||
# 保留日志天数
|
||||
server.tomcat.accesslog.max-days=30
|
||||
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
|
||||
server.tomcat.basedir=file:.
|
||||
|
||||
########################################
|
||||
# Spring Boot Actuator 端点暴露
|
||||
########################################
|
||||
management.endpoints.web.exposure.include=*
|
||||
|
||||
########################################
|
||||
# 配置推送和重试相关
|
||||
########################################
|
||||
nacos.config.push.maxRetryTime=50
|
||||
|
||||
########################################
|
||||
# 控制台 UI 开关
|
||||
########################################
|
||||
# nacos.console.ui.enabled=true # 如果要禁用控制台界面,可以启用此项
|
||||
|
||||
########################################
|
||||
# 指标相关配置
|
||||
########################################
|
||||
management.endpoints.web.exposure.include=prometheus
|
||||
management.endpoint.prometheus.enabled=true
|
||||
8
k8s_yaml/double admin/备注.md
Normal file
8
k8s_yaml/double admin/备注.md
Normal file
@@ -0,0 +1,8 @@
|
||||
java 业务 pod 运行在k8s sit命名空间,注册服务到nacos的sit命名空间。
|
||||
|
||||
Dubbo Admin 运行在哪个命名空间?,它需要跟业务pod互通吗?,还是只需要跟nacos互通就行?
|
||||
|
||||
nacos的集群部署的,地址是:10.0.0.10:8848,10.0.0.15:8848,10.0.0.8:8848,nacos版本是3.0.1,有账号密码。
|
||||
|
||||
Apache Dubbo Admin 运行在 opt 命名空间。
|
||||
|
||||
Reference in New Issue
Block a user