Skip to content

Commit

Permalink
Added side car containers- log capture, log rotator and fluentbit
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshmcg committed Jul 30, 2024
1 parent e22041a commit c9b667a
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
49 changes: 49 additions & 0 deletions chart/cas-cif/templates/fluent-bit-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: c53ff1-dev
data:
fluent-bit.conf: |
[SERVICE]
Flush 5
Daemon Off
Parsers_File /var/log/parsers.conf
Log_Level info
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
Storage_Type filesystem
[INPUT]
Name tail
Path /var/log/oc-cif-test.log
Tag oc-cif-test
Mem_Buf_Limit 5MB
DB /var/log/flb_kube.db
Refresh_Interval 10
Rotate_Wait 5
Ignore_Older 24h
[OUTPUT]
Name es
Match *
Host elasticsearch.9212c9-tools.svc.cluster.local
Port 9200
Index ciif-logs
Logstash_Prefix ciif-logs
Logstash_DateFormat %Y.%m.%d
Logstash_Format On
Retry_Limit False
Suppress_Type_Name On
Type _doc
Time_Key @timestamp
Time_Key_Format iso8601
parsers.conf: |
[PARSER]
Name json
Format json
Time_Key timestamp
Decode_Field_as escaped_utf8 log do_next
Decode_Field_as json log
Empty file.
12 changes: 12 additions & 0 deletions chart/cas-cif/templates/pod-logger-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-logger-role
namespace: c53ff1-dev
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["pods/logs"]
verbs: ["get", "list"]
12 changes: 12 additions & 0 deletions chart/cas-cif/templates/pod-logger-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pod-logger-rolebinding
subjects:
- kind: ServiceAccount
name: pod-logger
namespace: c53ff1-dev
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pod-logger-role
5 changes: 5 additions & 0 deletions chart/cas-cif/templates/service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-logger # Name of the service account
namespace: c53ff1-dev

0 comments on commit c9b667a

Please sign in to comment.