Skip to content

Commit

Permalink
chore: add v0.6.x to metadata, fix metrics service
Browse files Browse the repository at this point in the history
Part of #1070

Signed-off-by: Gerard de Leeuw <[email protected]>
Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
lion7 authored and smira committed Apr 7, 2023
1 parent e433504 commit ef65ff0
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ bases:
- ../manager

patchesStrategicMerge:
- manager_auth_proxy_patch.yaml
- manager_webhook_patch.yaml
- webhookcainjection_patch.yaml

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This patch inject a sidecar container which is an HTTP proxy for the controller manager,
# it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: kube-rbac-proxy
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.1
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=10"
ports:
- containerPort: 8443
name: https
1 change: 0 additions & 1 deletion app/caps-controller-manager/config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
namespace: system
spec:
ports:
- name: https
port: 8443
targetPort: https
- name: https
port: 8443
targetPort: https
selector:
control-plane: caps-controller-manager
6 changes: 3 additions & 3 deletions app/caps-controller-manager/config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ resources:
# Comment the following 3 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
# - auth_proxy_service.yaml
# - auth_proxy_role.yaml
# - auth_proxy_role_binding.yaml
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
14 changes: 7 additions & 7 deletions app/sidero-controller-manager/config/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# Only one of manager_auth_proxy_patch.yaml and
# manager_prometheus_metrics_patch.yaml should be enabled.
#- manager_auth_proxy_patch.yaml
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, uncomment the following line and
# comment manager_auth_proxy_patch.yaml.
# Only one of manager_auth_proxy_patch.yaml and
# manager_prometheus_metrics_patch.yaml should be enabled.
#- manager_prometheus_metrics_patch.yaml
- manager_auth_proxy_patch.yaml
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, uncomment the following line and
# comment manager_auth_proxy_patch.yaml.
# Only one of manager_auth_proxy_patch.yaml and
# manager_prometheus_metrics_patch.yaml should be enabled.
#- manager_prometheus_metrics_patch.yaml
- manager_webhook_patch.yaml
- webhookcainjection_patch.yaml
vars:
Expand Down
21 changes: 21 additions & 0 deletions app/sidero-controller-manager/config/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This patch inject a sidecar container which is an HTTP proxy for the controller manager,
# it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: kube-rbac-proxy
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.1
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=10"
ports:
- containerPort: 8443
name: https
4 changes: 2 additions & 2 deletions app/sidero-controller-manager/config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
control-plane: caps-controller-manager
control-plane: sidero-controller-manager
name: metrics-monitor
namespace: system
spec:
endpoints:
- path: /metrics
port: https
selector:
control-plane: caps-controller-manager
control-plane: sidero-controller-manager
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
control-plane: caps-controller-manager
control-plane: sidero-controller-manager
name: controller-manager-metrics-service
namespace: system
spec:
Expand All @@ -11,4 +11,4 @@ spec:
port: 8443
targetPort: https
selector:
control-plane: caps-controller-manager
control-plane: sidero-controller-manager
3 changes: 3 additions & 0 deletions config/metadata/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ releaseSeries:
- major: 0
minor: 5
contract: v1beta1
- major: 0
minor: 6
contract: v1beta1

0 comments on commit ef65ff0

Please sign in to comment.