Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/main' into karsten/validate-dev…
Browse files Browse the repository at this point in the history
…-cluster-config
  • Loading branch information
jeschkies committed Jan 11, 2024
2 parents 855f23b + 5559b26 commit f4944a2
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
],
};

local build_image_tag = '0.32.0';
local build_image_tag = '0.33.0';
[
pipeline('loki-build-image-' + arch) {
workspace: {
Expand Down
12 changes: 6 additions & 6 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ steps:
dry_run: true
repo: grafana/loki-build-image
tags:
- 0.32.0-amd64
- 0.33.0-amd64
when:
event:
- pull_request
Expand All @@ -33,7 +33,7 @@ steps:
from_secret: docker_password
repo: grafana/loki-build-image
tags:
- 0.32.0-amd64
- 0.33.0-amd64
username:
from_secret: docker_username
when:
Expand Down Expand Up @@ -68,7 +68,7 @@ steps:
dry_run: true
repo: grafana/loki-build-image
tags:
- 0.32.0-arm64
- 0.33.0-arm64
when:
event:
- pull_request
Expand All @@ -86,7 +86,7 @@ steps:
from_secret: docker_password
repo: grafana/loki-build-image
tags:
- 0.32.0-arm64
- 0.33.0-arm64
username:
from_secret: docker_username
when:
Expand Down Expand Up @@ -118,7 +118,7 @@ steps:
password:
from_secret: docker_password
spec: .drone/docker-manifest-build-image.tmpl
target: loki-build-image:0.32.0
target: loki-build-image:0.33.0
username:
from_secret: docker_username
when:
Expand Down Expand Up @@ -2113,6 +2113,6 @@ kind: secret
name: gpg_private_key
---
kind: signature
hmac: d94c120886a5681b62aef3b9495ee1bdf2533757d985a2dc201678c88a6b25b7
hmac: fe7669a21410ae5f2d1ad6b6205fdc582af874f65f7bd6a679731a88174e3a1c

...
37 changes: 37 additions & 0 deletions docs/sources/send-data/fluentbit/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,43 @@ docker run -v /var/log:/var/log \
grafana/fluent-bit-plugin-loki:latest
```

Or, an alternative is to run the fluent-bit container using [Docker Hub](https://hub.docker.com/r/fluent/fluent-bit) image:

### Docker Container Logs

To ship logs from Docker containers to Grafana Cloud using Fluent Bit, you can use the Fluent Bit Docker image and configure it to forward logs directly to Grafana Cloud's Loki. Below is a step-by-step guide on setting up Fluent Bit for this purpose.

#### Prerequisites

- Docker is installed on your machine.
- You have a Grafana Cloud account with access to Loki.

#### Configuration

1. Create a Fluent Bit configuration file named `fluent-bit.conf` with the following content, which defines the input from Docker container logs and sets up the output to send logs to your Grafana Cloud Loki instance:

```ini
[SERVICE]
Flush 1
Log_Level info

[INPUT]
Name tail
Path /var/lib/docker/containers/*/*.log
Parser docker
Tag docker.*

[OUTPUT]
Name loki
Match *
Host logs-prod-006.grafana.net
Port 443
TLS On
TLS.Verify On
HTTP_User 478625
HTTP_Passwd YOUR_GRAFANA_CLOUD_API_KEY
Labels job=fluentbit

### Kubernetes

You can run Fluent Bit as a [Daemonset](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) to collect all your Kubernetes workload logs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: docker.io/grafana/loki-operator:0.5.0
createdAt: "2023-12-12T09:22:19Z"
createdAt: "2024-01-10T18:25:00Z"
description: The Community Loki Operator provides Kubernetes native deployment
and management of Loki and related logging components.
features.operators.openshift.io/disconnected: "true"
Expand Down Expand Up @@ -1591,6 +1591,12 @@ spec:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: docker.io/grafana/loki-operator:0.5.0
createdAt: "2023-12-12T09:22:17Z"
createdAt: "2024-01-10T18:24:59Z"
description: The Community Loki Operator provides Kubernetes native deployment
and management of Loki and related logging components.
operators.operatorframework.io/builder: operator-sdk-unknown
Expand Down Expand Up @@ -1571,6 +1571,12 @@ spec:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: quay.io/openshift-logging/loki-operator:0.1.0
createdAt: "2023-12-12T09:22:21Z"
createdAt: "2024-01-10T18:25:02Z"
description: |
The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging.
## Prerequisites and Requirements
Expand Down Expand Up @@ -1576,6 +1576,12 @@ spec:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
6 changes: 6 additions & 0 deletions operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ rules:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
1 change: 1 addition & 0 deletions operator/controllers/loki/lokistack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type LokiStackReconciler struct {
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings;clusterroles;roles;rolebindings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=servicemonitors;prometheusrules,verbs=get;list;watch;create;update;delete
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=alertmanagers,verbs=patch
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=alertmanagers/api,verbs=create
// +kubebuilder:rbac:urls=/api/v2/alerts,verbs=create
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;create;update
// +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update
Expand Down
11 changes: 11 additions & 0 deletions operator/internal/manifests/openshift/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ func BuildRulerClusterRole(opts Options) *rbacv1.ClusterRole {
"create",
},
},
{
APIGroups: []string{
"monitoring.coreos.com",
},
Resources: []string{
"alertmanagers/api",
},
Verbs: []string{
"create",
},
},
},
}
}
Expand Down

0 comments on commit f4944a2

Please sign in to comment.