github.com/polarismesh/polaris@v1.17.8/release/cluster/kubernetes/02-polaris-server-config.yaml (about)

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