Created
August 1, 2022 13:04
-
-
Save edib/78923a5a8069d959e82d1f9dc8dcd38f to your computer and use it in GitHub Desktop.
fibeat deployment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: filebeat-config | |
namespace: kube-system | |
labels: | |
k8s-app: filebeat | |
data: | |
filebeat.yml: |- | |
filebeat.inputs: | |
- type: syslog | |
format: rfc3164 | |
protocol.udp: | |
host: "0.0.0.0:514" | |
output.elasticsearch: | |
hosts: ["https://myEShost:9200"] | |
username: "filebeat_writer" | |
password: "YOUR_PASSWORD" | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: filebeat | |
namespace: kube-system | |
labels: | |
k8s-app: filebeat | |
spec: | |
selector: | |
matchLabels: | |
k8s-app: filebeat | |
template: | |
metadata: | |
labels: | |
k8s-app: filebeat | |
spec: | |
containers: | |
- name: filebeat | |
image: docker.elastic.co/beats/filebeat:8.3.3 | |
args: [ | |
"-c", "/etc/filebeat.yml", | |
"-e", | |
] | |
env: | |
- name: ELASTICSEARCH_HOST | |
value: elasticsearch | |
- name: ELASTICSEARCH_PORT | |
value: "9200" | |
- name: ELASTICSEARCH_USERNAME | |
value: elastic | |
- name: ELASTICSEARCH_PASSWORD | |
value: changeme | |
- name: ELASTIC_CLOUD_ID | |
value: | |
- name: ELASTIC_CLOUD_AUTH | |
value: | |
securityContext: | |
runAsUser: 0 | |
# If using Red Hat OpenShift uncomment this: | |
#privileged: true | |
resources: | |
limits: | |
memory: 200Mi | |
requests: | |
cpu: 100m | |
memory: 100Mi | |
volumeMounts: | |
- name: config | |
mountPath: /etc/filebeat.yml | |
readOnly: true | |
subPath: filebeat.yml | |
volumes: | |
- name: config | |
configMap: | |
defaultMode: 0640 | |
name: filebeat-config | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: filebeat | |
namespace: kube-system | |
labels: | |
k8s-app: filebeat | |
spec: | |
type: NodePort | |
ports: | |
- port: 514 | |
targetPort: 514 | |
protocol: UDP | |
name: syslog | |
selector: | |
k8s-app: filebeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment