github.com/polarismesh/polaris@v1.17.8/release/cluster/helm/templates/config-polaris-server.yaml (about) 1 apiVersion: v1 2 kind: ConfigMap 3 metadata: 4 name: polaris-server-config 5 namespace: {{ .Values.installation.namespace }} 6 data: 7 polaris-server.yaml: |- 8 # server启动引导配置 9 bootstrap: 10 # 全局日志 11 logger: 12 config: 13 rotateOutputPath: log/runtime/polaris-config.log 14 errorRotateOutputPath: log/runtime/polaris-config-error.log 15 rotationMaxSize: 100 16 rotationMaxBackups: 10 17 rotationMaxAge: 7 18 outputLevel: info 19 outputPaths: 20 - stdout 21 errorOutputPaths: 22 - stderr 23 auth: 24 rotateOutputPath: log/runtime/polaris-auth.log 25 errorRotateOutputPath: log/runtime/polaris-auth-error.log 26 rotationMaxSize: 100 27 rotationMaxBackups: 10 28 rotationMaxAge: 7 29 outputLevel: info 30 outputPaths: 31 - stdout 32 errorOutputPaths: 33 - stderr 34 store: 35 rotateOutputPath: log/runtime/polaris-store.log 36 errorRotateOutputPath: log/runtime/polaris-store-error.log 37 rotationMaxSize: 100 38 rotationMaxBackups: 10 39 rotationMaxAge: 7 40 outputLevel: info 41 outputPaths: 42 - stdout 43 errorOutputPaths: 44 - stderr 45 cache: 46 rotateOutputPath: log/runtime/polaris-cache.log 47 errorRotateOutputPath: log/runtime/polaris-cache-error.log 48 rotationMaxSize: 100 49 rotationMaxBackups: 10 50 rotationMaxAge: 7 51 outputLevel: info 52 outputPaths: 53 - stdout 54 errorOutputPaths: 55 - stderr 56 naming: 57 rotateOutputPath: log/runtime/polaris-naming.log 58 errorRotateOutputPath: log/runtime/polaris-naming-error.log 59 rotationMaxSize: 100 60 rotationMaxBackups: 10 61 rotationMaxAge: 7 62 outputLevel: info 63 outputPaths: 64 - stdout 65 errorOutputPaths: 66 - stderr 67 healthcheck: 68 rotateOutputPath: log/runtime/polaris-healthcheck.log 69 errorRotateOutputPath: log/runtime/polaris-healthcheck-error.log 70 rotationMaxSize: 100 71 rotationMaxBackups: 10 72 rotationMaxAge: 7 73 outputLevel: info 74 outputPaths: 75 - stdout 76 errorOutputPaths: 77 - stderr 78 xdsv3: 79 rotateOutputPath: log/runtime/polaris-xdsv3.log 80 errorRotateOutputPath: log/runtime/polaris-xdsv3-error.log 81 rotationMaxSize: 100 82 rotationMaxBackups: 10 83 rotationMaxAge: 7 84 outputLevel: info 85 outputPaths: 86 - stdout 87 errorOutputPaths: 88 - stderr 89 apiserver: 90 rotateOutputPath: log/runtime/polaris-apiserver.log 91 errorRotateOutputPath: log/runtime/polaris-apiserver-error.log 92 rotationMaxSize: 100 93 rotationMaxBackups: 10 94 rotationMaxAge: 7 95 outputLevel: info 96 outputPaths: 97 - stdout 98 errorOutputPaths: 99 - stderr 100 token-bucket: 101 rotateOutputPath: log/runtime/polaris-ratelimit.log 102 errorRotateOutputPath: log/runtime/polaris-ratelimit-error.log 103 rotationMaxSize: 100 104 rotationMaxBackups: 10 105 rotationMaxAge: 7 106 outputLevel: info 107 outputPaths: 108 - stdout 109 errorOutputPaths: 110 - stderr 111 default: 112 rotateOutputPath: log/runtime/polaris-default.log 113 errorRotateOutputPath: log/runtime/polaris-default-error.log 114 rotationMaxSize: 100 115 rotationMaxBackups: 10 116 rotationMaxAge: 7 117 outputLevel: info 118 outputPaths: 119 - stdout 120 errorOutputPaths: 121 - stderr 122 discoverEventLocal: 123 rotateOutputPath: log/event/polaris-discoverevent.log 124 errorRotateOutputPath: log/event/polaris-discoverevent-error.log 125 rotationMaxSize: 100 126 rotationMaxBackups: 10 127 rotationMaxAge: 7 128 outputLevel: info 129 outputPaths: 130 - stdout 131 errorOutputPaths: 132 - stderr 133 discoverLocal: 134 rotateOutputPath: log/statis/polaris-discoverstat.log 135 errorRotateOutputPath: log/statis/polaris-discoverstat-error.log 136 rotationMaxSize: 100 137 rotationMaxBackups: 10 138 rotationMaxAge: 7 139 outputLevel: info 140 outputPaths: 141 - stdout 142 errorOutputPaths: 143 - stderr 144 local: 145 rotateOutputPath: log/statis/polaris-statis.log 146 errorRotateOutputPath: log/statis/polaris-statis-error.log 147 rotationMaxSize: 100 148 rotationMaxBackups: 10 149 rotationMaxAge: 7 150 outputLevel: info 151 outputPaths: 152 - stdout 153 errorOutputPaths: 154 - stderr 155 HistoryLogger: 156 rotateOutputPath: log/operation/polaris-history.log 157 errorRotateOutputPath: log/operation/polaris-history-error.log 158 rotationMaxSize: 100 159 rotationMaxBackups: 10 160 rotationMaxAge: 7 161 rotationMaxDurationForHour: 24 162 outputLevel: info 163 outputPaths: 164 - stdout 165 errorOutputPaths: 166 - stderr 167 # 按顺序启动server 168 startInOrder: 169 open: true # 是否开启,默认是关闭 170 key: sz # 全局锁 171 # 注册为北极星服务 172 polaris_service: 173 {{- if eq .Values.global.mode "cluster" }} 174 probe_address: {{ .Values.polaris.storage.db.address }} 175 {{- end }} 176 enable_register: true 177 isolated: false 178 services: 179 - name: polaris.checker 180 protocols: 181 - service-grpc 182 # apiserver配置 183 apiservers: 184 - name: service-eureka 185 option: 186 listenIP: "0.0.0.0" 187 listenPort: {{ .Values.service.eurekaPort }} 188 namespace: default 189 owner: polaris 190 refreshInterval: 10 191 deltaExpireInterval: 60 192 unhealthyExpireInterval: 180 193 connLimit: 194 openConnLimit: false 195 maxConnPerHost: 1024 196 maxConnLimit: 10240 197 whiteList: 127.0.0.1 198 purgeCounterInterval: 10s 199 purgeCounterExpired: 5s 200 - name: api-http # 协议名,全局唯一 201 option: 202 listenIP: "0.0.0.0" 203 listenPort: {{ .Values.service.httpPort }} 204 enablePprof: true # debug pprof 205 enableSwagger: true 206 connLimit: 207 openConnLimit: false 208 maxConnPerHost: 128 209 maxConnLimit: 5120 210 whiteList: 127.0.0.1 211 purgeCounterInterval: 10s 212 purgeCounterExpired: 5s 213 api: 214 admin: 215 enable: true 216 console: 217 enable: true 218 include: [default] 219 client: 220 enable: true 221 include: [discover, register, healthcheck] 222 config: 223 enable: true 224 include: [default] 225 - name: service-grpc 226 option: 227 listenIP: "0.0.0.0" 228 listenPort: {{ .Values.service.serviceGrpcPort }} 229 connLimit: 230 openConnLimit: false 231 maxConnPerHost: 128 232 maxConnLimit: 5120 233 api: 234 client: 235 enable: true 236 include: [discover, register, healthcheck] 237 - name: config-grpc 238 option: 239 listenIP: "0.0.0.0" 240 listenPort: {{ .Values.service.configGrpcPort }} 241 connLimit: 242 openConnLimit: false 243 maxConnPerHost: 128 244 maxConnLimit: 5120 245 api: 246 client: 247 enable: true 248 - name: xds-v3 249 option: 250 listenIP: "0.0.0.0" 251 listenPort: {{ .Values.service.xdsv3Port }} 252 connLimit: 253 openConnLimit: false 254 maxConnPerHost: 128 255 maxConnLimit: 10240 256 # - name: service-l5 257 # option: 258 # listenIP: 0.0.0.0 259 # listenPort: 7779 260 # clusterName: cl5.discover 261 # 核心逻辑的配置 262 auth: 263 name: defaultAuth 264 option: 265 salt: polarismesh@2021 266 consoleOpen: {{ .Values.polaris.auth.consoleOpen }} 267 clientOpen: {{ .Values.polaris.auth.clientOpen }} 268 namespace: 269 autoCreate: true 270 naming: 271 auth: 272 open: false 273 # 批量控制器 274 batch: 275 register: 276 open: true 277 queueSize: 10240 278 waitTime: 32ms 279 maxBatchCount: 32 280 concurrency: 64 281 deregister: 282 open: true 283 queueSize: 10240 284 waitTime: 32ms 285 maxBatchCount: 32 286 concurrency: 64 287 clientRegister: 288 open: true 289 queueSize: 10240 290 waitTime: 32ms 291 maxBatchCount: 32 292 concurrency: 64 293 clientDeregister: 294 open: true 295 queueSize: 10240 296 waitTime: 32ms 297 maxBatchCount: 32 298 concurrency: 64 299 # 配置中心模块启动配置 300 config: 301 # 是否启动配置模块 302 open: true 303 # 健康检查的配置 304 healthcheck: 305 open: true 306 service: polaris.checker 307 slotNum: 30 308 minCheckInterval: 1s 309 maxCheckInterval: 30s 310 batch: 311 heartbeat: 312 open: true 313 queueSize: 10240 314 waitTime: 32ms 315 maxBatchCount: 32 316 concurrency: 64 317 checkers: 318 {{- if eq .Values.global.mode "cluster" }} 319 {{- if eq .Values.polaris.healthChecker "heartbeatRedis" }} 320 - name: heartbeatRedis 321 option: 322 kvAddr: {{ .Values.polaris.storage.redis.address }} 323 {{- if .Values.polaris.storage.redis.user }} 324 kvUser: {{ .Values.polaris.storage.redis.user }} 325 {{- end }} 326 {{- if .Values.polaris.storage.redis.password }} 327 kvPasswd: {{ .Values.polaris.storage.redis.password }} 328 {{- end }} 329 poolSize: 200 330 minIdleConns: 30 331 idleTimeout: 120s 332 connectTimeout: 200ms 333 msgTimeout: 200ms 334 concurrency: 200 335 withTLS: {{ .Values.polaris.storage.redis.withTLS | default false }} 336 {{- else }} 337 - name: heartbeatLeader 338 {{- end}} 339 {{- else }} 340 - name: heartbeatMemory 341 {{- end }} 342 # 缓存配置 343 cache: 344 open: true 345 resources: 346 - name: service # Load service data 347 option: 348 disableBusiness: false # Do not load business services 349 needMeta: true # Load service metadata 350 - name: instance # Load instance data 351 option: 352 disableBusiness: false # Do not load business service examples 353 needMeta: true # Load instance metadata 354 - name: routingConfig # Load route data 355 - name: rateLimitConfig # Load current limit data 356 - name: circuitBreakerConfig # Load the fuse data 357 - name: users # Load user and user group data 358 - name: strategyRule # Loading the rules of appraisal 359 - name: namespace # Load the naming space data 360 - name: client # Load Client-SDK instance data 361 - name: configFile 362 - name: configGroup 363 - name: faultDetectRule 364 # - name: l5 # 加载l5数据 365 # 存储配置 366 store: 367 {{- if eq .Values.global.mode "cluster" }} 368 # 数据库存储插件 369 {{- with .Values.polaris.storage.db.server }} 370 name: defaultStore 371 option: 372 master: 373 dbType: mysql 374 dbUser: {{ .user }} 375 dbPwd: {{ .password }} 376 dbAddr: {{ .address }} 377 dbName: {{ .name }} 378 maxOpenConns: -1 379 maxIdleConns: -1 380 connMaxLifetime: 300 # 单位秒 381 txIsolationLevel: 2 #LevelReadCommitted 382 {{- end }} 383 {{- else }} 384 # 单机文件存储插件 385 name: boltdbStore 386 option: 387 path: ./polaris.bolt 388 {{- end }} 389 # 插件配置 390 plugin: 391 crypto: 392 entries: 393 - name: AES 394 history: 395 entries: 396 - name: HistoryLogger 397 discoverEvent: 398 entries: 399 - name: discoverEventLocal 400 discoverStatis: 401 name: discoverLocal 402 option: 403 interval: 60 # 统计间隔,单位为秒 404 outputPath: ./discover-statis 405 statis: 406 entries: 407 - name: local 408 option: 409 interval: 60 410 - name: prometheus 411 ratelimit: 412 name: token-bucket 413 option: 414 remote-conf: false # 是否使用远程配置 415 ip-limit: # ip级限流,全局 416 open: false # 系统是否开启ip级限流 417 global: 418 open: false 419 bucket: 300 # 最高峰值 420 rate: 200 # 平均一个IP每秒的请求数 421 resource-cache-amount: 1024 # 最大缓存的IP个数 422 white-list: [127.0.0.1] 423 instance-limit: 424 open: false 425 global: 426 bucket: 200 427 rate: 100 428 resource-cache-amount: 1024 429 api-limit: # 接口级限流 430 open: false # 是否开启接口限流,全局开关,只有为true,才代表系统的限流开启。默认关闭 431 rules: 432 - name: store-read 433 limit: 434 open: false # 接口的全局配置,如果在api子项中,不配置,则该接口依据global来做限制 435 bucket: 2000 # 令牌桶最大值 436 rate: 1000 # 每秒产生的令牌数 437 - name: store-write 438 limit: 439 open: false 440 bucket: 1000 441 rate: 500 442 apis: 443 - name: "POST:/v1/naming/services" 444 rule: store-write 445 - name: "PUT:/v1/naming/services" 446 rule: store-write 447 - name: "POST:/v1/naming/services/delete" 448 rule: store-write 449 - name: "GET:/v1/naming/services" 450 rule: store-read 451 - name: "GET:/v1/naming/services/count" 452 rule: store-read 453 454