Skip to content

Commit 9cf6dec

Browse files
committed
Add opentelemetry configuration to apiserver.k8s.io/v1alpha1
1 parent ce0bb07 commit 9cf6dec

File tree

5 files changed

+244
-0
lines changed

5 files changed

+244
-0
lines changed

staging/src/k8s.io/apiserver/pkg/apis/apiserver/types.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,36 @@ type TLSConfig struct {
147147
// +optional
148148
ClientCert string
149149
}
150+
151+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
152+
153+
// OpenTelemetryClientConfiguration provides versioned configuration for opentelemetry clients.
154+
type OpenTelemetryClientConfiguration struct {
155+
metav1.TypeMeta
156+
157+
// +optional
158+
// URL of the collector that's running on the master.
159+
// if URL is specified, APIServer uses the egressType Master when sending data to the collector.
160+
URL *string
161+
162+
// +optional
163+
// Service that's the frontend of the collector deployment running in the cluster.
164+
// If Service is specified, APIServer uses the egressType Cluster when sending data to the collector.
165+
Service *ServiceReference
166+
}
167+
168+
// ServiceReference holds a reference to Service.legacy.k8s.io
169+
type ServiceReference struct {
170+
// `namespace` is the namespace of the service.
171+
// Required
172+
Namespace string
173+
// `name` is the name of the service.
174+
// Required
175+
Name string
176+
177+
// If specified, the port on the service.
178+
// Defaults to 55680.
179+
// `port` should be a valid port number (1-65535, inclusive).
180+
// +optional
181+
Port *int32
182+
}

staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,36 @@ type TLSConfig struct {
147147
// +optional
148148
ClientCert string `json:"clientCert,omitempty"`
149149
}
150+
151+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
152+
153+
// OpenTelemetryClientConfiguration provides versioned configuration for opentelemetry clients.
154+
type OpenTelemetryClientConfiguration struct {
155+
metav1.TypeMeta `json:",inline"`
156+
157+
// +optional
158+
// URL of the collector that's running on the master.
159+
// if URL is specified, APIServer uses the egressType Master when sending data to the collector.
160+
URL *string `json:"url,omitempty"`
161+
162+
// +optional
163+
// Service that's the frontend of the collector deployment running in the cluster.
164+
// If Service is specified, APIServer uses the egressType Cluster when sending data to the collector.
165+
Service *ServiceReference `json:"service,omitempty"`
166+
}
167+
168+
// ServiceReference holds a reference to Service.legacy.k8s.io
169+
type ServiceReference struct {
170+
// `namespace` is the namespace of the service.
171+
// Required
172+
Namespace string `json:"namespace"`
173+
// `name` is the name of the service.
174+
// Required
175+
Name string `json:"name"`
176+
177+
// If specified, the port on the service.
178+
// Defaults to 55680.
179+
// `port` should be a valid port number (1-65535, inclusive).
180+
// +optional
181+
Port *int32 `json:"port,omitempty"`
182+
}

staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)