File tree Expand file tree Collapse file tree 3 files changed +11
-28
lines changed
Expand file tree Collapse file tree 3 files changed +11
-28
lines changed Original file line number Diff line number Diff line change 3535 # - ../prometheus
3636patchesStrategicMerge :
3737 # Protect the /metrics endpoint by putting it behind auth.
38+ # Configure the controller-manager to serve metrics securely using
39+ # controller-runtime's built-in authentication and authorization.
3840 # If you want your controller-manager to expose the /metrics
3941 # endpoint w/o any authn/z, please comment the following line.
4042 - manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change 1111# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212# See the License for the specific language governing permissions and
1313# limitations under the License.
14- # This patch inject a sidecar container which is a HTTP proxy for the
15- # controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews .
14+ # This patch configures the controller manager to expose metrics on port 8443.
15+ # Access is controlled via Kubernetes RBAC on the metrics service .
1616apiVersion : apps/v1
1717kind : Deployment
1818metadata :
@@ -22,31 +22,12 @@ spec:
2222 template :
2323 spec :
2424 containers :
25- - name : kube-rbac-proxy
26- securityContext :
27- allowPrivilegeEscalation : false
28- capabilities :
29- drop :
30- - " ALL"
31- image : gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
25+ - name : manager
3226 args :
33- - " --secure-listen-address=0.0.0.0:8443"
34- - " --upstream=http://127.0.0.1:8080/"
35- - " --logtostderr=true"
36- - " --v=0"
27+ - " --health-probe-bind-address=:8081"
28+ - " --metrics-bind-address=:8443"
29+ - " --leader-elect"
3730 ports :
3831 - containerPort : 8443
3932 protocol : TCP
4033 name : https
41- resources :
42- limits :
43- cpu : 500m
44- memory : 128Mi
45- requests :
46- cpu : 5m
47- memory : 64Mi
48- - name : manager
49- args :
50- - " --health-probe-bind-address=:8081"
51- - " --metrics-bind-address=127.0.0.1:8080"
52- - " --leader-elect"
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ resources:
2222 - role_binding.yaml
2323 - leader_election_role.yaml
2424 - leader_election_role_binding.yaml
25- # Comment the following 4 lines if you want to disable
26- # the Auth Proxy (https://github.com/brancz/kube-rbac-proxy)
27- # which protects your /metrics endpoint .
25+ # The following resources are required for the controller-runtime's
26+ # built-in metrics authentication and authorization.
27+ # Comment these lines if you want to disable secure metrics .
2828 - auth_proxy_service.yaml
2929 - auth_proxy_role.yaml
3030 - auth_proxy_role_binding.yaml
You can’t perform that action at this time.
0 commit comments