From f7cff0353e2796dccc793f8ac2ca59c9ac03f8fd Mon Sep 17 00:00:00 2001 From: Denise Schannon Date: Fri, 22 Mar 2019 23:39:38 -0700 Subject: [PATCH] fixing logging --- .../cluster-admin/cluster-members/_index.md | 1 + .../v2.x/en/cluster-admin/tools/_index.md | 9 ++ .../en/cluster-admin/tools/alerts/_index.md | 4 +- .../en/cluster-admin/tools/logging/_index.md | 59 +++++++--- .../tools/logging/elasticsearch/_index.md | 70 ++++-------- .../tools/logging/fluentd/_index.md | 60 +++-------- .../tools/logging/kafka/_index.md | 71 +++++------- .../tools/logging/splunk/_index.md | 67 ++++-------- .../tools/logging/syslog/_index.md | 70 ++++-------- .../cluster-admin/tools/monitoring/_index.md | 30 ++---- .../persistent-volume-claims/_index.md | 2 +- .../options/api-audit-log/_index.md | 1 + .../en/project-admin/tools/alerts/_index.md | 4 +- .../en/project-admin/tools/logging/_index.md | 59 +++++++--- .../tools/logging/custom/_index.md | 90 ---------------- .../tools/logging/elasticsearch/_index.md | 71 ------------ .../tools/logging/fluentd/_index.md | 68 ------------ .../tools/logging/kafka/_index.md | 73 ------------- .../tools/logging/splunk/_index.md | 102 ------------------ .../tools/logging/syslog/_index.md | 72 ------------- 20 files changed, 205 insertions(+), 778 deletions(-) delete mode 100644 content/rancher/v2.x/en/project-admin/tools/logging/custom/_index.md delete mode 100644 content/rancher/v2.x/en/project-admin/tools/logging/elasticsearch/_index.md delete mode 100644 content/rancher/v2.x/en/project-admin/tools/logging/fluentd/_index.md delete mode 100644 content/rancher/v2.x/en/project-admin/tools/logging/kafka/_index.md delete mode 100644 content/rancher/v2.x/en/project-admin/tools/logging/splunk/_index.md delete mode 100644 content/rancher/v2.x/en/project-admin/tools/logging/syslog/_index.md diff --git a/content/rancher/v2.x/en/cluster-admin/cluster-members/_index.md b/content/rancher/v2.x/en/cluster-admin/cluster-members/_index.md index 31e5fcb53d8..8f8a197ad77 100644 --- a/content/rancher/v2.x/en/cluster-admin/cluster-members/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/cluster-members/_index.md @@ -4,6 +4,7 @@ weight: 2020 aliases: - /rancher/v2.x/en/tasks/clusters/adding-managing-cluster-members/ - /rancher/v2.x/en/cluster-provisioning/cluster-members/ + - /rancher/v2.x/en/k8s-in-rancher/cluster-members/ --- If you want to provide a user with access and permissions to _all_ projects, nodes, and resources within a cluster, assign the user a cluster membership. diff --git a/content/rancher/v2.x/en/cluster-admin/tools/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/_index.md index 7654fef30aa..7cec8deaebd 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/_index.md @@ -71,6 +71,15 @@ These services collect container log events, which are saved to the `/var/log/co When configuring Rancher to integrate with these services, you'll have to point Rancher toward the service's endpoint and provide authentication information. Additionally, you'll have the opportunity to enter key value pairs to filter the log events collected. The service will only collect events for containers marked with your configured key value pairs. +### Logging Advantages + +Setting up a logging service to collect logs from your cluster or project is helpful several ways: + +- Logs errors and warnings in your Kubernetes infrastructure to a stream. The stream informs you of events like a container crashing, a pod eviction, or a node dying. +- Allows you to capture and analyze the state of your cluster and look for trends in your environment using the log stream. +- Helps you when troubleshooting or debugging. +- Saves your logs to a safe location outside of your cluster, so that you can still access them even if your cluster encounters issues. + You can configure these services to collect logs at either the [cluster level]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/) or [project level]({{< baseurl >}}/rancher/v2.x/en/project-admin/tools/logging/). ## Monitoring diff --git a/content/rancher/v2.x/en/cluster-admin/tools/alerts/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/alerts/_index.md index ffe9be1e4f1..6f2805a315f 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/alerts/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/alerts/_index.md @@ -24,9 +24,7 @@ As a [cluster owner]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster >**Prerequisite:** Before you can receive cluster alerts, you must [add a notifier]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/notifiers/#adding-notifiers). -1. From the **Global** view, open the cluster that you want to configure alerts for. - -1. From the main menu, select **Tools > Alerts**. Then click **Add Alert Group**. +1. From the **Global** view, navigate to the cluster that you want to configure cluster alerts for. Select **Tools > Alerts**. Then click **Add Alert Group**. 1. Enter a **Name** for the alert that describes its purpose, you could group alert rules for the different purpose. diff --git a/content/rancher/v2.x/en/cluster-admin/tools/logging/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/logging/_index.md index 426e0aa1b9f..709c023056c 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/logging/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/logging/_index.md @@ -10,15 +10,19 @@ Rancher can integrate with a variety of popular logging services and tools that Rancher supports the following services: -- [Elasticsearch]({{< baseurl >}}/rancher/v2.x/en/tools/logging/elasticsearch) -- [Splunk]({{< baseurl >}}/rancher/v2.x/en/tools/logging/splunk) -- [Kafka]({{< baseurl >}}/rancher/v2.x/en/tools/logging/kafka) -- [Syslog]({{< baseurl >}}/rancher/v2.x/en/tools/logging/syslog) -- [Fluentd]({{< baseurl >}}/rancher/v2.x/en/tools/logging/fluentd) +- Elasticsearch +- Splunk +- Kafka +- Syslog +- Fluentd + +Additional, Rancher supports the ability to send [custom logs]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/custom/) to any of these services. + +>**Note:** You can only configure one logging service per cluster or per project. ## Requirements -Docker daemon should be [configured](https://docs.docker.com/config/containers/logging/configure/) with the (default) log-driver: `json-file`. You can check the log-driver by running the following command: +The Docker daemon on each node in the cluster should be [configured](https://docs.docker.com/config/containers/logging/configure/) with the (default) log-driver: `json-file`. You can check the log-driver by running the following command: ``` $ docker info | grep 'Logging Driver' @@ -27,7 +31,7 @@ Logging Driver: json-file ## Advantages -Setting up a logging service to collect logs from your cluster/project is helpful several ways: +Setting up a logging service to collect logs from your cluster/project has several advantages: - Logs errors and warnings in your Kubernetes infrastructure to a stream. The stream informs you of events like a container crashing, a pod eviction, or a node dying. - Allows you to capture and analyze the state of your cluster and look for trends in your environment using the log stream. @@ -36,24 +40,47 @@ Setting up a logging service to collect logs from your cluster/project is helpfu ## Logging Scope -You can configure logging at either cluster or project level. +You can configure logging at either [cluster level]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/) or project level. ->**Note:** You can only configure one logging service per cluster or project. +- Cluster logging writes logs for every pod in the cluster, i.e. in all the projects. For [RKE clusters]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters), it also writes logts for all the Kubernetes system components. -- If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. +- Project logging writes logs for every pod in that particular project. - Cluster logging writes logs for every pod in the cluster and, in [RKE clusters]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters), Kubernetes system components. Logs from the following locations are sent to your logging service: +Logs that are sent to your logging service are from the following locations: + - Pod logs stored at `/var/log/containers`. - - The `/var/log/containers` path for pod logging. + - Kubernetes system components logs stored at `/var/lib/rancher/rke/logs/`. - - The `/var/lib/rancher/rke/logs/` path for Kubernetes system components. +## Enabling Cluster Logging -- If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. +As an [administrator]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/) or [cluster owner]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles), you can configure Rancher to send Kubernetes logs to a logging service. - Project logging writes logs for every pod in the project. +1. From the **Global** view, navigate to the cluster that you want to configure cluster logging for. -After collection, all logs are stored by your logging service. Log into your service to view them. +1. Select **Tools > Logging** in the navigation bar. + +1. Select a logging service and enter the configuration. Refer to the specific service for detailed configuration. Rancher supports the following services: + + - [Elasticsearch]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/elasticsearch) + - [Splunk]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/splunk) + - [Kafka]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/kafka) + - [Syslog]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/syslog) + - [Fluentd]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/fluentd) + +1. Complete the **Additional Logging Configuration** form. + + 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. + + 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes data to the logging server. Intervals are measured in seconds. + + 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. + +1. Click **Test**. Rancher sends a test log to the service. + +1. Click **Save**. + +**Result:** Rancher is now configured to send logs to the selected service. Log into the logging service so that you can start viewing the logs. ## Related Links diff --git a/content/rancher/v2.x/en/cluster-admin/tools/logging/elasticsearch/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/logging/elasticsearch/_index.md index e97fd6e7d4c..50fe7b5443a 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/logging/elasticsearch/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/logging/elasticsearch/_index.md @@ -5,69 +5,39 @@ aliases: - /rancher/v2.x/en/tools/logging/elasticsearch/ --- -If your organization uses [Elasticsearch](https://www.elastic.co/), either on premise or in the cloud, you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Elasticsearch deployment to view logs for your cluster or container. - -## Configuring Elasticsearch Logging - -You can configure Rancher to send logs from your cluster or project to your instance of Elasticsearch. +If your organization uses [Elasticsearch](https://www.elastic.co/), either on premise or in the cloud, you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Elasticsearch deployment to view logs. >**Prerequisites:** Configure an [Elasticsearch deployment](https://www.elastic.co/guide/en/cloud/saas-release/ec-create-deployment.html). -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. +## Elasticsearch Configuration -1. From the **Global** view, open the cluster that you want to configure logging for. +1. In the **Endpoint** field, enter the IP address and port of your Elasticsearch instance. You can find this information from the dashboard of your Elasticsearch deployment. -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. + * Elasticsearch usually uses port `9200` for HTTP and `9243` for HTTPS. -1. From the **Global** view, open the project that you want to configure logging for. +1. If you are using [X-Pack Security](https://www.elastic.co/guide/en/x-pack/current/xpack-introduction.html), enter your Elasticsearch **Username** and **Password** for authentication. -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} +1. Enter an [Index Pattern](https://www.elastic.co/guide/en/kibana/current/index-patterns.html). -1. Select **Elasticsearch**. +## SSL Configuration -1. Complete the **Elasticsearch Configuration** form. +If your instance of Elasticsearch uses SSL, your **Endpoint** will need to begin with `https://`. With the correct endpoint, the **SSL Configuration** form is enabled and ready to be completed. - 1. From the **Endpoint** field, enter the IP address and port for your Elasticsearch instance. You can copy this information from the dashboard of your Elasticsearch deployment. Elasticsearch usually uses port `9200` for HTTP and `9243` for HTTPS. +1. Provide the **Client Private Key** and **Client Certificate**. You can either copy and paste them or upload them by using the **Read from a file** button. - 1. If you are using [X-Pack Security](https://www.elastic.co/guide/en/x-pack/current/xpack-introduction.html), enter your Elasticsearch **Username** and **Password** for authentication. + - You can use either a self-signed certificate or one provided by a certificate authority. - 1. Enter an [Index Pattern](https://www.elastic.co/guide/en/kibana/current/index-patterns.html). + - You can generate a self-signed certificate using an openssl command. For example: -1. If your instance of Elasticsearch uses SSL, complete the **SSL Configuration** form. + ``` + openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" + ``` + +1. Enter your **Client Key Password**. - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. +1. Enter your **SSL Version**. The default version is `TLSv1_2`. - You can use either a self-signed certificate or one provided by a certificate authority. +1. Select whether or not you want to verify your SSL. If the **Enabled - Input trusted server certificate** option is selected, a certificate section is enabled. You can copy and paste the certificate or upload it using the **Read from a file** button. - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - - 1. If you are using a self-signed certificate, you need to provide the **CA Certificate PEM** as well. - - 1. Enter your private key password. - - 1. Enter your ssl version. The default version is tlsv1_2. - - 1. Select the **Enabled - Input trusted server certificate** option and enter your **Trusted Server Certificate Chain** if you are using a certificate from a certificate authority. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Elasticsearch. - -1. Click **Save**. - -**Result:** Rancher is now configured to send cluster and container logs to Elasticsearch. Log into Elasticsearch or Kibana to view your cluster/project logs. + * If you are using a self-signed certificate, provide the **CA Certificate PEM**. + * If you are using a certificate from a certificate authority, provide your **Trusted Server Certificate Chain**. diff --git a/content/rancher/v2.x/en/cluster-admin/tools/logging/fluentd/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/logging/fluentd/_index.md index ee73badd537..5dd086cdbb6 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/logging/fluentd/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/logging/fluentd/_index.md @@ -3,66 +3,32 @@ title: Fluentd weight: 600 --- -If your organization is using [Fluentd](https://www.fluentd.org/), you can configure Rancher to send logs to Fluentd server. - -## Configuring Fluentd Logging - -You can configure Rancher to send Kubernetes logs to your Fluentd. +If your organization uses [Fluentd](https://www.fluentd.org/), you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Kafka server to view logs. >**Prerequisites:** Configure Fluentd input forward to receive the event stream. > >See [Fluentd Documentation](https://docs.fluentd.org/v1.0/articles/in_forward) for details. -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. +## Fluentd Configuration -1. From the **Global** view, open the cluster that you want to configure logging for. +You can add multiple Fluentd Servers. If you want to add additional Fluentd servers, click **Add Fluentd Server**. For each Fluentd server, complete the configuration information: -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. +1. In the **Endpoint** field, enter the address and port of your Fluentd instance, e.g. `http://Fluentd-server:24224`. -1. From the **Global** view, open the project that you want to configure logging for. +1. Enter the **Shared Key** if your Fluentd Server is using a shared key for authentication. -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} +1. Enter the **Username** and **Password** if your Fluentd Server is using username and password for authentication. -1. Select **Fluentd**. +1. **Optional:** Enter the **Hostname** of the Fluentd server. -1. Complete the **Fluentd Server Configuration** form. +1. Enter the load balancing **Weight** of the Fluentd server. If the weight of one server is 20 and the other server is 30, events will be sent in a 2:3 ratio. If you do not enter a weight, the default weight is 60. - 1. From the **Endpoint** field, enter the address of you Fluentd instance (i.e. `http://Fluentd-server:24224`). +1. If this server is a standby server, check **Use as Standby Only**. Standby servers are used when all other servers are not available. - 1. Enter the **Shared Key** if your Fluentd Server is using shared key for authentication. +After adding all the Fluentd servers, you have the option to select **Enable Gzip Compression**. By default, this is enabled because the transferred payload size will be reduced. - 1. Enter the **Username** and **Password** if your Fluentd Server is using username and pasword for authentication. +## SSL Configuration - 1. **Optional:** Enter the **Hostname** of the server. +If your Fluentd servers are using TLS, you need to select **Use TLS**. You can copy and paste the certificate or upload it using the **Read from a file** button. - 1. Enter the load balancing **Weight** of the server. If the weight of one server is 20 and the other server is 30, events will be sent in a 2:3 ratio. The default weight is 60 if you leave this field empty. - - 1. Check **Use as Standby Only** if this server is standby. Standby servers will be used when all non-standby servers are down. - - 1. You can add multiple Fluentd servers. - -1. Select **Enable Gzip Compression**. The transferred payload size will be reduced. - -1. If your Fluentd is using SSL, you need to complete the **SSL Configuration** form. - - 1. If you are using a self-signed certificate, you need to provide the **CA Certificate PEM** as well. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes event data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Fluentd with rancher tag. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to Fluentd. Check you Fluentd output events for your cluster and containers. + - If you are using a self-signed certificate, provide the **CA Certificate PEM**. diff --git a/content/rancher/v2.x/en/cluster-admin/tools/logging/kafka/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/logging/kafka/_index.md index cda52889235..bd15fdac559 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/logging/kafka/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/logging/kafka/_index.md @@ -5,71 +5,48 @@ aliases: - /rancher/v2.x/en/tools/logging/kafka/ --- -You can configure Rancher to send cluster or project logs to a [Kafka](https://kafka.apache.org/) server. - -## Configuring Kafka Logging +If your organization uses [Kafka](https://kafka.apache.org/), you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Kafka server to view logs. >**Prerequisite:** You must have a Kafka server configured. -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. +## Kafka Configuration -1. From the **Global** view, open the cluster that you want to configure logging for. +1. Select the type of **Endpoint** your Kafka server is using: -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. + * **Zookeeper**: Enter the IP address and port. By default, Zookeeper uses port `2181`. Please note that a Zookeeper endpoint cannot enable TLS. + * **Broker**: Click on **Add Endpoint**. For each Kafka broker, enter the IP address and port. By default, Kafka brokers use port `9092`. -1. From the **Global** view, open the project that you want to configure logging for. +1. In the **Topic** field, enter the name of a Kafka [topic](https://kafka.apache.org/documentation/#basic_ops_add_topic) that your Kubernetes cluster submits logs to. -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} +## **Broker** Endpoint Type -1. Select **Kafka**. +### SSL Configuration -1. Complete the **Kafka Configuration** form. +If your Kafka cluster is using SSL for the **Broker**, you need to complete the **SSL Configuration** form. - 1. From **Endpoint Type**, select the type of Kafka server you are using: **Zookeeper** or **Broker**. +1. Provide the **Client Private Key** and **Client Certificate**. You can either copy and paste them or upload them by using the **Read from a file** button. - 1. From the **Endpoint** field, enter the IP address and the port for your Zookeeper or Broker. For Broker type, you can add multiple endpoints. + - You can use either a self-signed certificate or one provided by a certificate authority. - By default, Zookeeper uses port `2181`, Kafka broker uses port `9092`. Please note that Zookeeper endpoint is for Kafka cluster not enable tls. + - You can generate a self-signed certificate using an openssl command. For example: - 1. From the **Topic** field, enter the name of a Kafka [topic](https://kafka.apache.org/documentation/#basic_ops_add_topic) that your Kubernetes cluster submits logs to. + ``` + openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" + ``` -1. If your Kafka cluster is using SSL for **Broker**, you need to complete the **SSL Configuration** form. +1. In the **CA Certificate PEM** certificate section, either copy and paste the certificate or upload it using the **Read from a file** button. - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. + * If you are using a self-signed certificate, provide the **CA Certificate PEM**. + * If you are using a certificate from a certificate authority, provide your **Trusted Server Certificate Chain**. - You can use either a self-signed certificate or one provided by a certificate authority. +### SASL configuration - You can generate a self-signed certificate using an openssl command. For example: +If your Kafka cluster is using [SASL authentication](https://kafka.apache.org/documentation/#security_sasl) for the Broker, you need to complete the **SASL Configuration** form. - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" +1. Enter the SASL **Username** and **Password**. +1. Select the **SASL Type** that your Kafka cluster is using. - 1. If you are using a self-signed certificate, you need to provide the **CA Certificate PEM** as well. + * If your Kafka is using **Plain**, please ensure your Kafka cluster is using SSL. -1. If your Kafka cluster is using SASL authentication for **Broker**, you need to complete the **SASL Configuration** form. See [Kafka SASL](https://kafka.apache.org/documentation/#security_sasl) for details. - - 1. Enter SASL **Username** and **Passwork** - - 1. Select **SASL Type** which your Kafka is using. Please make sure your Kafka cluster is using SSL when you select **Plain**. - - 1. If your Kafka is using **Scram**, you need to select which **Scram Mechanism** Kafka is using. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes logs to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Kafka. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to Kafka. View your Kafka stream to view logs for your cluster and containers. + * If your Kafka is using **Scram**, you need to select which **Scram Mechanism** Kafka is using. diff --git a/content/rancher/v2.x/en/cluster-admin/tools/logging/splunk/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/logging/splunk/_index.md index 8fd05ea432c..096c8107120 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/logging/splunk/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/logging/splunk/_index.md @@ -6,11 +6,7 @@ aliases: - /rancher/v2.x/en/tools/logging/splunk/ --- -If your organization uses [Splunk](https://www.splunk.com/), you can configure Rancher to send it cluster or project logs. Afterwards logs are sent, you can use Splunk to view them. - -## Configuring Splunk Logging - -You can configure Rancher to send Kubernetes logs to your instance of Splunk. +If your organization uses [Splunk](https://www.splunk.com/), you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Splunk server to view logs. >**Prerequisites:** > @@ -19,63 +15,40 @@ You can configure Rancher to send Kubernetes logs to your instance of Splunk. > >For more information, see [Splunk Documentation](http://docs.splunk.com/Documentation/Splunk/7.1.2/Data/UsetheHTTPEventCollector#About_Event_Collector_tokens). -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. +## Splunk Configuration -1. From the **Global** view, open the cluster that you want to configure logging for. +1. In the **Endpoint** field, enter the IP address and port for you Splunk instance (i.e. `http://splunk-server:8088`) -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. + * Splunk usually uses port `8088`. If you're using Splunk Cloud, you'll need to work with [Splunk support](https://www.splunk.com/en_us/support-and-services.html) to get an endpoint URL. -1. From the **Global** view, open the project that you want to configure logging for. +1. Enter the **Token** you obtained while completing the prerequisites (i.e., when you created a token in Splunk). -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} +1. In the **Source** field, enter the name of the token as entered in Splunk. -1. Select **Splunk**. +1. **Optional:** Provide one or more [index](http://docs.splunk.com/Documentation/Splunk/7.1.2/Indexer/Aboutindexesandindexers) that's allowed for your token. -1. Complete the **Splunk HTTP Event Collector Configuration** form. +## SSL Configuration - 1. From the **Endpoint** field, enter the IP address and port for you Splunk instance (i.e. `http://splunk-server:8088`) +If your instance of Splunk uses SSL, your **Endpoint** will need to begin with `https://`. With the correct endpoint, the **SSL Configuration** form is enabled and ready to be completed. - Splunk usually uses port `8088`. If you're using Splunk Cloud, you'll need to work with [Splunk support](https://www.splunk.com/en_us/support-and-services.html) to get an endpoint URL. +1. Provide the **Client Private Key** and **Client Certificate**. You can either copy and paste them or upload them by using the **Read from a file** button. - 1. Enter the **Token** you obtained while completing the prerequisites (i.e., when you created a token in Splunk). + - You can use either a self-signed certificate or one provided by a certificate authority. - 1. From the **Source** field, enter the name of the token as entered in Splunk. + - You can generate a self-signed certificate using an openssl command. For example: - 1. **Optional:** Enter one or more [index](http://docs.splunk.com/Documentation/Splunk/7.1.2/Indexer/Aboutindexesandindexers) that's allowed for your token. + ``` + openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" + ``` -1. If your Splunk is using SSL, you need to complete the **SSL Configuration** form. +1. Enter your **Client Key Password**. - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. +1. Enter your **SSL Version**. The default version is `TLSv1_2`. - You can use either a self-signed certificate or one provided by a certificate authority. +1. Select whether or not you want to verify your SSL. If the **Enabled - Input trusted server certificate** option is selected, a certificate section is enabled. You can copy and paste the certificate or upload it using the **Read from a file** button. - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - 1. Enter your private key password. - - 1. If you are using a self-signed certificate, you need to select the **Enabled - Input trusted server certificate** option and enter your **CA Certificate PEM**. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes event data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Splunk. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to Splunk. Log into your Splunk instance to view events for your cluster and containers. + * If you are using a self-signed certificate, provide the **CA Certificate PEM**. + * If you are using a certificate from a certificate authority, provide your **Trusted Server Certificate Chain**. ## Viewing Logs diff --git a/content/rancher/v2.x/en/cluster-admin/tools/logging/syslog/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/logging/syslog/_index.md index afe380c15fa..d9d23200cd1 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/logging/syslog/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/logging/syslog/_index.md @@ -5,70 +5,40 @@ aliases: - /rancher/v2.x/en/tools/logging/syslog/ --- -You can configure Rancher to send Kubernetes logs to a [Syslog](https://tools.ietf.org/html/rfc5424) server. - -## Configuring Syslog - -You can configure Rancher to send cluster or project logs to Syslog. +If your organization uses [Syslog](https://tools.ietf.org/html/rfc5424), you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Syslog server to view logs. >**Prerequisite:** You must have a Syslog server configured. -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. +If you are using rsyslog, please make sure your rsyslog authentication mode is `x509/name`. -1. From the **Global** view, open the cluster that you want to configure logging for. +## Syslog Configuration -1. From the main menu, select **Tools > Logging**. +1. In the **Endpoint** field, enter the IP address and port for your Syslog server. Additionally, in the dropdown, select the protocol that your Syslog server uses. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. +1. In the **Program** field, enter the name of the application sending logs to your Syslog server, e.g. `Rancher`. -1. From the **Global** view, open the project that you want to configure logging for. +1. If you are using a cloud logging service, e.g. [Sumologic](https://www.sumologic.com/), enter a **Token** that authenticates with your Syslog server. You will need to create this token in the cloud logging service. -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. +1. Select a **Log Severity** for events that are logged to the Syslog server. For more information on each severity level, see the [Syslog protocol documentation](https://tools.ietf.org/html/rfc5424#page-11). -{{% /accordion %}} +## Encryption Configuration -1. Select **Syslog**. +If your Syslog server is using **TCP** protocol and uses TLS, you need to select **Use TLS** and complete the **Encryption Configuration** form. -1. Complete the **Syslog Configuration** form. +1. Select whether or not you want to verify your SSL. If the **Enabled - Input trusted server certificate** option is selected, a certificate section is enabled. You can either copy and paste the certificate or upload them by **Read from a file**. - 1. From the **Endpoint** field, enter the IP address and port for your Syslog server. Additionally, select the protocol that your Syslog server uses from the drop-down. + * If you are using a self-signed certificate, provide the **CA Certificate PEM**. + * If you are using a certificate from a certificate authority, provide your **Trusted Server Certificate Chain**. - 1. From the **Program** field, enter the name of the application sending logs to your Syslog server (i.e., Rancher). +1. Provide the **Client Private Key** and **Client Certificate**. You can either copy and paste them or upload them by using the **Read from a file** button. - 1. If you are using a cloud logging service (i.e., [Sumologic](https://www.sumologic.com/)), enter a **Token** that authenticates with your Syslog server. Use the cloud logging service to create this token. + - You can use either a self-signed certificate or one provided by a certificate authority. - 1. Select a **Log Severity** for events that are logged to the Syslog server. For more information on each severity level, see the [Syslog protocol documentation](https://tools.ietf.org/html/rfc5424#page-11). + - You can generate a self-signed certificate using an openssl command. For example: -1. If your Syslog is using **TCP** protocol, you need to select **Use TLS** and complete the **SSL Configuration** form. + ``` + openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" + ``` +1. Enter your private key password. - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. - - You can use either a self-signed certificate or one provided by a certificate authority. - - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - 1. Enter your private key password. - - 1. If you are using a self-signed certificate, you need to select the **Enabled - Input trusted server certificate** option and enter your **CA Certificate PEM**. - - 1. If you are using rsyslog, please make sure your rsyslog authentication mode is **x509/name**. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Syslog. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to your Syslog server. View your Syslog stream to view logs for your cluster and containers. +1. If you are using a self-signed certificate, you need to select the **Enabled - Input trusted server certificate** option and provide your **CA Certificate PEM** certificate. You can copy and paste the certificate or upload it using the **Read from a file** button diff --git a/content/rancher/v2.x/en/cluster-admin/tools/monitoring/_index.md b/content/rancher/v2.x/en/cluster-admin/tools/monitoring/_index.md index 45b6cbc8659..c1d414147a3 100644 --- a/content/rancher/v2.x/en/cluster-admin/tools/monitoring/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/tools/monitoring/_index.md @@ -46,9 +46,11 @@ Using Prometheus, you can monitor Rancher at both the cluster and project level. [Cluster monitoring](#cluster-monitoring) allows you to view the health of a cluster's Kubernetes control plane and individual nodes. System administrators will likely be more interested in cluster monitoring, as administrators are more invested in the health of the Rancher control plane and cluster nodes. -[Project monitoring](#project-monitoring) lets you view the state of pods running in a given project. Users responsible for maintaining a project will be most interested in project monitoring, as it helps them keep their applications up and running for their users. +[Project monitoring]({{< baseurl >}}/rancher/v2.x/en/project-admin/tools/monitoring/) lets you view the state of pods running in a given project. Users responsible for maintaining a project will be most interested in project monitoring, as it helps them keep their applications up and running for their users. When you enable monitoring for a Rancher project, Prometheus collects metrics from its deployed HTTP and TCP/UDP workloads. -### Cluster Monitoring +For the rest of this document, everything is referred to monitoring for a cluster. + +## Cluster Monitoring When you enable monitoring for one of your Rancher clusters, Prometheus collects metrics from the cluster components below, which you can view in graphs and charts. We'll have more about the specific metrics collected later in this document. @@ -56,16 +58,10 @@ When you enable monitoring for one of your Rancher clusters, Prometheus collects - [etcd database](#etcd-metrics) - [All nodes (including workers)](#cluster-metrics) -### Project Monitoring - -When you enable monitoring for a Rancher project, Prometheus collects metrics from its deployed HTTP and TCP/UDP workloads. We'll have more about the specific metrics collected [later in this document](#custom-metrics). - -## Configuring Cluster Monitoring +## Configuring Monitoring You can deploy Prometheus monitoring for a cluster, navigate to **Tools > Monitoring** as shown in the GIF below, which displays a user enabling cluster monitoring for a cluster named `local`. The only required action for deployment is to select the **Enable** option and click **Save**, but you might want to [customize configuration options](#prometheus-configuration-options) for your environment. -![EnableClusterMonitoring]({{< baseurl >}}/img/rancher/enable-cluster-monitoring.gif) - Following Prometheus deployment, two monitoring applications are added to the cluster's `system` project's **Apps** page: `cluster-monitoring` and `monitoring-operator`. You can use the `cluster-monitoring` catalog app to [access the Grafana instance](#grafana-accessing-for-clusters) for the cluster. ### Resource Consumption @@ -93,19 +89,9 @@ Kube State Cluster Monitor | 100 | 130 Grafana | 100 | 150 Prometheus Cluster Monitoring Nginx | 50 | 50 -## Configuring Project Monitoring - -You can enable project monitoring by opening the project and then selecting **Tools > Monitoring** as shown in the GIF below, which displays enabling the `default` project monitoring. - -![EnableProjectMonitoring]({{< baseurl >}}/img/rancher/enable-project-monitoring.gif) - -After you enable project monitoring, a single application is added to the project's **Apps** page: `project-monitoring`. Use this catalog app to [access the Grafana instance](#grafana-accessing-for-projects) for the project. - -With enabling cluster monitoring, you can collect the [Workload metrics](#workload-metrics) for this project, otherwise, you can only collect the [Custom metrics](#custom-metrics) from this project. - ## Prometheus Configuration Options -While configuring monitoring at either the cluster or project level, you can choose options to customize your monitoring settings. You can enable the options below while completing either [Configuring Cluster Monitoring](#configuring-cluster-monitoring) or [Configuring Project Monitoring](#configuring-project-monitoring). +While configuring monitoring at either the cluster or project level, you can choose options to customize your monitoring settings. Option | Description -------|------------- @@ -122,7 +108,7 @@ Add Selector | If you want to deploy the Prometheus/Grafana pods to a specific n ### Enable Node Exporter -Node Exporter is a popular open source exporter which can expose the metrics for hardware and \*NIX kernels OS, it is designed to monitor the host system. However, there are still namespacing issues with running it in a container, mostly around filesystem mount spaces. So if we need to monitor the actual network stats for the container network, we must deploy it with `hostNetwork` mode. +Node Exporter is a popular open source exporter which can expose the metrics for hardware and \*NIX kernels OS, it is designed to monitor the host system. However, there are still issues with namespaces when running it in a container, mostly around filesystem mount spaces. So if we need to monitor the actual network stats for the container network, we must deploy it with `hostNetwork` mode. Firstly, you need to consider which host port should expose to avoid port conflicts and fill into `Node Exporter Host Port` field. Secondly, you must open that port to allow the internal traffic from `Prometheus`. @@ -138,7 +124,7 @@ You can configure persistent storage for Prometheus and/or Grafana by using the >**Warning:** Monitoring app is [a specially designed app](https://github.com/rancher/system-charts/tree/dev/charts/rancher-monitoring). Any modification without familiarizing the entire app can lead to catastrophic errors. -Monitoring is driven by [Rancher Catalog App]({{< baseurl >}}/rancher/v2.x/en/catalog), so you can expand all options by clicking the **Show advanced options** and then configure it as you wolud configure any other app. +Monitoring is driven by [Rancher catalog application]({{< baseurl >}}/rancher/v2.x/en/catalog/apps/), so you can expand all options by clicking the **Show advanced options** and then configure it as you would configure any other app. ## Viewing Metrics diff --git a/content/rancher/v2.x/en/cluster-admin/volumes-and-storage/persistent-volume-claims/_index.md b/content/rancher/v2.x/en/cluster-admin/volumes-and-storage/persistent-volume-claims/_index.md index 7845b93cd3b..23f3a45aabb 100644 --- a/content/rancher/v2.x/en/cluster-admin/volumes-and-storage/persistent-volume-claims/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/volumes-and-storage/persistent-volume-claims/_index.md @@ -3,7 +3,7 @@ title: Persistent Volume Claims weight: 3052 aliases: - /rancher/v2.x/en/tasks/workloads/add-persistent-volume-claim - - /rancher/v2.x/en/k8s-in-rancher/volumes-and-storage/examples/persistent-volume-claims/ + - /rancher/v2.x/en/k8s-in-rancher/volumes-and-storage/persistent-volume-claims/ --- _Persistent Volume Claims_ (or PVCs) are objects that request storage resources from your cluster. They're similar to a voucher that your deployment can redeem for storage access. When you create a deployment, you should usually attach a PVC so that your application can lay claim to persistent storage. This claim lets your deployment application store its data in an external location, so that if one of the application's containers fails, it can be replaced with a new container and continue accessing its data stored externally, as though an outage never occurred. diff --git a/content/rancher/v2.x/en/installation/options/api-audit-log/_index.md b/content/rancher/v2.x/en/installation/options/api-audit-log/_index.md index 7fe798eb7ed..e73c033156d 100644 --- a/content/rancher/v2.x/en/installation/options/api-audit-log/_index.md +++ b/content/rancher/v2.x/en/installation/options/api-audit-log/_index.md @@ -4,6 +4,7 @@ weight: 10000 aliases: - /rancher/v2.x/en/installation/api-auditing/ - /rancher/v2.x/en/admin-settings/api-auditing/ + - /rancher/v2.x/en/admin-settings/api-audit-log/ --- You can enable the API audit log to record the sequence of system events initiated by individual users. You can know what happened, when it happened, who initiated it, and what cluster it affected. When you enable this feature, all requests to the Rancher API and all responses from it are written to a log. diff --git a/content/rancher/v2.x/en/project-admin/tools/alerts/_index.md b/content/rancher/v2.x/en/project-admin/tools/alerts/_index.md index 03fe93b5e04..221cfc2238c 100644 --- a/content/rancher/v2.x/en/project-admin/tools/alerts/_index.md +++ b/content/rancher/v2.x/en/project-admin/tools/alerts/_index.md @@ -22,9 +22,7 @@ At the project level, Rancher monitors specific deployments and sends alerts for >**Prerequisite:** Before you can receive project alerts, you must [add a notifier]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/notifiers/#adding-notifiers). -1. From the **Global** view, open the project that you want to configure alerts for. - -1. From the main menu, select **Tools > Alerts**. In versions prior to v2.2.0, you can choose **Resources > Alerts**. +1. From the **Global** view, navigate to the project that you want to configure project alerts for. Select **Tools > Alerts**. In versions prior to v2.2.0, you can choose **Resources > Alerts**. 1. Click **Add Alert Group**. diff --git a/content/rancher/v2.x/en/project-admin/tools/logging/_index.md b/content/rancher/v2.x/en/project-admin/tools/logging/_index.md index 12c9d60714a..e59aca33d95 100644 --- a/content/rancher/v2.x/en/project-admin/tools/logging/_index.md +++ b/content/rancher/v2.x/en/project-admin/tools/logging/_index.md @@ -7,15 +7,17 @@ Rancher can integrate with a variety of popular logging services and tools that Rancher supports the following services: -- [Elasticsearch]({{< baseurl >}}/rancher/v2.x/en/tools/logging/elasticsearch) -- [Splunk]({{< baseurl >}}/rancher/v2.x/en/tools/logging/splunk) -- [Kafka]({{< baseurl >}}/rancher/v2.x/en/tools/logging/kafka) -- [Syslog]({{< baseurl >}}/rancher/v2.x/en/tools/logging/syslog) -- [Fluentd]({{< baseurl >}}/rancher/v2.x/en/tools/logging/fluentd) +- Elasticsearch +- Splunk +- Kafka +- Syslog +- Fluentd + +>**Note:** You can only configure one logging service per cluster or per project. ## Requirements -Docker daemon should be [configured](https://docs.docker.com/config/containers/logging/configure/) with the (default) log-driver: `json-file`. You can check the log-driver by running the following command: +The Docker daemon on each node in the cluster should be [configured](https://docs.docker.com/config/containers/logging/configure/) with the (default) log-driver: `json-file`. You can check the log-driver by running the following command: ``` $ docker info | grep 'Logging Driver' @@ -24,7 +26,7 @@ Logging Driver: json-file ## Advantages -Setting up a logging service to collect logs from your cluster/project is helpful several ways: +Setting up a logging service to collect logs from your cluster/project has several advantages: - Logs errors and warnings in your Kubernetes infrastructure to a stream. The stream informs you of events like a container crashing, a pod eviction, or a node dying. - Allows you to capture and analyze the state of your cluster and look for trends in your environment using the log stream. @@ -33,24 +35,49 @@ Setting up a logging service to collect logs from your cluster/project is helpfu ## Logging Scope -You can configure logging at either cluster or project level. +You can configure logging at either [cluster level]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/) or project level. ->**Note:** You can only configure one logging service per cluster or project. +- Cluster logging writes logs for every pod in the cluster, i.e. in all the projects. For [RKE clusters]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters), it also writes logts for all the Kubernetes system components. -- If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. +- Project logging writes logs for every pod in that particular project. - Cluster logging writes logs for every pod in the cluster and, in [RKE clusters]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters), Kubernetes system components. Logs from the following locations are sent to your logging service: +Logs that are sent to your logging service are from the following locations: + - Pod logs stored at `/var/log/containers`. - - The `/var/log/containers` path for pod logging. + - Kubernetes system components logs stored at `/var/lib/rancher/rke/logs/`. - - The `/var/lib/rancher/rke/logs/` path for Kubernetes system components. +## Enabling Project Logging -- If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. +As an [administrator]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/global-permissions/), [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) or [project owner]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles), you can configure Rancher to send Kubernetes logs to a logging service. - Project logging writes logs for every pod in the project. +1. From the **Global** view, navigate to the project that you want to configure project logging for. -After collection, all logs are stored by your logging service. Log into your service to view them. +1. Select **Tools > Logging** in the navigation bar. In versions prior to v2.2.0, you can choose **Resources > Logging**. + +1. Select a logging service and enter the configuration. Refer to the specific service for detailed configuration. Rancher supports the following services: + + > **Note:** Configuring logging for a specific service is the same for a cluster or a project. + + - [Elasticsearch]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/elasticsearch) + - [Splunk]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/splunk) + - [Kafka]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/kafka) + - [Syslog]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/syslog) + - [Fluentd]({{< baseurl >}}/rancher/v2.x/en/cluster-admin/tools/logging/fluentd) + +1. Complete the **Additional Logging Configuration** form. + + 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. + + 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes data to the logging server. Intervals are measured in seconds. + + 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. + +1. Click **Test**. Rancher sends a test log to the service. + +1. Click **Save**. + +**Result:** Rancher is now configured to send logs to the selected service. Log into the logging service so that you can start viewing the logs. ## Related Links diff --git a/content/rancher/v2.x/en/project-admin/tools/logging/custom/_index.md b/content/rancher/v2.x/en/project-admin/tools/logging/custom/_index.md deleted file mode 100644 index 573a8fc845a..00000000000 --- a/content/rancher/v2.x/en/project-admin/tools/logging/custom/_index.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Custom -weight: 700 ---- - -_Available as of v2.2.0_ - -You can configure Rancher to send Kubernetes logs to Elasticsearch, Splunk, Kafka, Syslog or Fluentd. - -## Configuring Advance Mode - -You can configure Rancher to send cluster or project logs to one of the logging targets in advance mode by inputting raw fluentd configuration. - ->**Prerequisite:** You must have a one of the logging targets of Elasticsearch, Splunk, Kafka, Syslog and Fluentd server configured. - -1. Browse to the cluster or project. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. - -1. From the **Global** view, open the cluster that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. - -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. - -1. From the **Global** view, open the project that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. - -{{% /accordion %}} - -1. Select one of the logging targets, giving example for **Elasticsearch**. - -1. Click the **Edit as File**. - - 1. Input the Fluentd output configuration. - - 1. Giving an example for **Elasticsearch** target. - - ```sh - @type elasticsearch - include_tag_key true - user elasticsearch - password PleaseChaneMe - hosts https://rancher.com:9200 - logstash_format true - logstash_prefix elastic-index - logstash_dateformat %Y-%m-%d - type_name container_log - - ``` - - 1. For Elasticsearch configuration, see [Elasticsearch Documentation](https://github.com/uken/fluent-plugin-elasticsearch) for details. - - 1. For Splunk configuration, see [Splunk Documentation](https://github.com/fluent/fluent-plugin-splunk) for details. - - 1. For Kafka configuration, see [Kafka Documentation](https://github.com/fluent/fluent-plugin-kafka) for details. - - 1. For Syslog configuration, see [Syslog Documentation](https://github.com/dlackty/fluent-plugin-remote_syslog) for details. - - 1. For Fluentd configuration, see [Fluentd Documentation](https://docs.fluentd.org/v1.0/articles/out_forward) for details. - -1. If your logging server is using TLS, you need to complete the **SSL Configuration** form. - - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. - - You can use either a self-signed certificate or one provided by a certificate authority. - - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - - 1. If you are using a self-signed certificate, you need to provide the **CA Certificate PEM** as well. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Dry Run**. Rancher calls the fluentd dry run command to validate the configuration. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to your configured server. View your server to see logs for your cluster and containers. diff --git a/content/rancher/v2.x/en/project-admin/tools/logging/elasticsearch/_index.md b/content/rancher/v2.x/en/project-admin/tools/logging/elasticsearch/_index.md deleted file mode 100644 index 66929ec2b24..00000000000 --- a/content/rancher/v2.x/en/project-admin/tools/logging/elasticsearch/_index.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Elasticsearch -weight: 200 ---- - -If your organization uses [Elasticsearch](https://www.elastic.co/), either on premise or in the cloud, you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Elasticsearch deployment to view logs for your cluster or container. - -## Configuring Elasticsearch Logging - -You can configure Rancher to send logs from your cluster or project to your instance of Elasticsearch. - ->**Prerequisites:** Configure an [Elasticsearch deployment](https://www.elastic.co/guide/en/cloud/saas-release/ec-create-deployment.html). - -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. - -1. From the **Global** view, open the cluster that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. - -1. From the **Global** view, open the project that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} - -1. Select **Elasticsearch**. - -1. Complete the **Elasticsearch Configuration** form. - - 1. From the **Endpoint** field, enter the IP address and port for your Elasticsearch instance. You can copy this information from the dashboard of your Elasticsearch deployment. Elasticsearch usually uses port `9200` for HTTP and `9243` for HTTPS. - - 1. If you are using [X-Pack Security](https://www.elastic.co/guide/en/x-pack/current/xpack-introduction.html), enter your Elasticsearch **Username** and **Password** for authentication. - - 1. Enter an [Index Pattern](https://www.elastic.co/guide/en/kibana/current/index-patterns.html). - -1. If your instance of Elasticsearch uses SSL, complete the **SSL Configuration** form. - - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. - - You can use either a self-signed certificate or one provided by a certificate authority. - - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - - 1. If you are using a self-signed certificate, you need to provide the **CA Certificate PEM** as well. - - 1. Enter your private key password. - - 1. Enter your ssl version. The default version is tlsv1_2. - - 1. Select the **Enabled - Input trusted server certificate** option and enter your **Trusted Server Certificate Chain** if you are using a certificate from a certificate authority. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Elasticsearch. - -1. Click **Save**. - -**Result:** Rancher is now configured to send cluster and container logs to Elasticsearch. Log into Elasticsearch or Kibana to view your cluster/project logs. diff --git a/content/rancher/v2.x/en/project-admin/tools/logging/fluentd/_index.md b/content/rancher/v2.x/en/project-admin/tools/logging/fluentd/_index.md deleted file mode 100644 index a52867e00c9..00000000000 --- a/content/rancher/v2.x/en/project-admin/tools/logging/fluentd/_index.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Fluentd -weight: 600 ---- - -If your organization is using [Fluentd](https://www.fluentd.org/), you can configure Rancher to send logs to Fluentd server. - -## Configuring Fluentd Logging - -You can configure Rancher to send Kubernetes logs to your Fluentd. - ->**Prerequisites:** Configure Fluentd input forward to receive the event stream. -> ->See [Fluentd Documentation](https://docs.fluentd.org/v1.0/articles/in_forward) for details. - -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. - -1. From the **Global** view, open the cluster that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. - -1. From the **Global** view, open the project that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} - -1. Select **Fluentd**. - -1. Complete the **Fluentd Server Configuration** form. - - 1. From the **Endpoint** field, enter the address of you Fluentd instance (i.e. `http://Fluentd-server:24224`). - - 1. Enter the **Shared Key** if your Fluentd Server is using shared key for authentication. - - 1. Enter the **Username** and **Password** if your Fluentd Server is using username and pasword for authentication. - - 1. **Optional:** Enter the **Hostname** of the server. - - 1. Enter the load balancing **Weight** of the server. If the weight of one server is 20 and the other server is 30, events will be sent in a 2:3 ratio. The default weight is 60 if you leave this field empty. - - 1. Check **Use as Standby Only** if this server is standby. Standby servers will be used when all non-standby servers are down. - - 1. You can add multiple Fluentd servers. - -1. Select **Enable Gzip Compression**. The transferred payload size will be reduced. - -1. If your Fluentd is using SSL, you need to complete the **SSL Configuration** form. - - 1. If you are using a self-signed certificate, you need to provide the **CA Certificate PEM** as well. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes event data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Fluentd with rancher tag. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to Fluentd. Check you Fluentd output events for your cluster and containers. diff --git a/content/rancher/v2.x/en/project-admin/tools/logging/kafka/_index.md b/content/rancher/v2.x/en/project-admin/tools/logging/kafka/_index.md deleted file mode 100644 index 2237e99f6ce..00000000000 --- a/content/rancher/v2.x/en/project-admin/tools/logging/kafka/_index.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Kafka -weight: 400 ---- - -You can configure Rancher to send cluster or project logs to a [Kafka](https://kafka.apache.org/) server. - -## Configuring Kafka Logging - ->**Prerequisite:** You must have a Kafka server configured. - -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. - -1. From the **Global** view, open the cluster that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. - -1. From the **Global** view, open the project that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} - -1. Select **Kafka**. - -1. Complete the **Kafka Configuration** form. - - 1. From **Endpoint Type**, select the type of Kafka server you are using: **Zookeeper** or **Broker**. - - 1. From the **Endpoint** field, enter the IP address and the port for your Zookeeper or Broker. For Broker type, you can add multiple endpoints. - - By default, Zookeeper uses port `2181`, Kafka broker uses port `9092`. Please note that Zookeeper endpoint is for Kafka cluster not enable tls. - - 1. From the **Topic** field, enter the name of a Kafka [topic](https://kafka.apache.org/documentation/#basic_ops_add_topic) that your Kubernetes cluster submits logs to. - -1. If your Kafka cluster is using SSL for **Broker**, you need to complete the **SSL Configuration** form. - - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. - - You can use either a self-signed certificate or one provided by a certificate authority. - - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - - 1. If you are using a self-signed certificate, you need to provide the **CA Certificate PEM** as well. - -1. If your Kafka cluster is using SASL authentication for **Broker**, you need to complete the **SASL Configuration** form. See [Kafka SASL](https://kafka.apache.org/documentation/#security_sasl) for details. - - 1. Enter SASL **Username** and **Passwork** - - 1. Select **SASL Type** which your Kafka is using. Please make sure your Kafka cluster is using SSL when you select **Plain**. - - 1. If your Kafka is using **Scram**, you need to select which **Scram Mechanism** Kafka is using. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes logs to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Kafka. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to Kafka. View your Kafka stream to view logs for your cluster and containers. diff --git a/content/rancher/v2.x/en/project-admin/tools/logging/splunk/_index.md b/content/rancher/v2.x/en/project-admin/tools/logging/splunk/_index.md deleted file mode 100644 index 1ded1cc0fac..00000000000 --- a/content/rancher/v2.x/en/project-admin/tools/logging/splunk/_index.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Splunk -weight: 300 ---- - -If your organization uses [Splunk](https://www.splunk.com/), you can configure Rancher to send it cluster or project logs. Afterwards logs are sent, you can use Splunk to view them. - -## Configuring Splunk Logging - -You can configure Rancher to send Kubernetes logs to your instance of Splunk. - ->**Prerequisites:** -> ->- Configure HTTP event collection for your Splunk Server (Splunk Enterprise or Splunk Cloud). ->- Enable all tokens, and then create a new token. -> ->For more information, see [Splunk Documentation](http://docs.splunk.com/Documentation/Splunk/7.1.2/Data/UsetheHTTPEventCollector#About_Event_Collector_tokens). - -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. - -1. From the **Global** view, open the cluster that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. - -1. From the **Global** view, open the project that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. -{{% /accordion %}} - -1. Select **Splunk**. - -1. Complete the **Splunk HTTP Event Collector Configuration** form. - - 1. From the **Endpoint** field, enter the IP address and port for you Splunk instance (i.e. `http://splunk-server:8088`) - - Splunk usually uses port `8088`. If you're using Splunk Cloud, you'll need to work with [Splunk support](https://www.splunk.com/en_us/support-and-services.html) to get an endpoint URL. - - 1. Enter the **Token** you obtained while completing the prerequisites (i.e., when you created a token in Splunk). - - 1. From the **Source** field, enter the name of the token as entered in Splunk. - - 1. **Optional:** Enter one or more [index](http://docs.splunk.com/Documentation/Splunk/7.1.2/Indexer/Aboutindexesandindexers) that's allowed for your token. - -1. If your Splunk is using SSL, you need to complete the **SSL Configuration** form. - - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. - - You can use either a self-signed certificate or one provided by a certificate authority. - - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - 1. Enter your private key password. - - 1. If you are using a self-signed certificate, you need to select the **Enabled - Input trusted server certificate** option and enter your **CA Certificate PEM**. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes event data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Splunk. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to Splunk. Log into your Splunk instance to view events for your cluster and containers. - -## Viewing Logs - -1. Log into your Splunk server. - -1. Click on **Search & Reporting**. The number of **Indexed Events** listed should be increasing. - -1. Click on Data Summary and select the Sources tab. - ![View Logs]({{< baseurl >}}/img/rancher/splunk/splunk4.jpg) - -1. To view the actual logs, click on the source that you declared earlier. - ![View Logs]({{< baseurl >}}/img/rancher/splunk/splunk5.jpg) - -## Troubleshooting - -You can use curl to see if **HEC** is listening for HTTP event data. - -``` -$ curl http://splunk-server:8088/services/collector/event \ - -H 'Authorization: Splunk 8da70994-b1b0-4a79-b154-bfaae8f93432' \ - -d '{"event": "hello world"}' -``` - -If Splunk is configured correctly, you should receive **json** data returning `success code 0`. You should be able -to send logging data to HEC. - -If you received an error, check your configuration in Splunk and Rancher. diff --git a/content/rancher/v2.x/en/project-admin/tools/logging/syslog/_index.md b/content/rancher/v2.x/en/project-admin/tools/logging/syslog/_index.md deleted file mode 100644 index 6b9d3c22668..00000000000 --- a/content/rancher/v2.x/en/project-admin/tools/logging/syslog/_index.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: Syslog -weight: 500 ---- - -You can configure Rancher to send Kubernetes logs to a [Syslog](https://tools.ietf.org/html/rfc5424) server. - -## Configuring Syslog - -You can configure Rancher to send cluster or project logs to Syslog. - ->**Prerequisite:** You must have a Syslog server configured. - -1. Browse to the cluster or project that you want to log. -{{% accordion id="cluster" label="To Configure Cluster Logging:" %}} -If you're a [cluster owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) who works in operations or security, configure cluster logging. - -1. From the **Global** view, open the cluster that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. - -{{% /accordion %}} -{{% accordion id="project" label="To Configure Project Logging:" %}} -If you're a [project owner or member]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-roles) who works on an application, configure project logging. - -1. From the **Global** view, open the project that you want to configure logging for. - -1. From the main menu, select **Tools > Logging**. In versions prior to v2.2.0, you can choose **Resources > Logging**. - -{{% /accordion %}} - -1. Select **Syslog**. - -1. Complete the **Syslog Configuration** form. - - 1. From the **Endpoint** field, enter the IP address and port for your Syslog server. Additionally, select the protocol that your Syslog server uses from the drop-down. - - 1. From the **Program** field, enter the name of the application sending logs to your Syslog server (i.e., Rancher). - - 1. If you are using a cloud logging service (i.e., [Sumologic](https://www.sumologic.com/)), enter a **Token** that authenticates with your Syslog server. Use the cloud logging service to create this token. - - 1. Select a **Log Severity** for events that are logged to the Syslog server. For more information on each severity level, see the [Syslog protocol documentation](https://tools.ietf.org/html/rfc5424#page-11). - -1. If your Syslog is using **TCP** protocol, you need to select **Use TLS** and complete the **SSL Configuration** form. - - 1. Enter the private key and client certificate. You can either copy and paste them or upload them by **Read from a file**. - - You can use either a self-signed certificate or one provided by a certificate authority. - - You can generate a self-signed certificate using an openssl command. For example: - - openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com" - - 1. Enter your private key password. - - 1. If you are using a self-signed certificate, you need to select the **Enabled - Input trusted server certificate** option and enter your **CA Certificate PEM**. - - 1. If you are using rsyslog, please make sure your rsyslog authentication mode is **x509/name**. - -1. Complete the **Additional Logging Configuration** form. - - 1. **Optional:** Use the **Add Field** button to add custom log fields to your logging configuration. These fields are key value pairs (such as `foo=bar`) that you can use to filter the logs from another system. - - 1. Enter a **Flush Interval**. This value determines how often [Fluentd](https://www.fluentd.org/) flushes data to the logging server. Intervals are measured in seconds. - - 1. **Include System Log**. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs. - -1. Click **Test**. Rancher sends a test log to Syslog. - -1. Click **Save**. - -**Result:** Rancher is now configured to send logs to your Syslog server. View your Syslog stream to view logs for your cluster and containers.