You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this page, we will show you how to send application logs from your Kubernetes cluster to your Cockpit using either a Helm chart or deploying a Helm chart with [Terraform](https://www.terraform.io/).
@@ -43,14 +43,14 @@ destinations:
43
43
- name: "my-cockpit-logs"
44
44
type: "loki"
45
45
protocol: "http"
46
-
logs:
46
+
logs:
47
47
enabled: true
48
48
url: "$COCKPIT_CUSTOM_LOGS_DATASOURCE_URL/loki/api/v1/push"##You can find your logs URL in the **Data sources** tab of the Scaleway console under the "API URL" section of the relevant data source
49
49
tenantId: "$COCKPIT_TOKEN"
50
-
51
-
metrics:
50
+
51
+
metrics:
52
52
enabled: false
53
-
traces:
53
+
traces:
54
54
enabled: false
55
55
clusterEvents:
56
56
enabled: true
@@ -78,7 +78,7 @@ alloy-singleton:
78
78
79
79
<Message type="note">
80
80
The template above is for sending logs to your Cockpit. You can also configure it to send metrics to Cockpit using this Helm chart.
81
-
Refer to our dedicated documentation to [send metrics from your cluster to Cockpit](/observability/cockpit/how-to/send-metrics-froms-k8s-to-cockpit).
81
+
Refer to our dedicated documentation to [send metrics from your cluster to Cockpit](/observability/cockpit/how-to/send-metrics-from-k8s-to-cockpit).
82
82
</Message>
83
83
84
84
## Send Kubernetes logs using Helm chart
@@ -87,49 +87,48 @@ Once you have configured your `values.yml` file, you can use Helm to deploy the
87
87
88
88
1. [Connect](/containers/kubernetes/how-to/connect-cluster-kubectl/) `kubectl` to your Kubernetes cluster
89
89
2. Run the command below to install the `k8s-monitoring` Helm chart:
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-log-ingester` with a clear name (ex. `alloy-logs-ingester`). In our configuration, we are using `alloy-lm-ingester`.
94
-
95
-
Helm installs the `k8s-monitoring` chart, which includes the Alloy DaemonSet configured to collect logs from your Kubernetes cluster.
96
-
The DaemonSet ensures that a pod is running on each node in your cluster, which collects logs and forwards them to the specified Loki endpoint in your Cockpit.
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-log-ingester` with a clear name (ex. `alloy-logs-ingester`). In our configuration, we are using `alloy-lm-ingester`.
94
+
Helm installs the `k8s-monitoring` chart, which includes the Alloy DaemonSet configured to collect logs from your Kubernetes cluster.
95
+
The DaemonSet ensures that a pod is running on each node in your cluster, which collects logs and forwards them to the specified Loki endpoint in your Cockpit.
97
96
98
97
3. Optionally, check the status of the release to ensure it was installed:
99
98
100
-
```
101
-
helm list
102
-
```
99
+
```
100
+
helm list
101
+
```
103
102
104
103
## Send Kubernetes logs using Helm chart with Terraform
105
104
106
105
You can also use Terraform to manage and deploy Helm charts, providing you with more automation and consistency to manage your Kubernetes resources.
107
106
108
107
1. Create a `provider.tf` file and paste the following template to set up the Helm Terraform provider:
109
-
```terraform
110
-
provider "helm" {
111
-
kubernetes {
112
-
host = your_k8s_cluster_host # The URL of your Kubernetes API server.
113
-
token = your_k8s_cluster_token # Authentication token to access the cluster.
114
-
cluster_ca_certificate = base64decode(
115
-
your_k8s_cluster_ca_certificate # The cluster's CA certificate.
116
-
)
108
+
```terraform
109
+
provider "helm" {
110
+
kubernetes {
111
+
host = your_k8s_cluster_host # The URL of your Kubernetes API server.
112
+
token = your_k8s_cluster_token # Authentication token to access the cluster.
113
+
cluster_ca_certificate = base64decode(
114
+
your_k8s_cluster_ca_certificate # The cluster's CA certificate.
115
+
)
116
+
}
117
117
}
118
-
}
119
-
```
118
+
```
120
119
2. Create a `maint.tf` file and paste the following template to create a Helm release resource. Make sure that you replace `/your-path/to/values.yml` with the actual path to your values file.
## Send Kubernetes metrics using Helm chart with Terraform
113
113
114
114
1. Create a `provider.tf` file and paste the following template to set up the Helm Terraform provider:
115
-
```terraform
116
-
provider "helm" {
117
-
kubernetes {
118
-
host = your_k8s_cluster_host # The URL of your Kubernetes API server.
119
-
token = your_k8s_cluster_token # Authentication token to access the cluster.
120
-
cluster_ca_certificate = base64decode(
121
-
your_k8s_cluster_ca_certificate # The cluster's CA certificate.
122
-
)
115
+
```terraform
116
+
provider "helm" {
117
+
kubernetes {
118
+
host = your_k8s_cluster_host # The URL of your Kubernetes API server.
119
+
token = your_k8s_cluster_token # Authentication token to access the cluster.
120
+
cluster_ca_certificate = base64decode(
121
+
your_k8s_cluster_ca_certificate # The cluster's CA certificate.
122
+
)
123
+
}
123
124
}
124
-
}
125
-
```
125
+
```
126
126
2. Create a `maint.tf` file and paste the following template to create a Helm release resource. Make sure that you replace `/your-path/to/values.yml` with the actual path to your values file.
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-metric-ingester` with a clear name (ex. `alloy-metrics-ingester`). In our configuration, we are using `alloy-lm-ingester`.
154
-
155
-
Helm installs the `k8s-monitoring` chart, which includes the Alloy DaemonSet configured to collect metrics from your Kubernetes cluster.
156
-
The DaemonSet ensures that a pod is running on each node in your cluster, which collects metrics and forwards them to the specified Prometheus endpoint in your Cockpit.
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-metric-ingester` with a clear name (ex. `alloy-metrics-ingester`). In our configuration, we are using `alloy-lm-ingester`.
154
+
Helm installs the `k8s-monitoring` chart, which includes the Alloy DaemonSet configured to collect metrics from your Kubernetes cluster.
155
+
The DaemonSet ensures that a pod is running on each node in your cluster, which collects metrics and forwards them to the specified Prometheus endpoint in your Cockpit.
157
156
158
157
3. Optionally, check the status of the release to ensure it was installed:
0 commit comments