Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LS-59631] add opamp bridge to otel-cloud-stack chart #76

Merged
merged 26 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f1f5abf
add opamp bridge to otel-cloud-stack chart
jdcrouse Mar 13, 2024
cc6bc7a
undo some unintended changes
jdcrouse Mar 13, 2024
5971232
based on semver this seems like a new minor version
jdcrouse Mar 13, 2024
dd0d33b
go ahead and add the same chart to kube-otel-stack
jdcrouse Mar 13, 2024
0be699c
bump minor version
jdcrouse Mar 13, 2024
79a2dac
fix auth header variable
jdcrouse Mar 13, 2024
e15ca46
pull variable from secrets
jdcrouse Mar 13, 2024
29a79b0
new lines
jdcrouse Mar 14, 2024
681ccd5
fix variable substitution and include labels from values in collector…
jdcrouse Mar 14, 2024
3238621
fix variable subs and add labels to collectors
jdcrouse Mar 14, 2024
57088c2
optional label inclusion
jdcrouse Mar 14, 2024
502cb33
opamp-reporting prevents bridge modification of a collector, this val…
jdcrouse Mar 15, 2024
b62dcb9
set opampManaged as a collector attribute, and read that to optionall…
jdcrouse Mar 15, 2024
6680c57
same change to use an attribute instead of custom labels in kube-otel…
jdcrouse Mar 15, 2024
4ad3269
default opamp managd to true
jdcrouse Mar 15, 2024
d3ffea5
include opamp-reporting too, and set reporting default true managed d…
jdcrouse Mar 15, 2024
56b840a
pin to latest version tag
jdcrouse Mar 15, 2024
5d752cc
only set one of reporting or managed, giving reporting precedence
jdcrouse Mar 15, 2024
fbe14b9
whitespace
jdcrouse Mar 15, 2024
caced3d
merge in most of bridge chart from otel helm charts repo
jdcrouse Mar 15, 2024
71285ae
all or nothing opamp managed and reporting tags
jdcrouse Mar 15, 2024
69f8dbc
undo kube-otel-stack changes to slim down PR. these charts will be th…
jdcrouse Mar 15, 2024
8a5d135
idk
jdcrouse Mar 15, 2024
ac9580a
properly revert
jdcrouse Mar 15, 2024
1c15374
revert
jdcrouse Mar 15, 2024
4f90e6d
remove erroneous bridge
jdcrouse Mar 18, 2024
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
2 changes: 1 addition & 1 deletion charts/kube-otel-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: kube-otel-stack
description: Chart for sending Kubernetes metrics to Lightstep using the OpenTelemetry Operator.
type: application
version: 0.4.2
version: 0.5.0
appVersion: 0.91.0
dependencies:
# cert manager must be manually installed because it has CRDs
Expand Down
63 changes: 63 additions & 0 deletions charts/kube-otel-stack/templates/bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{ $bridge := $.Values.opampBridge}}
jdcrouse marked this conversation as resolved.
Show resolved Hide resolved
{{ if $bridge.enabled }}
{{ $bridgeName := (print $.Release.Name "-bridge") }}
apiVersion: opentelemetry.io/v1alpha1
kind: OpAMPBridge
metadata:
name: {{ $bridgeName }}
{{- with $bridge.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app: {{ $bridgeName }}
{{- include "kube-otel-stack.labels" $ | indent 4 }}
spec:
image: {{ $bridge.image }}
endpoint: {{ $bridge.endpoint }}
{{- with $bridge.capabilities }}
capabilities:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $bridge.headers }}
headers:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $bridge.env }}
env:
{{- toYaml . | nindent 4 }}
{{- end }}
jdcrouse marked this conversation as resolved.
Show resolved Hide resolved
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: "opamp-bridge"
rules:
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors
verbs:
- "*"
- apiGroups:
- ""
resources:
- pods
verbs:
- 'list'
- 'get'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: "{{ $bridgeName }}-opamp-bridge"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "opamp-bridge"
subjects:
- kind: ServiceAccount
# quirk of the Operator
name: "{{ $bridgeName }}-opamp-bridge"
namespace: "{{ $.Release.Namespace }}"
{{ end }}
4 changes: 4 additions & 0 deletions charts/kube-otel-stack/templates/collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ metadata:
{{- toYaml . | nindent 4}}
{{- end }}
labels:
app: {{ $collectorName }}
{{- if $collector.opampManaged }}
opentelemetry.io/opamp-managed: "true"
jdcrouse marked this conversation as resolved.
Show resolved Hide resolved
{{- end }}
{{- include "kube-otel-stack.labels" $ | indent 4 }}
spec:
mode: {{ $collector.mode }}
Expand Down
29 changes: 28 additions & 1 deletion charts/kube-otel-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ collectors: []
## Default collector for tracing
tracesCollector:
enabled: false
opampManaged: false
name: traces
clusterName: ""

image: otel/opentelemetry-collector-contrib:0.88.0
mode: deployment
replicas: 1
Expand Down Expand Up @@ -221,6 +221,7 @@ metricsCollector:
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.88.0
enabled: true
opampManaged: false
mode: statefulset
replicas: 3
hpa:
Expand Down Expand Up @@ -349,6 +350,7 @@ logsCollector:
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.88.0
enabled: false
opampManaged: false
mode: daemonset
resources:
limits:
Expand Down Expand Up @@ -1242,3 +1244,28 @@ prometheus-node-exporter:
## If true, create PSPs for node-exporter
##
pspEnabled: false

opampBridge:
enabled: false
image: "ghcr.io/open-telemetry/opentelemetry-operator/operator-opamp-bridge:main"
jdcrouse marked this conversation as resolved.
Show resolved Hide resolved
endpoint: "wss://opamp.lightstep.com/v1/opamp"
headers:
"Authorization": "bearer ${LS_OPAMP_API_KEY}"
env:
- name: LS_OPAMP_API_KEY
valueFrom:
secretKeyRef:
key: LS_OPAMP_API_KEY
name: otel-opamp-bridge-secret
capabilities:
AcceptsOpAMPConnectionSettings: true
AcceptsOtherConnectionSettings: true
AcceptsRemoteConfig: true
AcceptsRestartCommand: true
ReportsEffectiveConfig: true
ReportsHealth: true
ReportsOwnLogs: true
ReportsOwnMetrics: true
ReportsOwnTraces: true
ReportsRemoteConfig: true
ReportsStatus: true
2 changes: 1 addition & 1 deletion charts/otel-cloud-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "0.3.1"
version: "0.4.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes
MINOR version when you add functionality in a backward compatible manner
PATCH version when you make backward compatible bug fixes

this is adding functionality in a backward compatible manner so i increased the minor version


# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
63 changes: 63 additions & 0 deletions charts/otel-cloud-stack/templates/bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{ $bridge := $.Values.opampBridge}}
{{ if $bridge.enabled }}
{{ $bridgeName := (print $.Release.Name "-bridge") }}
apiVersion: opentelemetry.io/v1alpha1
kind: OpAMPBridge
metadata:
name: {{ $bridgeName }}
{{- with $bridge.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app: {{ $bridgeName }}
{{- include "otel-cloud-stack.labels" $ | indent 4 }}
spec:
image: {{ $bridge.image }}
endpoint: {{ $bridge.endpoint }}
{{- with $bridge.capabilities }}
capabilities:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $bridge.headers }}
headers:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if or $bridge.env $.Values.extraEnvs }}
env:
{{- toYaml (concat $.Values.extraEnvs $bridge.env) | nindent 4 }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: "opamp-bridge"
rules:
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors
verbs:
- "*"
- apiGroups:
- ""
resources:
- pods
verbs:
- 'list'
- 'get'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: "{{ $bridgeName }}-opamp-bridge"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "opamp-bridge"
subjects:
- kind: ServiceAccount
# quirk of the Operator
name: "{{ $bridgeName }}-opamp-bridge"
namespace: "{{ $.Release.Namespace }}"
{{ end }}
3 changes: 3 additions & 0 deletions charts/otel-cloud-stack/templates/collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ metadata:
{{- end }}
labels:
app: {{ $collectorName }}
{{- if $collector.opampManaged }}
opentelemetry.io/opamp-managed: "true"
{{- end }}
{{- include "otel-cloud-stack.labels" $ | indent 4 }}
spec:
{{- if $collector.nodeSelector }}
Expand Down
33 changes: 31 additions & 2 deletions charts/otel-cloud-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ autoinstrumentation:
resource: {}

daemonCollector:
enabled: true
name: daemon
opampManaged: false
jdcrouse marked this conversation as resolved.
Show resolved Hide resolved
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.88.0
enabled: true
mode: daemonset
mountHostFS: true
env:
Expand Down Expand Up @@ -302,12 +303,13 @@ daemonCollector:

# This is a singleton collector for cluster-level data
clusterCollector:
enabled: true
opampManaged: false
name: cluster-stats
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.88.0
replicas: 1
mode: deployment
enabled: true
mountHostFS: false
resources:
limits:
Expand Down Expand Up @@ -423,6 +425,7 @@ clusterCollector:
## Default collector for tracing
tracesCollector:
enabled: false
opampManaged: false
name: traces
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.88.0
Expand Down Expand Up @@ -539,6 +542,7 @@ tracesCollector:

logsCollector:
enabled: false
opampManaged: false
name: logs
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.88.0
Expand Down Expand Up @@ -737,3 +741,28 @@ logsCollector:
exporters: [otlp]

collectors: []

opampBridge:
enabled: false
image: "ghcr.io/open-telemetry/opentelemetry-operator/operator-opamp-bridge:main"
endpoint: "wss://opamp.lightstep.com/v1/opamp"
headers:
"Authorization": "bearer ${LS_OPAMP_API_KEY}"
env:
- name: LS_OPAMP_API_KEY
valueFrom:
secretKeyRef:
key: LS_OPAMP_API_KEY
name: otel-opamp-bridge-secret
capabilities:
AcceptsOpAMPConnectionSettings: true
AcceptsOtherConnectionSettings: true
AcceptsRemoteConfig: true
AcceptsRestartCommand: true
ReportsEffectiveConfig: true
ReportsHealth: true
ReportsOwnLogs: true
ReportsOwnMetrics: true
ReportsOwnTraces: true
ReportsRemoteConfig: true
ReportsStatus: true
Loading