Skip to content

Commit 01f76cf

Browse files
🐛 (cherry-pick #3945) fix place where metrics service is scaffolded by moving from config/rbac to config/default (#3948)
(cherry-pick #3945) fix place where metrics service is scaffolded by moving from config/rbac to config/default (#3948) When we discontinued the usage of kube-rbac-proxy we placed the Metrics Service under config/rbac but it is not the best place to fit this resource. Furthermore, within those changes we are ensuring that the metrics service will only be applied if/when users enable the metrics. * Upgrade sample testdata in the v3x branch
1 parent 445eb2a commit 01f76cf

File tree

38 files changed

+114
-168
lines changed

38 files changed

+114
-168
lines changed

.github/workflows/test-sample-go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
run: |
2525
KUSTOMIZATION_FILE_PATH="testdata/project-v4/config/default/kustomization.yaml"
2626
sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH
27-
sed -i '39s/^#//' $KUSTOMIZATION_FILE_PATH
28-
sed -i '44s/^#//' $KUSTOMIZATION_FILE_PATH
29-
sed -i '48,144s/^#//' $KUSTOMIZATION_FILE_PATH
27+
sed -i '32s/^#//' $KUSTOMIZATION_FILE_PATH
28+
sed -i '47s/^#//' $KUSTOMIZATION_FILE_PATH
29+
sed -i '51,147s/^#//' $KUSTOMIZATION_FILE_PATH
3030
3131
- name: Test
3232
run: |

docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ resources:
2525
#- ../certmanager
2626
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2727
#- ../prometheus
28+
# [METRICS] To enable the controller manager metrics service, uncomment the following line.
29+
#- metrics_service.yaml
2830

29-
patches:
31+
# Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager
32+
#patches:
3033
# [METRICS] The following patch will enable the metrics endpoint. Ensure that you also protect this endpoint.
3134
# More info: https://book.kubebuilder.io/reference/metrics
3235
# If you want to expose the metric endpoint of your controller-manager uncomment the following line.
File renamed without changes.

docs/book/src/component-config-tutorial/testdata/project/config/rbac/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ resources:
99
- role_binding.yaml
1010
- leader_election_role.yaml
1111
- leader_election_role_binding.yaml
12-
- metrics_service.yaml
1312
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
1413
# default, aiding admins in cluster management. Those roles are
1514
# not used by the Project itself. You can comment the following lines

docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ resources:
2525
- ../certmanager
2626
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2727
- ../prometheus
28+
# [METRICS] To enable the controller manager metrics service, uncomment the following line.
29+
#- metrics_service.yaml
2830

31+
# Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager
2932
patches:
3033
# [METRICS] The following patch will enable the metrics endpoint. Ensure that you also protect this endpoint.
3134
# More info: https://book.kubebuilder.io/reference/metrics
File renamed without changes.

docs/book/src/cronjob-tutorial/testdata/project/config/rbac/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ resources:
99
- role_binding.yaml
1010
- leader_election_role.yaml
1111
- leader_election_role_binding.yaml
12-
- metrics_service.yaml
1312
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
1413
# default, aiding admins in cluster management. Those roles are
1514
# not used by the Project itself. You can comment the following lines

docs/book/src/getting-started/testdata/project/config/default/kustomization.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ resources:
2525
#- ../certmanager
2626
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2727
#- ../prometheus
28+
# [METRICS] To enable the controller manager metrics service, uncomment the following line.
29+
#- metrics_service.yaml
2830

29-
patches:
31+
# Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager
32+
#patches:
3033
# [METRICS] The following patch will enable the metrics endpoint. Ensure that you also protect this endpoint.
3134
# More info: https://book.kubebuilder.io/reference/metrics
3235
# If you want to expose the metric endpoint of your controller-manager uncomment the following line.
File renamed without changes.

docs/book/src/getting-started/testdata/project/config/rbac/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ resources:
99
- role_binding.yaml
1010
- leader_election_role.yaml
1111
- leader_election_role_binding.yaml
12-
- metrics_service.yaml
1312
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
1413
# default, aiding admins in cluster management. Those roles are
1514
# not used by the Project itself. You can comment the following lines

0 commit comments

Comments
 (0)