Skip to content

Instantly share code, notes, and snippets.

@jpkrohling
Created April 22, 2024 13:20
Show Gist options
  • Save jpkrohling/ddb7d0074fa7858602302897ad495f35 to your computer and use it in GitHub Desktop.
Save jpkrohling/ddb7d0074fa7858602302897ad495f35 to your computer and use it in GitHub Desktop.
Configs to use with issue #4274
apiVersion: v1
kind: Namespace
metadata:
name: observability
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: observability
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus
namespace: observability
rules:
- apiGroups: [""]
resources:
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- configmaps
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prometheus
namespace: observability
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: observability
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: client
namespace: observability
spec:
config: |
receivers:
otlp:
protocols:
grpc:
processors:
exporters:
otlp:
tls:
insecure: true
endpoint: server-collector-headless.observability:4317
balancer_name: round_robin
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [otlp]
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: server
namespace: observability
spec:
replicas: 3
config: |
receivers:
otlp:
protocols:
grpc:
processors:
exporters:
logging:
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [logging]
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: server-monitor
namespace: observability
labels:
scrape: "yes"
spec:
selector:
matchLabels:
app.kubernetes.io/name: server-collector-monitoring
endpoints:
- port: monitoring
---
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
namespace: observability
spec:
serviceAccountName: prometheus
serviceMonitorSelector:
matchLabels:
scrape: "yes"
apiVersion: v1
kind: Namespace
metadata:
name: observability
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: observability
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus
namespace: observability
rules:
- apiGroups: [""]
resources:
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- configmaps
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prometheus
namespace: observability
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: observability
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: client
namespace: observability
spec:
image: jpkroehling/otelcol-with-4274:latest
config: |
receivers:
otlp:
protocols:
grpc:
processors:
exporters:
otlp:
tls:
insecure: true
endpoint: dns:///server-collector-headless.observability:4317
balancer_name: round_robin
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [otlp]
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: server
namespace: observability
spec:
replicas: 3
config: |
receivers:
otlp:
protocols:
grpc:
processors:
exporters:
logging:
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [logging]
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: server-monitor
namespace: observability
labels:
scrape: "yes"
spec:
selector:
matchLabels:
app.kubernetes.io/name: server-collector-monitoring
endpoints:
- port: monitoring
---
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
namespace: observability
spec:
serviceAccountName: prometheus
serviceMonitorSelector:
matchLabels:
scrape: "yes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment