Skip to content

Commit 2cff456

Browse files
patrykw-splunkPatryk Wasielewski
andauthored
Remove kube-rbac-proxy references and implement upgrade-sdk 1.38 changes (#1565)
* remove kube-rbac-proxy references and implement upgrade-sdk 1.38 changes * fix kustomize references * fix container number for debug * cleanup * fix service for metrics --------- Co-authored-by: Patryk Wasielewski <pwasiele@splunk.com>
1 parent 979ddcd commit 2cff456

22 files changed

Lines changed: 108 additions & 191 deletions

config/debug/kustomization-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ patches:
119119
name: controller-manager
120120
patch: |-
121121
- op: add
122-
path: /spec/template/spec/containers/2/env
122+
path: /spec/template/spec/containers/1/env
123123
value:
124124
- name: WATCH_NAMESPACE
125125
value: WATCH_NAMESPACE_VALUE

config/debug/kustomization-namespace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ patches:
119119
name: controller-manager
120120
patch: |-
121121
- op: add
122-
path: /spec/template/spec/containers/2/env
122+
path: /spec/template/spec/containers/1/env
123123
value:
124124
- name: WATCH_NAMESPACE
125125
valueFrom:

config/debug/kustomization.yaml

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

2931
patchesStrategicMerge:
30-
# Protect the /metrics endpoint by putting it behind auth.
31-
# If you want your controller-manager to expose the /metrics
32-
# endpoint w/o any authn/z, please comment the following line.
33-
- manager_auth_proxy_patch.yaml
3432
- debug-sidecar-patch.yaml
3533

3634

@@ -121,7 +119,7 @@ patches:
121119
name: controller-manager
122120
patch: |-
123121
- op: add
124-
path: /spec/template/spec/containers/2/env
122+
path: /spec/template/spec/containers/1/env
125123
value:
126124
- name: WATCH_NAMESPACE
127125
value: WATCH_NAMESPACE_VALUE
@@ -134,4 +132,9 @@ patches:
134132
- name: POD_NAME
135133
valueFrom:
136134
fieldRef:
137-
fieldPath: metadata.name
135+
fieldPath: metadata.name
136+
# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443.
137+
# More info: https://book.kubebuilder.io/reference/metrics
138+
- path: manager_metrics_patch.yaml
139+
target:
140+
kind: Deployment

config/debug/manager_auth_proxy_patch.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

config/debug/manager_config_patch.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This patch adds the args to allow exposing the metrics endpoint using HTTPS
2+
- op: add
3+
path: /spec/template/spec/containers/1/args/0
4+
value: --metrics-bind-address=:8443

config/debug/metrics_service.yaml

Lines changed: 17 additions & 0 deletions
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: controller-manager
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

config/default/kustomization-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ patches:
119119
name: controller-manager
120120
patch: |-
121121
- op: add
122-
path: /spec/template/spec/containers/2/env
122+
path: /spec/template/spec/containers/0/env
123123
value:
124124
- name: WATCH_NAMESPACE
125125
value: WATCH_NAMESPACE_VALUE

config/default/kustomization-namespace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ patches:
119119
name: controller-manager
120120
patch: |-
121121
- op: add
122-
path: /spec/template/spec/containers/2/env
122+
path: /spec/template/spec/containers/0/env
123123
value:
124124
- name: WATCH_NAMESPACE
125125
valueFrom:

config/default/kustomization.yaml

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

29-
patchesStrategicMerge:
30-
# Protect the /metrics endpoint by putting it behind auth.
31-
# If you want your controller-manager to expose the /metrics
32-
# endpoint w/o any authn/z, please comment the following line.
33-
- manager_auth_proxy_patch.yaml
3431

32+
patchesStrategicMerge:
3533
# Mount the controller config file for loading manager configurations
3634
# through a ComponentConfig type
3735
#- manager_config_patch.yaml
@@ -119,7 +117,7 @@ patches:
119117
name: controller-manager
120118
patch: |-
121119
- op: add
122-
path: /spec/template/spec/containers/2/env
120+
path: /spec/template/spec/containers/0/env
123121
value:
124122
- name: WATCH_NAMESPACE
125123
value: WATCH_NAMESPACE_VALUE
@@ -132,4 +130,9 @@ patches:
132130
- name: POD_NAME
133131
valueFrom:
134132
fieldRef:
135-
fieldPath: metadata.name
133+
fieldPath: metadata.name
134+
# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443.
135+
# More info: https://book.kubebuilder.io/reference/metrics
136+
- path: manager_metrics_patch.yaml
137+
target:
138+
kind: Deployment

0 commit comments

Comments
 (0)