-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathservices.go
More file actions
100 lines (97 loc) · 2.06 KB
/
Copy pathservices.go
File metadata and controls
100 lines (97 loc) · 2.06 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package manifests
import (
"github.com/freeipa/freeipa-operator/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// ServiceKerberosForIDM Create the Service manifest for the kerberos service
func ServiceKerberosForIDM(m *v1alpha1.IDM) *corev1.Service {
service := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: m.Name + "-kerberos",
Namespace: m.Namespace,
Labels: LabelsForIDM(m),
},
Spec: corev1.ServiceSpec{
Selector: map[string]string{
"app": "freeipa",
},
Ports: []corev1.ServicePort{
{
Name: "kerberos-tcp",
Port: 88,
TargetPort: intstr.IntOrString{
Type: intstr.Int,
IntVal: 88,
},
Protocol: "TCP",
},
{
Name: "kerberos-udp",
Port: 88,
TargetPort: intstr.IntOrString{
Type: intstr.Int,
IntVal: 88,
},
Protocol: "UDP",
},
{
Name: "kerberos-adm-tcp",
Port: 749,
TargetPort: intstr.IntOrString{
Type: intstr.Int,
IntVal: 749,
},
Protocol: "TCP",
},
{
Name: "kerberos-adm-udp",
Port: 749,
TargetPort: intstr.IntOrString{
Type: intstr.Int,
IntVal: 749,
},
Protocol: "UDP",
},
},
},
}
return service
}
// ServiceWebForIDM Create the Service manifest for the web interface
func ServiceWebForIDM(m *v1alpha1.IDM) *corev1.Service {
service := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: GetWebServiceName(m),
Namespace: m.Namespace,
Labels: LabelsForIDM(m),
},
Spec: corev1.ServiceSpec{
Selector: map[string]string{
"app": "idm",
},
Ports: []corev1.ServicePort{
{
Name: "http-tcp",
Port: 80,
TargetPort: intstr.IntOrString{
Type: intstr.String,
StrVal: "http-tcp",
},
Protocol: "TCP",
},
{
Name: "https-tcp",
Port: 443,
TargetPort: intstr.IntOrString{
Type: intstr.String,
StrVal: "https-tcp",
},
Protocol: "TCP",
},
},
},
}
return service
}