apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
  namespace: elastic-system
spec:
  version: 8.8.0
  count: 1
  elasticsearchRef:
    name: elasticsearch
    namespace: elastic-system
  http:
    tls:
      selfSignedCertificate:
        disabled: true
  config:
    server.publicBaseUrl: https://elk.epam.devops.delivery
    xpack.reporting.kibanaServer.port: 5601
    xpack.reporting.kibanaServer.protocol: http
    xpack.reporting.kibanaServer.hostname: kibana-kb-http.elastic-system.svc
    xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-es-http.elastic-system.svc:9200"]
    xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.elastic-system.svc:8220"]
    xpack.fleet.packages:
    - name: system
      version: latest
    - name: elastic_agent
      version: latest
    - name: fleet_server
      version: latest
    - name: kubernetes
      version: latest
    xpack.fleet.agentPolicies:
    - name: Fleet Server on ECK policy
      id: eck-fleet-server
      namespace: default
      monitoring_enabled:
      - logs
      - metrics
      unenroll_timeout: 900
      package_policies:
      - name: fleet_server-1
        id: fleet_server-1
        package:
          name: fleet_server
    - name: Elastic Agent on ECK policy
      id: eck-agent
      namespace: default
      monitoring_enabled:
      - logs
      - metrics
      unenroll_timeout: 900
      package_policies:
      - package:
          name: system
        name: system-1
      - package:
          name: kubernetes
        name: kubernetes-1
  podTemplate:
    metadata:
      labels:
        app.kubernetes.io/name: kibana
        app.kubernetes.io/version: "8.8.0"
        app.kubernetes.io/component: "ui"
        app.kubernetes.io/part-of: "elk"
    spec:
      containers:
      - name: kibana
        resources:
          requests:
            memory: 1Gi
            cpu: 500m
            ephemeral-storage: 1Gi
          limits:
            memory: 1Gi
            cpu: 500m
            ephemeral-storage: 1Gi
---
apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
metadata:
  name: elastic-stack
  namespace: elastic-system
spec:
  redirectToHttps:
    enabled: true
    responseCodeName: MOVED_PERMANENTLY_DEFAULT
---
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: elastic-stack
  namespace: elastic-system
spec:
  domains:
    - elk.BASE_DOMAIN
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: kibana
  namespace: elastic-system
  annotations:
    networking.gke.io/managed-certificates: elastic-stack
    networking.gke.io/v1beta1.FrontendConfig: elastic-stack
    kubernetes.io/ingress.global-static-ip-name: elastic-stack
    kubernetes.io/ingress.class: gce
spec:
  defaultBackend:
    service:
      name: kibana-kb-http
      port:
        number: 5601
