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 kube-otel-stack to match otel-cloud-stack #77

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

jdcrouse
Copy link
Contributor

@jdcrouse jdcrouse commented Mar 20, 2024

Description

This PR adds the same opamp bridge config to the kube-otel-stack chart that was merged into the otel-cloud-stack chart

For docs team

This PR includes the exact same change as described in #76 but adds the OpAMP Bridge to the kube-otel-stack chart instead, so I guess that is relevant to these docs maybe? https://docs.lightstep.com/docs/quick-start-operator

How Has This Been Tested?

helm template looks alright

i installed and it looks good! (aside from errors because i installed in a blank repo that didnt have any prom stuff set up so some collectors were mad?)

verified backwards compatibility (bridgeless helm install on the new chart is the same output as the old chart, except chart version numbers)

> diff ~/workspace/kos-new-nobridge.yaml ~/workspace/kos-old-nobridge.yaml
476c476
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
478c478
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
503c503
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
505c505
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
531c531
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
533c533
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
559c559
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
561c561
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
762c762
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
764c764
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
911c911
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
913c913
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1307c1307
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1309c1309
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1598c1598
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1600c1600
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1627c1627
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1629c1629
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1667c1667
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1669c1669
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1700c1700
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1702c1702
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1729c1729
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1731c1731
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1756c1756
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1758c1758
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1781c1781
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1783c1783
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1807c1807
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1809c1809
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1832c1832
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1834c1834
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1858c1858
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1860c1860
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1883c1883
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1885c1885
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2
1908c1908
<     app.kubernetes.io/version: "0.5.0"
---
>     app.kubernetes.io/version: "0.4.2"
1910c1910
<     chart: kube-otel-stack-0.5.0
---
>     chart: kube-otel-stack-0.4.2

diff between old chart and new chart WITH a bridge enabled is below, it shows the expected output which is the same collector output but with the opamp reporting label set to true and the bridge is now included

> diff ~/workspace/kos-new-nobridge.yaml ~/workspace/kos-new-withbridge.yaml 
190a191,210
> ---
> # Source: kube-otel-stack/templates/bridge.yaml
> apiVersion: rbac.authorization.k8s.io/v1
> kind: ClusterRole
> metadata:
>   name: kube-otel-stack-bridge
> rules:
>   - apiGroups:
>       - opentelemetry.io
>     resources:
>       - opentelemetrycollectors
>     verbs:
>       - "*"
>   - apiGroups:
>       - ""
>     resources:
>       - pods
>     verbs:
>       - 'list'
>       - 'get'
358a379,393
> # Source: kube-otel-stack/templates/bridge.yaml
> apiVersion: rbac.authorization.k8s.io/v1
> kind: ClusterRoleBinding
> metadata:
>   name: kube-otel-stack
> roleRef:
>   apiGroup: rbac.authorization.k8s.io
>   kind: ClusterRole
>   name: "kube-otel-stack-bridge"
> subjects:
>   - kind: ServiceAccount
>     # quirk of the Operator
>     name: "kube-otel-stack-opamp-bridge"
>     namespace: "default"
> ---
753a789,851
> # Source: kube-otel-stack/templates/bridge.yaml
> apiVersion: opentelemetry.io/v1alpha1
> kind: OpAMPBridge
> metadata:
>   name: kube-otel-stack
>   labels:    
>     app.kubernetes.io/managed-by: Helm
>     app.kubernetes.io/instance: kube-otel-stack
>     app.kubernetes.io/version: "0.5.0"
>     app.kubernetes.io/part-of: kube-otel-stack
>     chart: kube-otel-stack-0.5.0
>     release: "kube-otel-stack"
>     heritage: "Helm"
> spec:
>   endpoint: wss://opamp.lightstep.com/v1/opamp
>   headers:
>     Authorization: bearer ${LS_OPAMP_API_KEY}
>   capabilities:
>     AcceptsOpAMPConnectionSettings: true
>     AcceptsOtherConnectionSettings: true
>     AcceptsRemoteConfig: true
>     AcceptsRestartCommand: true
>     ReportsEffectiveConfig: true
>     ReportsHealth: true
>     ReportsOwnLogs: true
>     ReportsOwnMetrics: true
>     ReportsOwnTraces: true
>     ReportsRemoteConfig: true
>     ReportsStatus: true
>   image: "ghcr.io/open-telemetry/opentelemetry-operator/operator-opamp-bridge:0.96.0"
>   env:
>     - name: OTEL_K8S_NODE_NAME
>       valueFrom:
>         fieldRef:
>           fieldPath: spec.nodeName
>     - name: OTEL_K8S_NAMESPACE
>       valueFrom:
>         fieldRef:
>           apiVersion: v1
>           fieldPath: metadata.namespace
>     - name: OTEL_K8S_POD_NAME
>       valueFrom:
>         fieldRef:
>           apiVersion: v1
>           fieldPath: metadata.name
>     - name: OTEL_K8S_POD_UID
>       valueFrom:
>         fieldRef:
>           apiVersion: v1
>           fieldPath: metadata.uid
>     - name: OTEL_K8S_POD_IP
>       valueFrom:
>         fieldRef:
>           apiVersion: v1
>           fieldPath: status.podIP
>     - name: OTEL_RESOURCE_ATTRIBUTES
>       value: "k8s.cluster.name=jason-test"
>     - name: LS_OPAMP_API_KEY
>       valueFrom:
>         secretKeyRef:
>           key: LS_OPAMP_API_KEY
>           name: otel-opamp-bridge-secret
> ---
759c857,858
<   labels:    
---
>   labels:
>     opentelemetry.io/opamp-reporting: "true"    
908c1007,1008
<   labels:    
---
>   labels:
>     opentelemetry.io/opamp-reporting: "true"    
1304c1404,1405
<   labels:    
---
>   labels:
>     opentelemetry.io/opamp-reporting: "true" 

TODO: spin up the chart in a cluster and ensure it works as expected

@jdcrouse jdcrouse requested a review from a team March 20, 2024 20:16
@jaronoff97 jaronoff97 merged commit b4599e8 into main Mar 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants