Skip to content

Commit 95f21d4

Browse files
Ekscplogs (#50)
* EKS control plane logs collection configuration --------- Co-authored-by: paliwalparitosh <[email protected]>
1 parent 6321522 commit 95f21d4

File tree

13 files changed

+900
-8
lines changed

13 files changed

+900
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Change Log
22

3+
## 2024-03-08
4+
### Added
5+
- Support for AWS EKS system and control plane logs collection.
6+
37
## 2024-02-13
48
### Added
59
- Changes to support Kubernetes Solution Pages Offering by OCI Logging Analytics.
610
- A new role and role binding in the monitoring namespace (which defaults to oci-onm), to manage a ConfigMap.
711
- A new CronJob to handle the Kubernetes Objects discovery and Objects Logs collection using oci-logging-analytics-kubernetes-discovery Gem.
812
### Changed
913
- Moving forward, Kubernetes Objects logs would be collected using Kubernetes Discovery CronJob along with the (optional) Discovery data instead of Fluentd based Deployment.
10-
1114
## 2024-01-18
1215
### Changed
1316
- Management Agent docker image has been updated to version 1.2.0

charts/logan/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: v2
55
name: oci-onm-logan
66
description: Charts for sending Kubernetes platform logs, compute logs, and Kubernetes Objects information to OCI Logging Analytics.
77
type: application
8-
version: 3.3.0
8+
version: 3.4.0
99
appVersion: "3.0.0"
1010

1111
dependencies:

charts/logan/templates/ekscp-logs-configmap.yaml

Lines changed: 307 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright (c) 2023, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
---
5+
{{- if .Values.enableEKSControlPlaneLogs }}
6+
{{- $authtype := .Values.authtype | lower }}
7+
{{- $imagePullSecrets := .Values.image.imagePullSecrets }}
8+
{{- $resourceNamePrefix := (include "logan.resourceNamePrefix" .) }}
9+
apiVersion: apps/v1
10+
kind: Deployment
11+
metadata:
12+
name: {{ $resourceNamePrefix }}-logan
13+
namespace: {{ include "logan.namespace" . }}
14+
labels:
15+
app: {{ $resourceNamePrefix }}-logan
16+
version: v1
17+
spec:
18+
selector:
19+
matchLabels:
20+
app: {{ $resourceNamePrefix }}-logan
21+
version: v1
22+
template:
23+
metadata:
24+
annotations:
25+
{{- if eq $authtype "config" }}
26+
checksum/secrets: {{ include (print $.Template.BasePath "/oci-config-secret.yaml") . | sha256sum }}
27+
{{- end}}
28+
checksum/ekscpconfigmap: {{ include (print $.Template.BasePath "/ekscp-logs-configmap.yaml") . | sha256sum }}
29+
labels:
30+
app: {{ $resourceNamePrefix }}-logan
31+
version: v1
32+
spec:
33+
serviceAccountName: {{ include "logan.serviceAccount" . }}
34+
{{- if $imagePullSecrets }}
35+
imagePullSecrets:
36+
- name: {{ .Values.image.imagePullSecrets }}
37+
{{- end}}
38+
containers:
39+
- name: {{ $resourceNamePrefix }}-ekscp-fluentd
40+
image: {{ .Values.image.url }}
41+
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
42+
env:
43+
- name: FLUENTD_CONF
44+
value: {{ .Values.fluentd.path }}/{{ .Values.fluentd.file }}
45+
- name: K8S_NODE_NAME
46+
valueFrom:
47+
fieldRef:
48+
fieldPath: spec.nodeName
49+
- name: FLUENT_OCI_DEFAULT_LOGGROUP_ID
50+
value: {{ .Values.ociLALogGroupID }}
51+
- name: FLUENT_OCI_NAMESPACE
52+
value: {{ .Values.ociLANamespace }}
53+
- name: FLUENT_OCI_KUBERNETES_CLUSTER_ID
54+
value: {{ include "logan.kubernetesClusterId" . }}
55+
- name: FLUENT_OCI_KUBERNETES_CLUSTER_NAME
56+
value: {{ include "logan.kubernetesClusterName" . }}
57+
{{- if eq $authtype "config" }}
58+
- name: FLUENT_OCI_CONFIG_LOCATION
59+
value: {{ .Values.oci.path }}/{{ .Values.oci.file }}
60+
{{- end }}
61+
{{- if .Values.extraEnv }}
62+
{{- toYaml .Values.extraEnv | nindent 10 }}
63+
{{- end }}
64+
{{- if .Values.resources }}
65+
resources: {{- toYaml .Values.resources | nindent 10 }}
66+
{{- end }}
67+
volumeMounts:
68+
# RW mount to store tail plugin output plugin buffer and logs
69+
- name: basedir
70+
mountPath: {{ .Values.fluentd.baseDir }}
71+
{{- if eq $authtype "config" }}
72+
# Mount directory where oci config exists
73+
- name: ociconfigdir
74+
mountPath: {{ .Values.oci.path }}
75+
readOnly: true
76+
{{- end }}
77+
# Mount directory where fluentd config exists
78+
- name: ekscpfluentdconfigdir
79+
mountPath: {{ .Values.fluentd.path }}
80+
readOnly: true
81+
{{- if .Values.extraVolumeMounts }}
82+
{{- toYaml .Values.extraVolumeMounts | nindent 8 }}
83+
{{- end }}
84+
terminationGracePeriodSeconds: 30
85+
volumes:
86+
{{- if .Values.extraVolumes }}
87+
{{- toYaml .Values.extraVolumes | nindent 6 }}
88+
{{- end }}
89+
# RW mount to store tail plugin output plugin buffer and logs
90+
- name: basedir
91+
hostPath:
92+
path: {{ .Values.fluentd.baseDir }}
93+
{{- if eq $authtype "config" }}
94+
# Mount directory where oci config exists
95+
- name: ociconfigdir
96+
projected:
97+
sources:
98+
- secret:
99+
name: {{ $resourceNamePrefix }}-oci-config
100+
{{- end }}
101+
# Mount directory where fluentd ekscp config exists
102+
- name: ekscpfluentdconfigdir
103+
configMap:
104+
# Provide the name of the ConfigMap to mount.
105+
name: {{ $resourceNamePrefix }}-ekscp-logs
106+
{{- end }}

charts/logan/values.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@
5252
"type": "string"
5353
}
5454
}
55+
},
56+
"collectionType": {
57+
"type": "string",
58+
"enum": ["cloudwatch", "s3"]
59+
},
60+
"region": {
61+
"type": "string"
62+
},
63+
"s3Bucket": {
64+
"type": "string",
65+
"minLength": 3,
66+
"maxLength": 63
5567
}
5668
}
5769
}

charts/logan/values.yaml

Lines changed: 131 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ image:
4848
# Image pull secrets for. Secret must be in the namespace defined by namespace
4949
imagePullSecrets:
5050
# -- Replace this value with actual docker image url
51-
url: container-registry.oracle.com/oci_observability_management/oci-la-fluentd-collector:1.3.0
51+
url: container-registry.oracle.com/oci_observability_management/oci-la-fluentd-collector:1.4.0
5252
# -- Image pull policy
5353
imagePullPolicy: Always
5454

@@ -60,7 +60,7 @@ ociLANamespace:
6060
# e.g. ocid1.loganalyticsloggroup.oc1.phx.amaaaaasdfaskriauucc55rlwlxe4ahe2vfmtuoqa6qsgu7mb6jugxacsk6a
6161
ociLALogGroupID:
6262

63-
# -- OKE Cluster OCID
63+
# -- OKE Cluster OCID/EKS Cluster ARN etc.
6464
# e.g. ocid1.cluster.oc1.phx.aaaaaaaahhbadf3rxa62faaeixanvr7vftmkg6hupycbf4qszctf2wbmqqxq
6565
kubernetesClusterID:
6666

@@ -77,6 +77,9 @@ ociLAClusterEntityID:
7777
# In Kubernetes environments where SELinux mode is enforced, set this flag to 'true' to allow fluentd pods to access log files.
7878
privileged: false
7979

80+
# -- Enables collection of AWS EKS Control Plane logs through CloudWatch or S3 Fluentd plugin
81+
enableEKSControlPlaneLogs: false
82+
8083
# Logging Analytics additional metadata. Use this to tag all the collected logs with one or more key:value pairs.
8184
# Key must be a valid field in Logging Analytics
8285
#metadata:
@@ -289,7 +292,7 @@ fluentd:
289292
# -- Kubernetes CSI Node Driver Logs collection configuration
290293
csinode:
291294
# csinode log files location.
292-
path: /var/log/containers/csi-oci-node-*.log
295+
path: /var/log/containers/csi-oci-node-*.log,/var/log/containers/ebs-csi-node-*.log
293296
# Logging Analytics log source to use for parsing and processing Kubernetes CSI Node Driver Logs.
294297
ociLALogSourceName: "Kubernetes CSI Node Driver Logs"
295298

@@ -309,6 +312,13 @@ fluentd:
309312
# The regular expression pattern for the starting line in case of multi-line logs.
310313
multilineStartRegExp: /^\S\d{2}\d{2}\s+[^\:]+:[^\:]+:[^\.]+\.\d{0,3}/
311314

315+
# -- Kubernetes CSI Controller Logs collection configuration
316+
csi-controller:
317+
# csi controller log files location.
318+
path: /var/log/containers/ebs-csi-controller-*.log
319+
# Logging Analytics log source to use for parsing and processing Kubernetes CSI Controller Logs.
320+
ociLALogSourceName: "Kubernetes CSI Controller Logs"
321+
312322
# Config specific to API Server Logs Collection
313323
kube-apiserver:
314324
# The path to the source files.
@@ -425,6 +435,122 @@ fluentd:
425435
# Logging Analytics log source to use for parsing and processing Linux YUM Logs.
426436
ociLALogSourceName: "Linux YUM Logs"
427437

438+
# Configuration for AWS EKS Control Plane logs like API Server, Audit, Authenticator etc.
439+
eksControlPlane:
440+
# Collection Type (cloudwatch or s3)
441+
collectionType: "cloudwatch"
442+
# AWS region
443+
region:
444+
# Use AssumeRoleCredentials (https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/AssumeRoleCredentials.html) to authenticate
445+
# Default is true. Set to false to use access keys
446+
awsUseSts: true
447+
# The role ARN to assume when using AWS Security Token Service authentication
448+
awsStsRoleArn:
449+
# AWS access key and secret access key, needed only when awsUseSts is explicitly set to false
450+
#awsKeyId:
451+
#awsSecKey:
452+
# CloudWatch Log Group name of the EKS cluster. Automatically determined by extracting cluster name from kubernetesClusterId and
453+
# following naming syntax as "aws/eks/<cluster name>/cluster". Below field can be used to override this behavior.
454+
#cwLogGroupName:
455+
# S3 related settings
456+
# S3 bucket name to which EKS Control Plane logs are being streamed using a subscription filter
457+
s3Bucket:
458+
ociLALogGroupID:
459+
#metadata:
460+
#"Client Host Region": "America"
461+
#"Environment": "Production"
462+
#"Third Key": "Third Value"
463+
# Worker number in case of multi process workers enabled. If not set when multi process workers enabled, then it defaults to 0.
464+
#worker:
465+
logs:
466+
# If using cloudwatch collection mechanism, apiserver and audit logs need to be part of the same worker as they share the same log stream name prefix.
467+
# Thus "worker" variable is only picked up from "apiserver" section.
468+
apiserver:
469+
# CloudWatch Log Stream name
470+
cwLogStreamName: "kube-apiserver"
471+
# SQS queue name which is notified when apiserver log object is created in S3 bucket
472+
sqsQueue: "apiserver"
473+
# S3 object key
474+
objectKey: .*?kube-apiserver/
475+
# Logging Analytics log source to use for parsing and processing EKS Control Plane API Server Logs.
476+
ociLALogSourceName: "Kubernetes API Server Logs"
477+
multilineStartRegExp: /^\S\d{2}\d{2}\s+[^\:]+:[^\:]+:[^\.]+\.\d{0,3}/
478+
#metadata:
479+
#"Client Host Region": "America"
480+
#"Environment": "Production"
481+
#"Third Key": "Third Value"
482+
#ociLALogGroupID:
483+
# Worker number in case of multi process workers enabled. If not set when multi process workers enabled, then it defaults to 0.
484+
#worker:
485+
audit:
486+
sqsQueue: "audit"
487+
# S3 object key
488+
objectKey: .*?kube-apiserver-audit
489+
# Logging Analytics log source to use for parsing and processing EKS Control Plane Audit Logs.
490+
ociLALogSourceName: "Kubernetes Audit Logs"
491+
#metadata:
492+
#"Client Host Region": "America"
493+
#"Environment": "Production"
494+
#"Third Key": "Third Value"
495+
#ociLALogGroupID:
496+
#worker:
497+
authenticator:
498+
cwLogStreamName: "authenticator"
499+
sqsQueue: "authenticator"
500+
# S3 object key
501+
objectKey: .*?authenticator
502+
# Logging Analytics log source to use for parsing and processing EKS Control Plane Authenticator Logs.
503+
ociLALogSourceName: "AWS EKS Authenticator Logs"
504+
multilineStartRegExp: /^time=/
505+
#metadata:
506+
#"Client Host Region": "America"
507+
#"Environment": "Production"
508+
#"Third Key": "Third Value"
509+
#ociLALogGroupID:
510+
#worker:
511+
kubecontrollermanager:
512+
cwLogStreamName: "kube-controller-manager"
513+
sqsQueue: "kube-controller-manager"
514+
# S3 object key
515+
objectKey: .*?kube-controller-manager
516+
# Logging Analytics log source to use for parsing and processing EKS Control Plane Kube Controller Manager Logs.
517+
ociLALogSourceName: "Kubernetes Controller Manager Logs"
518+
multilineStartRegExp: /^\S\d{2}\d{2}\s+[^\:]+:[^\:]+:[^\.]+\.\d{0,3}/
519+
#metadata:
520+
#"Client Host Region": "America"
521+
#"Environment": "Production"
522+
#"Third Key": "Third Value"
523+
#ociLALogGroupID:
524+
#worker:
525+
cloudcontrollermanager:
526+
cwLogStreamName: "cloud-controller-manager"
527+
sqsQueue: "cloud-controller-manager"
528+
# S3 object key
529+
objectKey: .*?cloud-controller-manager
530+
# Logging Analytics log source to use for parsing and processing EKS Control Plane Cloud Controller Manager Logs.
531+
ociLALogSourceName: "Cloud Controller Manager Logs"
532+
multilineStartRegExp: /^\S\d{2}\d{2}\s+[^\:]+:[^\:]+:[^\.]+\.\d{0,3}/
533+
#metadata:
534+
#"Client Host Region": "America"
535+
#"Environment": "Production"
536+
#"Third Key": "Third Value"
537+
#ociLALogGroupID:
538+
#worker:
539+
scheduler:
540+
cwLogStreamName: "kube-scheduler"
541+
sqsQueue: "scheduler"
542+
# S3 object key
543+
objectKey: .*?kube-scheduler
544+
# Logging Analytics log source to use for parsing and processing EKS Control Plane Scheduler Logs.
545+
ociLALogSourceName: "Kubernetes Scheduler Logs"
546+
multilineStartRegExp: /^\S\d{2}\d{2}\s+[^\:]+:[^\:]+:[^\.]+\.\d{0,3}/
547+
#metadata:
548+
#"Client Host Region": "America"
549+
#"Environment": "Production"
550+
#"Third Key": "Third Value"
551+
#ociLALogGroupID:
552+
#worker:
553+
428554
# Generic configuration for all container/pod logs
429555
genericContainerLogs:
430556
# -- Default Logging Analytics log source to use for parsing and processing the logs: Kubernetes Container Generic Logs.
@@ -440,6 +566,8 @@ fluentd:
440566
- '"/var/log/containers/csi-oci-node-*.log"'
441567
- '"/var/log/containers/proxymux-client-*.log"'
442568
- '"/var/log/containers/cluster-autoscaler-*.log"'
569+
- '"/var/log/containers/ebs-csi-node-*.log"'
570+
- '"/var/log/containers/ebs-csi-controller-*.log"'
443571
- '"/var/log/containers/kube-apiserver-*.log"'
444572
- '"/var/log/containers/etcd-*.log"'
445573
- '"/var/log/containers/kube-controller-manager-*.log"'

charts/oci-onm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type: application
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 3.3.0
21+
version: 3.4.0
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to
@@ -32,7 +32,7 @@ dependencies:
3232
repository: "file://../common"
3333
condition: oci-onm-common.enabled
3434
- name: oci-onm-logan
35-
version: "3.3.0"
35+
version: "3.4.0"
3636
repository: "file://../logan"
3737
condition: oci-onm-logan.enabled
3838
- name: oci-onm-mgmt-agent

charts/oci-onm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ oci-onm-logan:
3131
kubernetesClusterID: "{{ .Values.global.kubernetesClusterID }}"
3232
kubernetesClusterName: "{{ .Values.global.kubernetesClusterName }}"
3333
image:
34-
url: container-registry.oracle.com/oci_observability_management/oci-la-fluentd-collector:1.3.0
34+
url: container-registry.oracle.com/oci_observability_management/oci-la-fluentd-collector:1.4.0
3535
# Go to OCI Logging Analytics Administration, click Service Details, and note the namespace value.
3636
ociLANamespace:
3737
# OCI Logging Analytics Default Log Group OCID

0 commit comments

Comments
 (0)