Skip to content

Commit a650340

Browse files
author
Gimi Liang
committed
2 parents 9d80a98 + be4d121 commit a650340

File tree

1 file changed

+128
-0
lines changed

1 file changed

+128
-0
lines changed

README.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,131 @@ Splunk Connect for Kubernetes (the connector) is a set of Kubernetes objects whi
55
The connector is provided as a Helm chart, so that it can be installed easily using the Helm command line tool. Please see [the README file](./helm-chart/README.md) for the details.
66

77
For people who do not use Helm, a set of manifests manifests
8+
=======
9+
# What does Splunk Connect for Kubernetes do?
10+
11+
Splunk Connect for Kubernetes provides a way to import and search your Kubernetes logging, object, and metrics data in Splunk. Splunk is a proud contributor to Cloud Native Computing Foundation (CNCF) and Splunk Connect for Kubernetes utilizes and supports multiple CNCF components in the development of these tools to get data into Splunk.
12+
13+
14+
## Prerequisites
15+
16+
* Splunk Enterprise 7.0 or later
17+
* An HEC token. See the following topics for more information:
18+
* http://docs.splunk.com/Documentation/Splunk/7.0.3/Data/UsetheHTTPEventCollector
19+
* http://docs.splunk.com/Documentation/Splunk/7.0.3/Data/ScaleHTTPEventCollector
20+
* You should be familiar with your Kubernetes configuration and know where your log info is collected in Kubernetes.
21+
* You must have administrator access to your Kubernetes cluster.
22+
* To install using Helm (recommended), make sure you are running Helm in your Kubernetes configuration. See https://github.com/kubernetes/heapster
23+
* Have a minimum of two Splunk indexes ready to collect the log data, one for both logs and Kubernetes objects, and one for metrics. You can also create separate indexes for logs and objects, in which case you will need three Splunk indexes.
24+
25+
## Before you begin
26+
Splunk Connect for Kubernetes supports installation using Helm. Ensure that you thoroughly read the Prerequisites and Installation and Deployment documentation before you start your deployment of Splunk Connect for Kubernetes.
27+
28+
Make sure you do the following before you install:
29+
30+
1. Create a minimum of two Splunk indexes:
31+
* one events index, which will handle logs and objects (you may also create two separate indexes for logs and objects).
32+
* one metrics index.
33+
If you do not configure these indexes, Kubernetes Connect for Splunk uses the defaults created in your HEC token.
34+
35+
2. Create a HEC token if you do not already have one. If you are installing the connector on Splunk Cloud, file a ticket with Splunk Customer Service and they will deploy the indexes for your environment and generate your HEC token.
36+
37+
## Deploy with Helm
38+
39+
Helm, maintained by the CNCF, allows the Kubernetes administrator to install, upgrade, and manage the applications running in their Kubernetes clusters. For more information on how to use and configure Helm Charts, please the the Helm [site](https://helm.sh/) and [repository](https://github.com/kubernetes/helm) for tutorials and product documentation. Helm is the only method that Splunk supports for installing Splunk Connect for Kubernetes.
40+
41+
To install and configure defaults with Helm:
42+
43+
```$Helm install – name my-release - f my_values,yamlstable/splunk-connector/kubernetes-objects```
44+
45+
To learn more about using and modifying charts, see: https://github.com/splunk/splunk-connect-for-kubernetes/tree/master/helm-chart and https://docs.helm.sh/using_helm/#using-helm.
46+
47+
## Deploy using YAML
48+
49+
You can use YAML to `grep` the chart and manifest files and add them to your Kubernetes cluster. Please note that installation and debugging for Splunk Connect for Kubernetes through YAML is community-supported only.
50+
51+
When you use YAML to install Splunk Connect for Kubernetes, the installation does not create the default configuration that is created when you install using Helm. To deploy the connector using YAML, you must know how to configure your Kubernetes variables to work with the connector. If you are not familiar with this process, we recommend that you use the Helm installation method.
52+
53+
To create YAML files in your Kubernetes cluster:
54+
55+
1. `grep` the Charts and Manifest files from https://github.com/splunk/splunk-connect-for-kubernetes
56+
57+
2. Apply the Charts file:
58+
59+
```kubectl apply -f charts```
60+
61+
3. Apply the Manifest manifest file:
62+
63+
```kubectl apply -f manifests```
64+
65+
Note that you may need to verify that your Kubernetes logs are recognized by the Splunk Connect for Kubernetes. See the following resources for YAML configuration properties:
66+
67+
* https://github.com/splunk/splunk-connect-for-kubernetes/blob/master/helm-chart/charts/splunk-kubernetes-logging/values.yaml for information about varaible configuration using YAML.
68+
* charts/splunk-kubernetes-logging/values.yaml for configurable parameters for splunk-kubernetes-logging.
69+
* charts/splunk-kubernetes-objects/values.yaml for configurable parameters for splunk-kubernetes-objects.
70+
* charts/splunk-kubernetes-metrics/values.yaml for configurable parameters for splunk-kubernetes-metrics.
71+
72+
## Confiuration variables
73+
74+
For a full list of configuration variables see the following file:
75+
76+
https://github.com/splunk/splunk-connect-for-kubernetes/blob/master/helm-chart/charts/splunk-kubernetes-logging/values.yaml
77+
78+
# Architecture
79+
80+
Splunk Connect for Kubernetes deploys a daemonset on each node. And in the daemonset, a Fluentd container runs and does the collecting job. Splunk Connector for Kubernetes collects three types of data:
81+
82+
* logs: Splunk Connectr for Kubernetes collects two types of logs:
83+
* logs from Kubernetes system components (https://kubernetes.io/docs/concepts/overview/components/)
84+
* applications (container) logs
85+
* [objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/)
86+
* metrics
87+
88+
To collect the data, Splunk leverages:
89+
90+
* [Fluentd](https://www.fluentd.org/)
91+
* [JQ plugin](https://rubygems.org/gems/fluent-plugin-jq) for transforming data
92+
* [Splunk HEC output plug-in](https://github.com/splunk/fluent-plugin-splunk-hec): The [HTTP Event Collector](http://dev.splunk.com/view/event-collector/SP-CAAAE6M) collects all data sent to Splunk for indexing.
93+
* For Splunk Connect for Kubernetes, Splunk uses the [node logging agent](https://kubernetes.io/docs/concepts/cluster-administration/logging/#using-a-node-logging-agent) method. See the [Kubernetes Logging Architecture](https://kubernetes.io/docs/concepts/cluster-administration/logging/) for an overview of the types of Kubernetes logs from which you may wish to collect data as well as information on how to set up those logs.
94+
95+
## Logs
96+
97+
Splunk Connect for Kubernetes uses the Kubernetes [node logging agent](https://kubernetes.io/docs/concepts/cluster-administration/logging/#using-a-node-logging-agent) to collect logs. Splunk deploys a daemonset on each of these nodes. Each daemonset holds a Fluentd container to collect the data. The following plugins are enabled in that Fluentd container:
98+
99+
* [in_systemd](https://rubygems.org/gems/fluent-plugin-systemd) reads logs from systemd journal if systemd is available on the host.
100+
* [in_tail](https://docs.fluentd.org/v1.0/articles/in_tail) reads logs from file system.
101+
* [filter_jq_transformer](https://rubygems.org/gems/fluent-plugin-jq) transforms the raw events to a Splunk-friendly format and generates source and sourcetypes.
102+
* [out_splunk_hec](https://github.com/splunk/fluent-plugin-splunk-hec) sends the translated logs to Splunk indexes through the HTTP Event Collector input (HEC).
103+
104+
## Kubernetes Objects
105+
106+
Splunk Connect for Kubernetes collects Kubernetes objects that can help users access cluster status. Splunk deploys code in the Kubernetes cluster that collects the object data. That deployment contains one pod that runs Fluentd which contains the following plugins to help push data to Splunk:
107+
108+
* [in_kubernetes_objects](https://github.com/splunk/fluent-plugin-kubernetes-objects) collects object data by calling the Kubernetes API (by https://github.com/abonas/kubeclient). in-kubernetes-objects supports two modes:
109+
* watch mode: the Kubernetes API sends new changes to the plugin. In this mode, only the changed data is collected.
110+
* pull mode: the plugin queries the Kubernetes API periodically. In this mode, all data is collected.
111+
* [filter_jq_transformer](https://rubygems.org/gems/fluent-plugin-jq) transforms the raw data into a Splunk-friendly format and generates sources and sourcetypes.
112+
* [out_splunk_hec](https://github.com/splunk/fluent-plugin-splunk-hec) sends the data to Splunk via HTTP Event Collector input (HEC).
113+
114+
## Metrics
115+
116+
Splunk Connect for Kubernetes deploys code on the Kubernetes cluster. This deployment has exactly one pod, which runs two containers:
117+
118+
* [Heapster](https://github.com/kubernetes/heapster) collects metrics and sends them to the Fluentd sidecar via UDP in `statsd` format.
119+
* Fluentd, which receives metrics from Heapster using [in_udp](https://docs.fluentd.org/v1.0/articles/in_udp) and transforms the metrics using filter_jq_transformer. filter_jq_transformer formats the data for Splunk ingestion: It makea sure the metrics have proper metric_name, dimensions, etc., and then sends the metrics to Splunk using out_splunk_hec.
120+
121+
Make sure your Splunk configuration has a metrics index that is able to receive the data. See [Get started with metrics](http://docs.splunk.com/Documentation/Splunk/7.1.0/Metrics/GetStarted) in the Splunk Enterprise documentaiton.
122+
123+
If you want to learn more about how metrics are monitored in a Kubernetes cluster, see Tools for [Monitoring Compute, Storage, and Network Resources](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/).
124+
125+
# Performance
126+
127+
Some parameters used with Splunk Connect for Kubernetes can have an impact on overall performance of log ingestion, objects, or metrics. In general, the more filters that are added to one of the streams, the greater the preformance impact.
128+
129+
By default, HEC can support up to 10K events per second with HTTP Keep-Alive disabled on clients. There are other use cases where HTTP Keep-Alive can be enabled for higher event rate, but cannot be enabled when connected to Splunk Connect for Kubernetes.
130+
131+
Splunk Connect for Kubernetes can support an indexing rate of over 12 MB/s indexing with over 10K events/sec and a 1 KiB message size, assuming no filters and a consistent stream of events. This means that Splunk Connect for Kubernetes can exceed the default throughput of HEC. To best address capacity needs, Splunk recommends that you monitor the HEC throughput and back pressure on Splunk Connect for Kubernetes deployments and be prepared to add additional nodes as needed.
132+
133+
# Processing Multi-Line Logs
134+
135+
One possible filter option is to enable the processing of multi-line events. This feature is currently experimental and considered to be community supported.

0 commit comments

Comments
 (0)