Skip to content

Commit

Permalink
Feature/otel-propagators-config (#50)
Browse files Browse the repository at this point in the history
* added v1beta1 types

* updated md

* delete v1beta1

* updated ConfigurationSpec

* make targets

* generated apis

* generated crds

* tests are passing

* w3c propagator
  • Loading branch information
oncicaradupopovici authored Jan 31, 2025
1 parent d4cc58a commit f76fe24
Show file tree
Hide file tree
Showing 21 changed files with 330 additions and 297 deletions.
17 changes: 14 additions & 3 deletions GenerateCRD.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@ Use **Windows Subsystem for Linux** (Ubuntu)
```bash
apt install make
```
3. Install the kubernetes code generator (from outside the rusi project folder):
3. Install the kubernetes code generator:
```bash
go get k8s.io/[email protected]
go install k8s.io/[email protected]
sudo chmod 777 ~/go/pkg/mod/k8s.io/[email protected]/generate-groups.sh
```

4. Install controller-gen https://book.kubebuilder.io/reference/controller-gen.html
```shell
go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest
```


## Generate apis
Go to rusi folder (repository root) and run the following make task:
```bash
make generate-apis
```

## Generate client
## Generate crd
Go to rusi folder (repository root) and run the following make task:
```bash
make generate-crd
Expand Down
7 changes: 4 additions & 3 deletions cmd/rusid/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package main
import (
"context"
"flag"
"github.com/prometheus/client_golang/prometheus/promhttp"
"k8s.io/klog/v2"
"net/http"
"syscall"

"github.com/prometheus/client_golang/prometheus/promhttp"
"k8s.io/klog/v2"

//_ "net/http/pprof"
"os"
"os/signal"
Expand Down Expand Up @@ -52,7 +53,7 @@ func main() {
}

//setup tracing
go diagnostics.WatchConfig(mainCtx, configLoader, tracing.SetJaegerTracing(cfg.AppID))
go diagnostics.WatchConfig(mainCtx, configLoader, tracing.SetTracing(cfg.AppID))
klog.InfoS("Setup opentelemetry finished")

compManager, err := runtime.NewComponentsManager(mainCtx, cfg.AppID, compLoader,
Expand Down
9 changes: 4 additions & 5 deletions examples/components/config-node-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ metadata:
spec:
metric:
enabled: true
tracing:
samplingRate: '1'
jaeger:
useAgent: false
collectorEndpointAddress: 'linux-ts1858:4317'
telemetry:
collectorEndpoint: 'linux-ts1858:4317'
tracing:
propagator: w3c # w3c | b3
# subscriberPipeline:
# handlers:
# - name: pubsub-uppercase
Expand Down
119 changes: 0 additions & 119 deletions helm/crds/configuration.yaml

This file was deleted.

49 changes: 29 additions & 20 deletions helm/crds/components.yaml → helm/crds/rusi.io_components.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.17.1
name: components.rusi.io
spec:
group: rusi.io
names:
kind: Component
listKind: ComponentList
plural: components
singular: component
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Component describes an Rusi component type
description: Component describes a Rusi component type.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
auth:
description: Auth represents authentication details for the component
description: Auth represents authentication details for the component.
properties:
secretStore:
type: string
required:
- secretStore
type: object
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand All @@ -35,15 +49,15 @@ spec:
type: string
type: array
spec:
description: ComponentSpec is the spec for a component
description: ComponentSpec is the spec for a component.
properties:
initTimeout:
type: string
ignoreErrors:
type: boolean
initTimeout:
type: string
metadata:
items:
description: MetadataItem is a name/value pair for a metadata
description: MetadataItem is a name/value pair for a metadata.
properties:
name:
type: string
Expand All @@ -61,6 +75,9 @@ spec:
- name
type: object
value:
description: DynamicValue is a dynamic value struct for the
component.metadata pair value.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- name
Expand All @@ -78,11 +95,3 @@ spec:
type: object
served: true
storage: true
names:
kind: Component
plural: components
singular: component
categories:
- all
- rusi
scope: Namespaced
Loading

0 comments on commit f76fe24

Please sign in to comment.