apiVersion: apps/v1
kind: Deployment
metadata:
  name: kibana
  namespace: db-es
spec:
  replicas: 0
  selector:
    matchLabels:
      app: kibana
  template:
    metadata:
      labels:
        app: kibana
    spec:
      containers:
        - name: kibana
          image: hub.yizhisec.com/external/kibana:7.17.28
          imagePullPolicy: IfNotPresent
          env:
            - name: ELASTICSEARCH_HOSTS
              value: http://es-service:9200
            - name: SERVER_HOST
              value: 0.0.0.0
          ports:
            - containerPort: 5601
              name: http
          resources:
            limits:
              memory: 2Gi
              cpu: 1
---
apiVersion: v1
kind: Service
metadata:
  name: kibana-service
  namespace: db-es
spec:
  type: NodePort
  selector:
    app: kibana
  ports:
    - name: http
      protocol: TCP
      port: 5601
      targetPort: 5601
      nodePort: 31601
