Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions kubernetes/namespaces/loki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Once this is deployed, the service `loki-gateway.loki.svc.cluster.local` will po
```
$ helm repo add grafana https://grafana.github.io/helm-charts
$ helm repo update
$ helm upgrade --install -n loki --values loki_values.yml loki grafana/loki
$ helm upgrade --install -n loki --values loki/loki_values.yml loki grafana/loki
```

## Alloy
Expand All @@ -21,5 +21,23 @@ $ helm upgrade --install -n loki --values loki_values.yml loki grafana/loki
This requires no additional configuration, just make sure Loki is up and Alloy will start shipping logs.

```
$ helm upgrade --install -n loki --values alloy_values.yml alloy grafana/alloy
$ helm upgrade --install -n loki --values alloy/alloy_values.yml alloy grafana/alloy
```

## Vector

Vector is a log shipping tool that we use to accept various sources and ships them to Loki.

```
$ helm repo add vector https://helm.vector.dev
$ helm repo update
$ helm upgrade --install -n loki --values vector/vector_values.yml vector vector/vector
```

### Vector Port Allocations

Log data will be tagged and retained based on the Vector endpoint it lands in.

| Port | Sending Service |
| ---- | --------------- |
| 6000 | Kubewatch |
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ loki:
retention_enabled: true
delete_request_store: s3
compaction_interval: 10m
delete_request_cancel_period: 1h
delete_request_cancel_period: 10s
retention_delete_worker_count: 150
retention_delete_delay: 10s

Expand Down
67 changes: 67 additions & 0 deletions kubernetes/namespaces/loki/vector/vector_values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# role -- [Role](https://vector.dev/docs/setup/deployment/roles/) for this Vector instance, valid options are:
# "Agent", "Aggregator", and "Stateless-Aggregator".

# Each role is created with the following workloads:
# Agent = DaemonSet
# Aggregator = StatefulSet
# Stateless-Aggregator = Deployment
role: "Stateless-Aggregator"

# customConfig -- Override Vector's default configs, if used **all** options need to be specified. This section supports
# using helm templates to populate dynamic values. See Vector's [configuration documentation](https://vector.dev/docs/reference/configuration/)
# for all options.
customConfig:
data_dir: /vector-data-dir

api:
enabled: true
address: 127.0.0.1:8686

sources:
kubewatch:
address: 0.0.0.0:6000
type: http_server
auth:
strategy: custom
source: |-
true
decoding:
codec: json
framing:
method: bytes

transforms:
kubewatch_prepared:
type: remap
inputs: [kubewatch]
source: |-
.job = "kubewatch"
.kind = .eventmeta.kind
.name = .eventmeta.name
.namespace = .eventmeta.namespace
.reason = .eventmeta.reason

.labels = {
"namespace": .eventmeta.namespace,
"kind": .eventmeta.kind,
}

del(.source_type)
del(.path)
del(.eventmeta)

sinks:
loki:
type: loki
inputs: [kubewatch_prepared]
endpoint: http://loki:3100
labels:
job: |-
{{`vector_{{ job }}`}}
"*": |-
{{`{{ labels }}`}}
encoding:
codec: json

# Log level for Vector.
logLevel: "info"
6 changes: 6 additions & 0 deletions kubernetes/namespaces/monitoring/kubewatch/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Kubewatch

> **kubewatch** is a Kubernetes watcher that currently publishes notification to available collaboration hubs/notification channels. Run it in your k8s cluster, and you will get event notifications through webhooks.

```
$ helm repo add robusta https://robusta-charts.storage.googleapis.com
$ helm repo update
$ helm upgrade --install -n monitoring --values kubewatch_values.yaml kubewatch robusta/kubewatch
```
34 changes: 0 additions & 34 deletions kubernetes/namespaces/monitoring/kubewatch/configmap.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions kubernetes/namespaces/monitoring/kubewatch/deployment.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
rbac:
create: true
customRoles:
- apiGroups: ["events.k8s.io"]
resources: ["events"]
verbs: ["get", "list", "watch"]

slack:
enabled: false

webhook:
enabled: true
url: "http://vector.loki:6000"

resourcesToWatch:
deployment: true
replicationcontroller: false
replicaset: false
daemonset: false
services: true
pod: true
job: true
persistentvolume: true
event: true
Binary file not shown.
30 changes: 0 additions & 30 deletions kubernetes/namespaces/monitoring/kubewatch/service-account.yaml

This file was deleted.

Loading