/
service.go
50 lines (47 loc) · 1.17 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package otelcollector
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/gitpod-io/observability/installer/pkg/common"
)
func service(ctx *common.RenderContext) ([]runtime.Object, error) {
return []runtime.Object{
&corev1.Service{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1",
Kind: "Service",
},
ObjectMeta: metav1.ObjectMeta{
Name: Name,
Namespace: Namespace,
Labels: common.Labels(Name, Component, App, Version),
},
Spec: corev1.ServiceSpec{
Type: "ClusterIP",
Ports: []corev1.ServicePort{
{
Name: "jaeger",
Port: 14268,
TargetPort: intstr.IntOrString{IntVal: 14268},
Protocol: "TCP",
},
{
Name: "grpc-otlp",
Port: 4317,
TargetPort: intstr.IntOrString{IntVal: 4317},
Protocol: "TCP",
},
{
Name: "metrics",
Port: 8888,
TargetPort: intstr.IntOrString{IntVal: 8888},
Protocol: "TCP",
},
},
Selector: common.Labels(Name, Component, App, Version),
},
},
}, nil
}