apiVersion: v1
kind: ReplicationController
metadata:
  name: zabbix-server
  namespace: monitoring
  labels:
    app: zabbix
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: zabbix-server
        app: zabbix
    spec:
      #fixed ip address
      nodeName: node01
      hostPID: true
      hostIPC: true
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      containers:
        - name: zabbix-server
          #image: monitoringartist/zabbix-xxl:latest
          image: zabbix/zabbix-proxy-mysql:alpine-4.2.0
          ports:
          - containerPort: 162
            name: snmptrapd
          - containerPort: 10051
            name: zabbix-trapper
          - containerPort: 10052
            name: zabbix-jmx
          env:
          - name: DB_SERVER_HOST
            value: "zabbix-proxy-db"
          - name: MYSQL_DATABASE
            value: "zabbix_proxy"
          - name: MYSQL_USER
            value: "zabbix"
          - name: MYSQL_PASSWORD
            value: "my_password"
          - name: ZBX_HOSTNAME
            value: "zabbix-proxy-k8s" 
          - name: ZBX_PROXYMODE #代理模式 默认0主动，1被动
            value: "0"
          - name: ZBX_LOADMODULE
            value: ""
          - name: ZBX_DEBUGLEVEL
            value: "3"
          - name: ZBX_TIMEOUT
            value: "8"
          - name: ZBX_ENABLEREMOTECOMMANDS # Available since 3.4.0
            value: "0"
          - name: ZBX_LOGREMOTECOMMANDS # Available since 3.4.0
            value: "0"
          - name: ZBX_HOSTNAMEITEM
            value: "system.hostname"
          - name: ZBX_PROXYLOCALBUFFER #代理配置文件中的ProxyLocalBuffer和ProxyOfflineBuffer参数控制数据在本地保存多长时间
            value: "1"
          - name: ZBX_PROXYOFFLINEBUFFER
            value: "24"
          - name: ZBX_PROXYHEARTBEATFREQUENCY
            value: "60"
          - name: ZBX_CONFIGFREQUENCY #主动去server端去拉取配置更新的频率
            value: "600"
          - name: ZBX_DATASENDERFREQUENCY #发送采集的监控数据到服务器端，默认是1秒
            value: "10"
          - name: ZBX_STARTPOLLERS
            value: "10"
          - name: ZBX_IPMIPOLLERS
            value: "0"
          - name: ZBX_STARTPREPROCESSORS
            value: "3" # Available since 3.4.0
          - name: ZBX_STARTPOLLERSUNREACHABLE
            value: "1"
          - name: ZBX_STARTTRAPPERS
            value: "5"
          - name: ZBX_STARTPINGERS
            value: "10"
          - name: ZBX_STARTDISCOVERERS
            value: "20"
          - name: ZBX_STARTHTTPPOLLERS
            value: "1"
          - name: ZBX_JAVAGATEWAY
            value: "zabbix-java-gateway"
          - name: ZBX_JAVAGATEWAYPORT
            value: "10052"
          - name: ZBX_STARTJAVAPOLLERS
            value: "0"
          - name: ZBX_STARTVMWARECOLLECTORS
            value: "0"
          - name: ZBX_VMWAREFREQUENCY
            value: "60"
          - name: ZBX_VMWAREPERFFREQUENCY
            value: "60"
          - name: ZBX_VMWARECACHESIZE
            value: "8M"
          - name: ZBX_VMWARETIMEOUT
            value: "10"
          - name: ZBX_ENABLE_SNMP_TRAPS
            value: "false"
          - name: ZBX_HOUSEKEEPINGFREQUENCY
            value: "1"
          - name: ZBX_CACHESIZE
            value: "128M"
          - name: ZBX_STARTDBSYNCERS
            value: "8"
          - name: ZBX_HISTORYCACHESIZE
            value: "128M"
          - name: ZBX_HISTORYINDEXCACHESIZE
            value: "8M"
          - name: ZBX_TRAPPERIMEOUT
            value: "300"
          - name: ZBX_UNREACHABLEPERIOD
            value: "45"
          - name: ZBX_UNAVAILABLEDELAY
            value: "60"
          - name: ZBX_UNREACHABLEDELAY
            value: "15"
          - name: ZBX_LOGSLOWQUERIES
            value: "3000"
          - name: ZBX_SERVER_HOST
            value: "zabbix-server"
