|
| 1 | +replicas: 1 |
| 2 | + |
| 3 | +resources: |
| 4 | + requests: |
| 5 | + cpu: 100m |
| 6 | + memory: 1Gi |
| 7 | + limits: |
| 8 | + memory: 2Gi |
| 9 | + |
| 10 | + |
| 11 | +# persistence: |
| 12 | + # enabled: true |
| 13 | + |
| 14 | +logstashConfig: |
| 15 | + logstash.yml: | |
| 16 | + http.host: 0.0.0.0 |
| 17 | + xpack.monitoring.enabled: true |
| 18 | + xpack.monitoring.elasticsearch.username: '$${ELASTICSEARCH_USERNAME}' |
| 19 | + xpack.monitoring.elasticsearch.password: '$${ELASTICSEARCH_PASSWORD}' |
| 20 | + xpack.monitoring.elasticsearch.ssl.certificate_authority: '/etc/logstash/certificates/ca.crt' |
| 21 | + xpack.monitoring.elasticsearch.hosts: ["https://elasticsearch-es-internal-http.elk.svc:9200"] |
| 22 | +
|
| 23 | +logstashPipeline: |
| 24 | + logstash.conf: | |
| 25 | + input { |
| 26 | + tcp { |
| 27 | + port => 5400 |
| 28 | + codec => json |
| 29 | + } |
| 30 | + beats { |
| 31 | + port => 5044 |
| 32 | + } |
| 33 | + } |
| 34 | +
|
| 35 | + output { |
| 36 | + elasticsearch { |
| 37 | + hosts => ["elasticsearch-es-internal-http.elk.svc:9200"] |
| 38 | + user => '$${ELASTICSEARCH_USERNAME}' |
| 39 | + password => '$${ELASTICSEARCH_PASSWORD}' |
| 40 | + index => "filebeat-%%{+yyyy.MM.dd}-000001" |
| 41 | + manage_template => true |
| 42 | + template => '/etc/elk/logstash-index-template.json' |
| 43 | + template_name => 'filebeat' |
| 44 | + template_overwrite => true |
| 45 | + action => "create" |
| 46 | + ssl => true |
| 47 | + ssl_certificate_verification => false |
| 48 | + cacert => '/etc/logstash/certificates/ca.crt' |
| 49 | + } |
| 50 | + stdout { codec => rubydebug } |
| 51 | + } |
| 52 | +
|
| 53 | +# https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html |
| 54 | + |
| 55 | +secrets: |
| 56 | + - name: "index-template" |
| 57 | + value: |
| 58 | + logstash-index-template.json: | |
| 59 | + { |
| 60 | + "index_patterns": ["filebeat-*"], |
| 61 | + "data_stream": {}, |
| 62 | + "template": { |
| 63 | + "settings": { |
| 64 | + "index.refresh_interval": "5s", |
| 65 | + "index.mapping.total_fields.limit": 5000, |
| 66 | + "index.lifecycle.name": "filebeat-policy", |
| 67 | + "number_of_shards": 1, |
| 68 | + "number_of_replicas": 1 |
| 69 | + } |
| 70 | + } |
| 71 | + } |
| 72 | +
|
| 73 | +secretMounts: |
| 74 | + - name: logstash-index-template |
| 75 | + secretName: logstash-logstash-index-template |
| 76 | + path: /etc/elk |
| 77 | + |
| 78 | +extraPorts: |
| 79 | + - name: beats |
| 80 | + containerPort: 5044 |
| 81 | + - name: tcp |
| 82 | + containerPort: 5400 |
| 83 | + |
| 84 | +service: |
| 85 | + ports: |
| 86 | + - name: beats |
| 87 | + port: 5044 |
| 88 | + protocol: TCP |
| 89 | + targetPort: 5044 |
| 90 | + - name: tcp |
| 91 | + port: 5400 |
| 92 | + protocol: TCP |
| 93 | + targetPort: 5400 |
| 94 | + |
| 95 | +extraEnvs: |
| 96 | + - name: 'ELASTICSEARCH_USERNAME' |
| 97 | + valueFrom: |
| 98 | + secretKeyRef: |
| 99 | + name: elastic-credentials |
| 100 | + key: username |
| 101 | + - name: 'ELASTICSEARCH_PASSWORD' |
| 102 | + valueFrom: |
| 103 | + secretKeyRef: |
| 104 | + name: elastic-credentials |
| 105 | + key: password |
| 106 | + - name: 'ELASTICSEARCH_HOST' |
| 107 | + valueFrom: |
| 108 | + secretKeyRef: |
| 109 | + name: elastic-credentials |
| 110 | + key: host |
| 111 | + |
| 112 | +extraVolumes: |
| 113 | + - name: ca-certs |
| 114 | + secret: |
| 115 | + secretName: elasticsearch-es-http-certs-public |
| 116 | + |
| 117 | +extraVolumeMounts: |
| 118 | + - name: ca-certs |
| 119 | + mountPath: /etc/logstash/certificates |
| 120 | + readOnly: true |
| 121 | + |
0 commit comments