apiVersion: v1
kind: ReplicationController
metadata:
  name: zabbix-web
  labels:
    app: zabbix
    tier: zabbix-web
  namespace: zabbix
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: zabbix-web
        app: zabbix
    spec:
      containers:
        - name: zabbix-web
          image: zabbix/zabbix-web-nginx-mysql:alpine-5.0-latest
          imagePullPolicy: Always
          ports:
          - containerPort: 8080
            name: web-http
          - containerPort: 8443
            name: web-https
          env:
          - name: ZBX_SERVER_NAME
            value: "Zabbix kubernetes"
          # - name: DB_SERVER_HOST
          #   value: 
          # - name: DB_SERVER_PORT
          #   value: ""
          - name: PHP_TZ
            value: "Europe/Riga"
          - name: MYSQL_USER
            valueFrom:
             secretKeyRef:
              name: db-secret
              key: db-zbx-user
          - name: MYSQL_PASSWORD
            valueFrom:
             secretKeyRef:
              name: db-secret
              key: db-zbx-pass
          - name: MYSQL_ROOT_PASSWORD
            valueFrom:
             secretKeyRef:
              name: db-secret
              key: db-root-pass
          - name: MYSQL_DATABASE
            value: "zabbix"