apiVersion: extensions/v1beta1 kind: Ingress metadata: name: zabbix-web namespace: monitoring spec: rules: - host: zabbix.lzxlinux.cn http: paths: - path: / backend: serviceName: zabbix-web servicePort: 8080 --- apiVersion: v1 kind: Service metadata: name: zabbix-web namespace: monitoring labels: app: zabbix-web spec: selector: app: zabbix-web ports: - name: web port: 8080 protocol: TCP --- apiVersion: apps/v1 kind: Deployment metadata: name: zabbix-web namespace: monitoring spec: replicas: 1 selector: matchLabels: app: zabbix-web template: metadata: labels: app: zabbix-web spec: containers: - name: zabbix-web image: zabbix/zabbix-web-nginx-mysql:latest imagePullPolicy: IfNotPresent env: - name: DB_SERVER_HOST value: mysql - name: MYSQL_DATABASE value: zabbix - name: MYSQL_USER value: zabbix - name: MYSQL_PASSWORD value: zabbix - name: MYSQL_ROOT_PASSWORD value: zabbix - name: ZBX_SERVER_HOST value: zabbix-server - name: PHP_TZ value: "Asia/Shanghai" ports: - containerPort: 8080 name: web protocol: TCP resources: requests: cpu: 500m memory: 500Mi limits: cpu: 500m memory: 500Mi