@@ -14,52 +14,46 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
- package resource
17
+ package v2
18
18
19
19
import (
20
- "fmt"
21
20
"path/filepath"
22
21
23
22
"sigs.k8s.io/kubebuilder/pkg/scaffold/input"
24
23
)
25
24
26
- var _ input.File = & Role {}
25
+ var _ input.File = & AuthProxyService {}
27
26
28
- // Role scaffolds the config/manager/group_role_rbac .yaml file
29
- type Role struct {
27
+ // AuthProxyService scaffolds the config/rbac/auth_proxy_service .yaml file
28
+ type AuthProxyService struct {
30
29
input.Input
31
-
32
- // Resource is a resource in the API group
33
- Resource * Resource
34
30
}
35
31
36
32
// GetInput implements input.File
37
- func (r * Role ) GetInput () (input.Input , error ) {
33
+ func (r * AuthProxyService ) GetInput () (input.Input , error ) {
38
34
if r .Path == "" {
39
- r .Path = filepath .Join ("config" , "manager" , fmt .Sprintf (
40
- "%s_role_rbac.yaml" , r .Resource .Group ))
35
+ r .Path = filepath .Join ("config" , "rbac" , "auth_proxy_service.yaml" )
41
36
}
42
- r .TemplateBody = roleTemplate
37
+ r .TemplateBody = AuthProxyServiceTemplate
43
38
return r .Input , nil
44
39
}
45
40
46
- // Validate validates the values
47
- func (r * Role ) Validate () error {
48
- return r .Resource .Validate ()
49
- }
50
-
51
- var roleTemplate = `apiVersion: rbac.authorization.k8s.io/v1
52
- kind: ClusterRole
41
+ var AuthProxyServiceTemplate = `apiVersion: v1
42
+ kind: Service
53
43
metadata:
44
+ annotations:
45
+ prometheus.io/port: "8443"
46
+ prometheus.io/scheme: https
47
+ prometheus.io/scrape: "true"
54
48
labels:
55
- controller-tools.k8s.io: "1.0"
56
- name: {{.Resource.Group}}-role
57
- rules:
58
- - apiGroups :
59
- - {{ .Resource.Group }}.{{ .Domain }}
60
- resources:
61
- - '*'
62
- verbs:
63
- - '*'
64
-
49
+ control-plane: controller-manager
50
+ name: controller-manager-metrics-service
51
+ namespace: system
52
+ spec :
53
+ ports:
54
+ - name: https
55
+ port: 8443
56
+ targetPort: https
57
+ selector:
58
+ control-plane: controller-manager
65
59
`
0 commit comments