Skip to content

Commit

Permalink
Patch the metrics Service to point to the correct port
Browse files Browse the repository at this point in the history
  • Loading branch information
roivaz committed Oct 19, 2021
1 parent cec006e commit b7ab920
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ metadata:
name: marin3r-controller-manager-metrics-service
spec:
ports:
- name: https
port: 8443
- name: metrics
port: 8080
protocol: TCP
targetPort: https
targetPort: metrics
selector:
control-plane: controller-manager
status:
Expand Down
4 changes: 4 additions & 0 deletions bundle/manifests/marin3r.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,10 @@ spec:
initialDelaySeconds: 15
periodSeconds: 20
name: manager
ports:
- containerPort: 8080
name: metrics
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
Expand Down
7 changes: 7 additions & 0 deletions config/default/custom/metrics_service_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- op: replace
path: /spec/ports
value:
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
9 changes: 8 additions & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ patchesStrategicMerge:
# 'CERTMANAGER' needs to be enabled to use ca injection
- webhookcainjection_patch.yaml

patches:
# [CUSTOM] Change the port to http for the metrics Service
- path: custom/metrics_service_patch.yaml
target:
group: ""
kind: Service
name: controller-manager-metrics-service
version: v1
# [CUSTOM: cluster scope] Uncomment this for cluster scoped installations
patches: []
# - path: custom/clusterrole_patch.yaml
# target:
# group: rbac.authorization.k8s.io
Expand Down
6 changes: 5 additions & 1 deletion config/manager/custom/manager_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This patch injects custom arguments required by marin3r operator
# to run in the controller manager main container
# to run in the controller manager main container. Also adds metrics port.
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -20,3 +20,7 @@ spec:
requests:
cpu: 50m
memory: 100Mi
ports:
- containerPort: 8080
protocol: TCP
name: metrics
6 changes: 6 additions & 0 deletions config/olm/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ patches:
kind: Deployment
name: controller-webhook
version: v1
- path: metrics_service_patch.yaml
target:
group: ""
kind: Service
name: controller-manager-metrics-service
version: v1
7 changes: 7 additions & 0 deletions config/olm/metrics_service_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- op: replace
path: /spec/ports
value:
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics

0 comments on commit b7ab920

Please sign in to comment.