4 corev1 "k8s.io/api/core/v1"
\r
5 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
\r
6 "k8s.io/apimachinery/pkg/util/intstr"
\r
9 func GetClusterRoleBinding() []*rbacv1.ClusterRoleBinding {
\r
11 clusterRoleBinding1 := &rbacv1.ClusterRoleBinding{
\r
12 TypeMeta: metav1.TypeMeta{
\r
13 APIVersion: "rbac.authorization.k8s.io/v1",
\r
14 Kind: "ClusterRoleBinding",
\r
16 ObjectMeta: metav1.ObjectMeta{
\r
17 Name: "svcacct-ricplt-appmgr-ricxapp-access",
\r
18 Namespace: "ricplt",
\r
20 RoleRef: rbacv1.RoleRef{
\r
21 Kind: "ClusterRole",
\r
22 Name: "svcacct-ricplt-appmgr-ricxapp-access",
\r
23 APIGroup: "rbac.authorization.k8s.io",
\r
25 Subjects: []rbacv1.Subject{
\r
28 Namespace: "ricplt",
\r
29 Kind: "ServiceAccount",
\r
30 Name: "svcacct-ricplt-appmgr",
\r
35 clusterRoleBinding2 := &rbacv1.ClusterRoleBinding{
\r
36 ObjectMeta: metav1.ObjectMeta{
\r
37 Name: "svcacct-ricplt-appmgr-ricxapp-getappconfig",
\r
38 Namespace: "ricxapp",
\r
40 RoleRef: rbacv1.RoleRef{
\r
41 APIGroup: "rbac.authorization.k8s.io",
\r
42 Kind: "ClusterRole",
\r
43 Name: "svcacct-ricplt-appmgr-ricxapp-getappconfig",
\r
45 Subjects: []rbacv1.Subject{
\r
48 Namespace: "ricplt",
\r
49 Kind: "ServiceAccount",
\r
50 Name: "svcacct-ricplt-appmgr",
\r
53 TypeMeta: metav1.TypeMeta{
\r
54 APIVersion: "rbac.authorization.k8s.io/v1",
\r
55 Kind: "ClusterRoleBinding",
\r
59 clusterRoleBinding3 := &rbacv1.ClusterRoleBinding{
\r
60 RoleRef: rbacv1.RoleRef{
\r
61 APIGroup: "rbac.authorization.k8s.io",
\r
62 Kind: "ClusterRole",
\r
63 Name: "release-name-kong",
\r
65 Subjects: []rbacv1.Subject{
\r
68 Namespace: "ricplt",
\r
69 Kind: "ServiceAccount",
\r
70 Name: "release-name-kong",
\r
73 TypeMeta: metav1.TypeMeta{
\r
74 APIVersion: "rbac.authorization.k8s.io/v1",
\r
75 Kind: "ClusterRoleBinding",
\r
77 ObjectMeta: metav1.ObjectMeta{
\r
78 Labels: map[string]string{
\r
79 "helm.sh/chart": "kong-0.36.6",
\r
80 "app.kubernetes.io/instance": "release-name",
\r
81 "app.kubernetes.io/managed-by": "Helm",
\r
82 "app.kubernetes.io/name": "kong",
\r
83 "app.kubernetes.io/version": "1.4",
\r
85 Name: "release-name-kong",
\r
89 clusterRoleBinding4 := &rbacv1.ClusterRoleBinding{
\r
90 Subjects: []rbacv1.Subject{
\r
93 Kind: "ServiceAccount",
\r
94 Name: "release-name-kong",
\r
95 Namespace: "ricplt",
\r
98 TypeMeta: metav1.TypeMeta{
\r
99 APIVersion: "rbac.authorization.k8s.io/v1",
\r
100 Kind: "ClusterRoleBinding",
\r
102 ObjectMeta: metav1.ObjectMeta{
\r
103 Labels: map[string]string{
\r
104 "app.kubernetes.io/instance": "release-name",
\r
105 "app.kubernetes.io/managed-by": "Helm",
\r
106 "app.kubernetes.io/name": "kong",
\r
107 "app.kubernetes.io/version": "1.4",
\r
108 "helm.sh/chart": "kong-0.36.6",
\r
110 Name: "release-name-kong",
\r
112 RoleRef: rbacv1.RoleRef{
\r
113 Name: "release-name-kong",
\r
114 APIGroup: "rbac.authorization.k8s.io",
\r
115 Kind: "ClusterRole",
\r
119 return []*rbacv1.ClusterRoleBinding{clusterRoleBinding1, clusterRoleBinding2, clusterRoleBinding3, clusterRoleBinding4}
\r