Skip to content

Commit d77b81e

Browse files
nerda-codesLaure-di
authored andcommitted
docs(cpt): add images + fix dates (scaleway#4263)
1 parent 19df497 commit d77b81e

File tree

5 files changed

+80
-74
lines changed

5 files changed

+80
-74
lines changed

menu/navigation.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,6 +3558,14 @@
35583558
"label": "Send metrics to Cockpit using Grafana Alloy",
35593559
"slug": "send-metrics-with-grafana-alloy"
35603560
},
3561+
{
3562+
"label": "Send metrics from your Kubernetes cluster to Cockpit",
3563+
"slug": "send-metrics-from-k8s-to-cockpit"
3564+
},
3565+
{
3566+
"label": "Send logs from your Kubernetes cluster to Cockpit",
3567+
"slug": "send-logs-from-k8s-to-cockpit"
3568+
},
35613569
{
35623570
"label": "Send metrics and logs to your Cockpit",
35633571
"slug": "send-metrics-logs-to-cockpit"
231 KB
Loading
185 KB
Loading

observability/cockpit/how-to/send-log-from-k8s-to-cockpit.mdx renamed to observability/cockpit/how-to/send-logs-from-k8s-to-cockpit.mdx

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ tags: kubernetes cockpit logs observability monitoring cluster
99
categories:
1010
- observability
1111
dates:
12-
validation: 2025/01/20
13-
posted: 2025/01/20
12+
validation: 2025-01-20
13+
posted: 2025-01-20
1414
---
1515

1616
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:
4343
- name: "my-cockpit-logs"
4444
type: "loki"
4545
protocol: "http"
46-
logs:
46+
logs:
4747
enabled: true
4848
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
4949
tenantId: "$COCKPIT_TOKEN"
50-
51-
metrics:
50+
51+
metrics:
5252
enabled: false
53-
traces:
53+
traces:
5454
enabled: false
5555
clusterEvents:
5656
enabled: true
@@ -78,7 +78,7 @@ alloy-singleton:
7878
7979
<Message type="note">
8080
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).
8282
</Message>
8383
8484
## 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
8787

8888
1. [Connect](/containers/kubernetes/how-to/connect-cluster-kubectl/) `kubectl` to your Kubernetes cluster
8989
2. Run the command below to install the `k8s-monitoring` Helm chart:
90-
```
91-
helm install -f /your-path/to/values.yml name-of-your-choice-for-your-log-ingester k8s-monitoring --version 1.6.16
92-
```
93-
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.
90+
```
91+
helm install -f /your-path/to/values.yml name-of-your-choice-for-your-log-ingester k8s-monitoring --version 1.6.16
92+
```
93+
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.
9796

9897
3. Optionally, check the status of the release to ensure it was installed:
9998

100-
```
101-
helm list
102-
```
99+
```
100+
helm list
101+
```
103102

104103
## Send Kubernetes logs using Helm chart with Terraform
105104

106105
You can also use Terraform to manage and deploy Helm charts, providing you with more automation and consistency to manage your Kubernetes resources.
107106

108107
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+
}
117117
}
118-
}
119-
```
118+
```
120119
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.
121-
```
122-
resource "helm_release" "alloy" {
123-
name = "name-of-your-log-ingester"
124-
repository = "https://grafana.github.io/helm-charts"
125-
chart = "k8s-monitoring"
126-
version = "2.0.2"
127-
128-
namespace = "log-ingester"
129-
create_namespace = true
130-
values = [file("/your-path/to/values.yml")]
131-
}
132-
```
120+
```
121+
resource "helm_release" "alloy" {
122+
name = "name-of-your-log-ingester"
123+
repository = "https://grafana.github.io/helm-charts"
124+
chart = "k8s-monitoring"
125+
version = "2.0.2"
126+
127+
namespace = "log-ingester"
128+
create_namespace = true
129+
values = [file("/your-path/to/values.yml")]
130+
}
131+
```
133132
3. Save your changes.
134133
4. Run `terraform init` to initialize your Terraform configuration and download any necessary providers.
135134
5. Run `terraform apply` to apply your configuration.

observability/cockpit/how-to/send-metrics-from-k8s-to-cockpit.mdx

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ tags: kubernetes cockpit metrics observability monitoring cluster
99
categories:
1010
- observability
1111
dates:
12-
validation: 2025/01/20
13-
posted: 2025/01/20
12+
validation: 2025-01-20
13+
posted: 2025-01-20
1414
---
1515

1616

@@ -45,14 +45,14 @@ destinations:
4545
- name: "my-cockpit-metrics"
4646
type: "prometheus"
4747
protocol: "http"
48-
metrics:
48+
metrics:
4949
enabled: true
5050
url: "$COCKPIT_CUSTOM_METRICS_DATASOURCE_URL/api/v1/push"
5151
tenantId: "$COCKPIT_TOKEN"
52-
53-
logs:
52+
53+
logs:
5454
enabled: false
55-
traces:
55+
traces:
5656
enabled: false
5757

5858
annotationAutodiscovery:
@@ -112,30 +112,30 @@ resource "kubernetes_deployment_v1" "your_application_deployment" {
112112
## Send Kubernetes metrics using Helm chart with Terraform
113113

114114
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+
}
123124
}
124-
}
125-
```
125+
```
126126
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.
127-
```
128-
resource "helm_release" "alloy" {
129-
name = "name-of-your-metrics-ingester"
130-
repository = "https://grafana.github.io/helm-charts"
131-
chart = "k8s-monitoring"
132-
version = "2.0.2"
133-
134-
namespace = "metrics-ingester"
135-
create_namespace = true
136-
values = [file("/your-path/to/values.yml")]
137-
}
138-
```
127+
```
128+
resource "helm_release" "alloy" {
129+
name = "name-of-your-metrics-ingester"
130+
repository = "https://grafana.github.io/helm-charts"
131+
chart = "k8s-monitoring"
132+
version = "2.0.2"
133+
134+
namespace = "metrics-ingester"
135+
create_namespace = true
136+
values = [file("/your-path/to/values.yml")]
137+
}
138+
```
139139
3. Save your changes.
140140
4. Run `terraform init` to initialize your Terraform configuration and download any necessary providers.
141141
5. Run `terraform apply` to apply your configuration.
@@ -147,13 +147,12 @@ Once you have configured your `values.yml` file, you can use Helm to deploy the
147147

148148
1. [Connect](/containers/kubernetes/how-to/connect-cluster-kubectl/) `kubectl` to your Kubernetes cluster
149149
2. Run the command below to install the `k8s-monitoring` Helm chart:
150-
```
151-
helm install -f /your-path/to/values.yml name-of-your-choice-for-your-metric-ingester k8s-monitoring --version 1.6.16
152-
```
153-
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.
150+
```
151+
helm install -f /your-path/to/values.yml name-of-your-choice-for-your-metric-ingester k8s-monitoring --version 1.6.16
152+
```
153+
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.
157156

158157
3. Optionally, check the status of the release to ensure it was installed:
159158

0 commit comments

Comments
 (0)