elastic / cloud-on-k8s

Elastic Cloud on Kubernetes
Other
2.52k stars 686 forks source link

Fix Logstash service to preserve user defined labels #7895

Closed kaisecheng closed 3 weeks ago

kaisecheng commented 3 weeks ago

This commit preserves user labels in Logstash Service

Fixes: #7855

The following resource should keep customized label in service logstash-sample-ls-beats

apiVersion: logstash.k8s.elastic.co/v1alpha1
kind: Logstash
metadata:
  name: logstash-sample
spec:
  count: 1
  version: 8.14.0
  pipelines:
    - pipeline.id: main
      pipeline.workers: 2
      config.string: "input { beats { port => 5044 }} output { stdout {}}"
  services:
    - name: beats
      service:
        metadata:
          labels:
            i.am.label: here
        spec:
          type: ClusterIP
          ports:
            - port: 5044
              name: "filebeat"
              protocol: TCP
              targetPort: 5044
kaisecheng commented 3 weeks ago

@pebrc this PR is ready to merge. thank you