Skip to content

Commit

Permalink
Fix the controller service labels
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l committed Jan 3, 2025
1 parent 21b4d62 commit 5a541e2
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ metadata:
}
}
]
createdAt: "2025-01-03T14:59:00Z"
createdAt: "2025-01-03T22:26:24Z"
description: Backstage Operator
operators.operatorframework.io/builder: operator-sdk-v1.37.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
Expand Down
2 changes: 1 addition & 1 deletion config/profile/backstage.io/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namePrefix: backstage-

resources:
- ../../crd
- ../../rbac
- ../../rbac/backstage.io
- manager.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
Expand Down
2 changes: 1 addition & 1 deletion config/profile/external/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namePrefix: backstage-

resources:
- ../../crd
- ../../rbac
- ../../rbac/external
#- ../../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
Expand Down
4 changes: 2 additions & 2 deletions config/profile/rhdh/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namePrefix: rhdh-

resources:
- ../../crd
- ../../rbac
- ../../rbac/rhdh
- manager.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
Expand Down Expand Up @@ -135,7 +135,7 @@ resources:

images:
- name: controller
newName: registry.redhat.io/rhdh/rhdh-rhel9-operator
newName: quay.io/rhdh/rhdh-rhel9-operator
newTag: "1.5"

generatorOptions:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ resources:
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Metrics
- metrics_service.yaml
# The following RBAC configurations are used to protect
# the metrics endpoint with authn/authz. These configurations
# ensure that only authorized users and service accounts
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
81 changes: 81 additions & 0 deletions config/rbac/_common/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: manager-role
rules:
- apiGroups:
- ""
resources:
- configmaps
- persistentvolumeclaims
- secrets
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- deployments
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- rhdh.redhat.com
resources:
- backstages
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- rhdh.redhat.com
resources:
- backstages/finalizers
verbs:
- update
- apiGroups:
- rhdh.redhat.com
resources:
- backstages/status
verbs:
- get
- patch
- update
- apiGroups:
- route.openshift.io
resources:
- routes
- routes/custom-host
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions config/rbac/backstage.io/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- ../_common
# Metrics
- metrics_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: controller-manager
app: backstage-operator
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: metrics
Expand All @@ -18,4 +18,4 @@ spec:
protocol: TCP
targetPort: metrics
selector:
app: controller-manager
app: backstage-operator
4 changes: 4 additions & 0 deletions config/rbac/rhdh/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- ../_common
# Metrics
- metrics_service.yaml
21 changes: 21 additions & 0 deletions config/rbac/rhdh/metrics_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: rhdh-operator
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: metrics
app.kubernetes.io/created-by: backstage-operator
app.kubernetes.io/part-of: backstage-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
spec:
ports:
- name: metrics
port: 8443
protocol: TCP
targetPort: metrics
selector:
app: rhdh-operator

0 comments on commit 5a541e2

Please sign in to comment.