-
Notifications
You must be signed in to change notification settings - Fork 313
/
nto.go
71 lines (64 loc) · 1.7 KB
/
nto.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package manifests
import (
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Deployment
func ClusterNodeTuningOperatorDeployment(namespace string) *appsv1.Deployment {
return &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "cluster-node-tuning-operator",
Namespace: namespace,
},
}
}
// Role
func ClusterNodeTuningOperatorRole(namespace string) *rbacv1.Role {
return &rbacv1.Role{
ObjectMeta: metav1.ObjectMeta{
Name: "cluster-node-tuning-operator",
Namespace: namespace,
},
}
}
// RoleBinding
func ClusterNodeTuningOperatorRoleBinding(namespace string) *rbacv1.RoleBinding {
return &rbacv1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{
Name: "cluster-node-tuning-operator",
Namespace: namespace,
},
}
}
// ServiceAccount
func ClusterNodeTuningOperatorServiceAccount(namespace string) *corev1.ServiceAccount {
return &corev1.ServiceAccount{
ObjectMeta: metav1.ObjectMeta{
Name: "cluster-node-tuning-operator",
Namespace: namespace,
},
}
}
// Metrics
func ClusterNodeTuningOperatorMetricsService(namespace string) *corev1.Service {
return &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: "node-tuning-operator",
Namespace: namespace,
},
Spec: corev1.ServiceSpec{
ClusterIP: "None",
},
}
}
func ClusterNodeTuningOperatorServiceMonitor(namespace string) *prometheusoperatorv1.ServiceMonitor {
return &prometheusoperatorv1.ServiceMonitor{
ObjectMeta: metav1.ObjectMeta{
Name: "node-tuning-operator",
Namespace: namespace,
},
}
}