Skip to content

Commit ce05603

Browse files
mbobrovskyiChristianZaccaria
authored andcommitted
DROP: Remove deprecated kube-rbac-proxy. (kubernetes-sigs#3760)
* Remove deprecated kube-rbac-proxy. * Bump limit for controller manager.
1 parent 55a70f8 commit ce05603

26 files changed

+304
-75
lines changed

apis/config/v1beta1/defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const (
3333
DefaultWebhookSecretName = "kueue-webhook-server-cert"
3434
DefaultWebhookPort = 9443
3535
DefaultHealthProbeBindAddress = ":8081"
36-
DefaultMetricsBindAddress = ":8080"
36+
DefaultMetricsBindAddress = ":8443"
3737
DefaultLeaderElectionID = "c1f6bfd2.kueue.x-k8s.io"
3838
DefaultLeaderElectionLeaseDuration = 15 * time.Second
3939
DefaultLeaderElectionRenewDeadline = 10 * time.Second

charts/kueue/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ The following table lists the configurable parameters of the kueue chart and the
5757
| `enablePrometheus` | enable Prometheus | `false` |
5858
| `enableCertManager` | enable CertManager | `false` |
5959
| `enableVisibilityAPF` | enable APF for the visibility API | `false` |
60-
| `controllerManager.kubeRbacProxy.image` | controllerManager.kubeRbacProxy's image | `registry.k8s.io/kubebuilder/kube-rbac-proxy:v0.8.0` |
6160
| `controllerManager.manager.image.repository` | controllerManager.manager's repository and image | `us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue` |
6261
| `controllerManager.manager.image.tag` | controllerManager.manager's tag | `main` |
6362
| `controllerManager.manager.resources` | controllerManager.manager's resources | abbr. |

charts/kueue/templates/manager/manager.yaml

-13
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,6 @@ spec:
6767
- mountPath: /controller_manager_config.yaml
6868
name: manager-config
6969
subPath: controller_manager_config.yaml
70-
- args:
71-
- --secure-listen-address=0.0.0.0:8443
72-
- --upstream=http://127.0.0.1:8080/
73-
- --logtostderr=true
74-
- --v=10
75-
image: "{{ .Values.controllerManager.kubeRbacProxy.image.repository }}:{{ .Values.controllerManager.kubeRbacProxy.image.tag }}"
76-
imagePullPolicy: {{ .Values.controllerManager.kubeRbacProxy.image.pullPolicy }}
77-
name: kube-rbac-proxy
78-
ports:
79-
- containerPort: 8443
80-
name: https
81-
protocol: TCP
82-
resources: {}
8370
securityContext:
8471
{{- toYaml .Values.controllerManager.manager.podSecurityContext | nindent 8 }}
8572
serviceAccountName: {{ include "kueue.fullname" . }}-controller-manager

charts/kueue/templates/rbac/auth_proxy_role.yaml charts/kueue/templates/rbac/metrics_auth_role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: ClusterRole
33
metadata:
44
labels:
55
{{- include "kueue.labels" . | nindent 4 }}
6-
name: '{{ include "kueue.fullname" . }}-proxy-role'
6+
name: '{{ include "kueue.fullname" . }}-metrics-auth-role'
77
rules:
88
- apiGroups:
99
- authentication.k8s.io

charts/kueue/templates/rbac/auth_proxy_role_binding.yaml charts/kueue/templates/rbac/metrics_auth_role_binding.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ kind: ClusterRoleBinding
33
metadata:
44
labels:
55
{{- include "kueue.labels" . | nindent 4 }}
6-
name: '{{ include "kueue.fullname" . }}-proxy-rolebinding'
6+
name: '{{ include "kueue.fullname" . }}-metrics-auth-rolebinding'
77
roleRef:
88
apiGroup: rbac.authorization.k8s.io
99
kind: ClusterRole
10-
name: '{{ include "kueue.fullname" . }}-proxy-role'
10+
name: '{{ include "kueue.fullname" . }}-metrics-auth-role'
1111
subjects:
1212
- kind: ServiceAccount
1313
name: '{{ include "kueue.fullname" . }}-controller-manager'

charts/kueue/values.yaml

+2-9
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ controllerManager:
1414
#featureGates:
1515
# - name: PartialAdmission
1616
# enabled: true
17-
kubeRbacProxy:
18-
image:
19-
repository: registry.k8s.io/kubebuilder/kube-rbac-proxy
20-
# tag
21-
tag: v0.16.0
22-
# This should be set to 'IfNotPresent' for released version
23-
pullPolicy: IfNotPresent
2417
manager:
2518
image:
2619
repository: us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue
@@ -29,7 +22,7 @@ controllerManager:
2922
podAnnotations: {}
3023
resources:
3124
limits:
32-
cpu: 500m
25+
cpu: "2"
3326
memory: 512Mi
3427
requests:
3528
cpu: 500m
@@ -65,7 +58,7 @@ managerConfig:
6558
health:
6659
healthProbeBindAddress: :8081
6760
metrics:
68-
bindAddress: :8080
61+
bindAddress: :8443
6962
# enableClusterQueueResources: true
7063
webhook:
7164
port: 9443

cmd/kueue/main.go

+13
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ import (
4141
ctrl "sigs.k8s.io/controller-runtime"
4242
"sigs.k8s.io/controller-runtime/pkg/healthz"
4343
"sigs.k8s.io/controller-runtime/pkg/log/zap"
44+
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"
45+
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
4446

4547
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
4648
kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
@@ -142,6 +144,17 @@ func main() {
142144

143145
features.LogFeatureGates(setupLog)
144146

147+
// Metrics endpoint is enabled in 'config/default/kustomization.yaml'. The Metrics options configure the server.
148+
// More info:
149+
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/metrics/server
150+
// - https://book.kubebuilder.io/reference/metrics.html
151+
metricsServerOptions := metricsserver.Options{
152+
BindAddress: cfg.Metrics.BindAddress,
153+
SecureServing: true,
154+
FilterProvider: filters.WithAuthenticationAndAuthorization,
155+
}
156+
options.Metrics = metricsServerOptions
157+
145158
metrics.Register()
146159

147160
kubeConfig := ctrl.GetConfigOrDie()

config/components/manager/auth_proxy_service.yaml

-11
This file was deleted.

config/components/manager/controller_manager_config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Configuration
33
health:
44
healthProbeBindAddress: :8081
55
metrics:
6-
bindAddress: :8080
6+
bindAddress: :8443
77
enableClusterQueueResources: true
88
webhook:
99
port: 9443

config/components/manager/kustomization.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# Comment the "auth_proxy_service.yaml" entry if you want to disable the service
2-
# for auth proxy (https://github.com/brancz/kube-rbac-proxy)
31
resources:
42
- manager.yaml
5-
- auth_proxy_service.yaml
63

74
generatorOptions:
85
disableNameSuffixHash: true

config/components/manager/manager.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
4444
resources:
4545
limits:
46-
cpu: 500m
46+
cpu: "2"
4747
memory: 512Mi
4848
requests:
4949
cpu: 500m

config/components/rbac/kustomization.yaml

+9-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ resources:
99
- role_binding.yaml
1010
- leader_election_role.yaml
1111
- leader_election_role_binding.yaml
12-
# Comment the following 3 lines if you want to disable
13-
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
14-
# which protects your /metrics endpoint.
15-
- auth_proxy_role.yaml
16-
- auth_proxy_role_binding.yaml
17-
- auth_proxy_client_clusterrole.yaml
12+
# The following RBAC configurations are used to protect
13+
# the metrics endpoint with authn/authz. These configurations
14+
# ensure that only authorized users and service accounts
15+
# can access the metrics endpoint. Comment the following
16+
# permissions if you want to disable this protection.
17+
# More info: https://book.kubebuilder.io/reference/metrics.html
18+
- metrics_auth_role.yaml
19+
- metrics_auth_role_binding.yaml
20+
- metrics_reader_role.yaml
1821
# ClusterRoles for Kueue APIs
1922
- batch_admin_role.yaml
2023
- batch_user_role.yaml

config/components/rbac/auth_proxy_role.yaml config/components/rbac/metrics_auth_role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: proxy-role
4+
name: metrics-auth-role
55
rules:
66
- apiGroups:
77
- authentication.k8s.io

config/components/rbac/auth_proxy_role_binding.yaml config/components/rbac/metrics_auth_role_binding.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: proxy-rolebinding
4+
name: metrics-auth-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole
8-
name: proxy-role
8+
name: metrics-auth-role
99
subjects:
1010
- kind: ServiceAccount
1111
name: controller-manager

config/default/kustomization.yaml

+2-5
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@ resources:
3030
# - ../components/certmanager
3131
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
3232
#- ../components/prometheus
33+
# [METRICS] Expose the controller manager metrics service.
34+
- metrics_service.yaml
3335

3436
transformers:
3537
# Sets the namespace for the role binding as kube-system instead of default kueue-system
3638
- role_binding_visibility_transformer.yaml
3739

3840
patches:
39-
# Protect the /metrics endpoint by putting it behind auth.
40-
# If you want your controller-manager to expose the /metrics
41-
# endpoint w/o any authn/z, please comment the following line.
42-
- path: manager_auth_proxy_patch.yaml
43-
4441
# Mount the controller config file for loading manager configurations
4542
# through a ComponentConfig type
4643
- path: manager_config_patch.yaml

config/default/metrics_service.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
control-plane: controller-manager
6+
app.kubernetes.io/name: kueue
7+
app.kubernetes.io/managed-by: kustomize
8+
name: controller-manager-metrics-service
9+
namespace: system
10+
spec:
11+
ports:
12+
- name: https
13+
port: 8443
14+
protocol: TCP
15+
targetPort: 8443
16+
selector:
17+
control-plane: controller-manager

hack/e2e-common.sh

+16-10
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ if [[ -n ${KUBEFLOW_MPI_VERSION:-} ]]; then
4141
fi
4242

4343
# sleep image to use for testing.
44-
export E2E_TEST_IMAGE_OLD=gcr.io/k8s-staging-perf-tests/sleep:v0.0.3@sha256:00ae8e01dd4439edfb7eb9f1960ac28eba16e952956320cce7f2ac08e3446e6b
45-
E2E_TEST_IMAGE_OLD_WITHOUT_SHA=${E2E_TEST_IMAGE_OLD%%@*}
46-
export E2E_TEST_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0@sha256:8d91ddf9f145b66475efda1a1b52269be542292891b5de2a7fad944052bab6ea
47-
E2E_TEST_IMAGE_WITHOUT_SHA=${E2E_TEST_IMAGE%%@*}
44+
export E2E_TEST_SLEEP_IMAGE_OLD=gcr.io/k8s-staging-perf-tests/sleep:v0.0.3@sha256:00ae8e01dd4439edfb7eb9f1960ac28eba16e952956320cce7f2ac08e3446e6b
45+
E2E_TEST_SLEEP_IMAGE_OLD_WITHOUT_SHA=${E2E_TEST_SLEEP_IMAGE_OLD%%@*}
46+
export E2E_TEST_SLEEP_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0@sha256:8d91ddf9f145b66475efda1a1b52269be542292891b5de2a7fad944052bab6ea
47+
E2E_TEST_SLEEP_IMAGE_WITHOUT_SHA=${E2E_TEST_SLEEP_IMAGE%%@*}
48+
export E2E_TEST_CURL_IMAGE=curlimages/curl:8.11.0@sha256:6324a8b41a7f9d80db93c7cf65f025411f55956c6b248037738df3bfca32410c
49+
E2E_TEST_CURL_IMAGE_WITHOUT_SHA=${E2E_TEST_CURL_IMAGE%%@*}
50+
4851

4952
# $1 - cluster name
5053
function cluster_cleanup {
@@ -66,14 +69,16 @@ function cluster_create {
6669
}
6770

6871
function prepare_docker_images {
69-
docker pull "$E2E_TEST_IMAGE_OLD"
70-
docker pull "$E2E_TEST_IMAGE"
72+
docker pull "$E2E_TEST_SLEEP_IMAGE_OLD"
73+
docker pull "$E2E_TEST_SLEEP_IMAGE"
74+
docker pull "$E2E_TEST_CURL_IMAGE"
7175

7276
# We can load image by a digest but we cannot reference it by the digest that we pulled.
7377
# For more information https://github.com/kubernetes-sigs/kind/issues/2394#issuecomment-888713831.
7478
# Manually create tag for image with digest which is already pulled
75-
docker tag $E2E_TEST_IMAGE_OLD "$E2E_TEST_IMAGE_OLD_WITHOUT_SHA"
76-
docker tag $E2E_TEST_IMAGE "$E2E_TEST_IMAGE_WITHOUT_SHA"
79+
docker tag $E2E_TEST_SLEEP_IMAGE_OLD "$E2E_TEST_SLEEP_IMAGE_OLD_WITHOUT_SHA"
80+
docker tag $E2E_TEST_SLEEP_IMAGE "$E2E_TEST_SLEEP_IMAGE_WITHOUT_SHA"
81+
docker tag $E2E_TEST_CURL_IMAGE "$E2E_TEST_CURL_IMAGE_WITHOUT_SHA"
7782

7883
if [[ -n ${JOBSET_VERSION:-} ]]; then
7984
docker pull "${JOBSET_IMAGE}"
@@ -88,8 +93,9 @@ function prepare_docker_images {
8893

8994
# $1 cluster
9095
function cluster_kind_load {
91-
cluster_kind_load_image "$1" "${E2E_TEST_IMAGE_OLD_WITHOUT_SHA}"
92-
cluster_kind_load_image "$1" "${E2E_TEST_IMAGE_WITHOUT_SHA}"
96+
cluster_kind_load_image "$1" "${E2E_TEST_SLEEP_IMAGE_OLD_WITHOUT_SHA}"
97+
cluster_kind_load_image "$1" "${E2E_TEST_SLEEP_IMAGE_WITHOUT_SHA}"
98+
cluster_kind_load_image "$1" "${E2E_TEST_CURL_IMAGE_WITHOUT_SHA}"
9399
cluster_kind_load_image "$1" "$IMAGE_TAG"
94100
}
95101

pkg/config/config_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace: kueue-tenant-a
6363
health:
6464
healthProbeBindAddress: :8081
6565
metrics:
66-
bindAddress: :8080
66+
bindAddress: :8443
6767
leaderElection:
6868
leaderElect: true
6969
resourceName: c1f6bfd2.kueue.x-k8s.io
@@ -99,7 +99,7 @@ namespace: kueue-system
9999
health:
100100
healthProbeBindAddress: :8081
101101
metrics:
102-
bindAddress: :8080
102+
bindAddress: :8443
103103
leaderElection:
104104
leaderElect: true
105105
resourceName: c1f6bfd2.kueue.x-k8s.io
@@ -121,7 +121,7 @@ namespace: kueue-system
121121
health:
122122
healthProbeBindAddress: :8081
123123
metrics:
124-
bindAddress: :8080
124+
bindAddress: :8443
125125
leaderElection:
126126
leaderElect: true
127127
resourceName: c1f6bfd2.kueue.x-k8s.io
@@ -141,7 +141,7 @@ namespace: kueue-system
141141
health:
142142
healthProbeBindAddress: :8081
143143
metrics:
144-
bindAddress: :8080
144+
bindAddress: :8443
145145
leaderElection:
146146
leaderElect: false
147147
webhook:
@@ -175,7 +175,7 @@ namespace: kueue-system
175175
health:
176176
healthProbeBindAddress: :8081
177177
metrics:
178-
bindAddress: :8080
178+
bindAddress: :8443
179179
leaderElection:
180180
leaderElect: true
181181
resourceName: c1f6bfd2.kueue.x-k8s.io
@@ -198,7 +198,7 @@ health:
198198
readinessEndpointName: ready
199199
livenessEndpointName: live
200200
metrics:
201-
bindAddress: :8080
201+
bindAddress: :8443
202202
pprofBindAddress: :8083
203203
leaderElection:
204204
leaderElect: true
@@ -317,7 +317,7 @@ invalidField: invalidValue
317317
health:
318318
healthProbeBindAddress: :8081
319319
metrics:
320-
bindAddress: :8080
320+
bindAddress: :8443
321321
leaderElection:
322322
leaderElect: true
323323
resourceName: c1f6bfd2.kueue.x-k8s.io

pkg/util/testingjobs/pod/wrappers.go

+5
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ func (p *PodWrapper) Request(r corev1.ResourceName, v string) *PodWrapper {
203203
return p
204204
}
205205

206+
func (p *PodWrapper) ServiceAccountName(serviceAccountName string) *PodWrapper {
207+
p.Spec.ServiceAccountName = serviceAccountName
208+
return p
209+
}
210+
206211
func (p *PodWrapper) Image(image string, args []string) *PodWrapper {
207212
p.Spec.Containers[0].Image = image
208213
p.Spec.Containers[0].Args = args

site/content/en/docs/installation/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ data:
119119
health:
120120
healthProbeBindAddress: :8081
121121
metrics:
122-
bindAddress: :8080
122+
bindAddress: :8443
123123
# enableClusterQueueResources: true
124124
webhook:
125125
port: 9443

0 commit comments

Comments
 (0)