Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable kube-rbac-proxy from prometheus-exporter-operator controller-manager #26

Merged
merged 4 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Current Operator version
VERSION ?= 0.3.0
VERSION ?= 0.3.1
# Image URL to use all building/pushing image targets
IMG ?= quay.io/3scale/prometheus-exporter-operator:v$(VERSION)
# Default catalog image
Expand Down Expand Up @@ -143,7 +143,7 @@ bundle-build:
#########################
prepare-alpha-release: bundle

prepare-release: bundle
prepare-stable-release: bundle
$(MAKE) bundle CHANNELS=alpha,stable DEFAULT_CHANNEL=alpha

bundle-push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
endpoints:
- path: /metrics
port: https
port: http
selector:
matchLabels:
control-plane: controller-manager
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ metadata:
name: prometheus-exporter-operator-controller-manager-metrics-service
spec:
ports:
- name: https
port: 8443
targetPort: https
- name: http
port: 8080
targetPort: http
selector:
control-plane: controller-manager
status:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ metadata:
operators.operatorframework.io/project_layout: ansible.sdk.operatorframework.io/v1
repository: https://github.com/3scale-ops/prometheus-exporter-operator
support: Red Hat, Inc.
name: prometheus-exporter-operator.v0.3.0
name: prometheus-exporter-operator.v0.3.1
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -88,21 +88,6 @@ spec:
mediatype: image/svg+xml
install:
spec:
clusterPermissions:
- rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
serviceAccountName: prometheus-exporter-operator-controller-manager
deployments:
- name: prometheus-exporter-operator-controller-manager
spec:
Expand All @@ -118,18 +103,7 @@ spec:
spec:
containers:
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
resources: {}
- args:
- --metrics-addr=127.0.0.1:8080
- --metrics-addr=0.0.0.0:8080
- --enable-leader-election
- --leader-election-id=prometheus-exporter-operator
env:
Expand All @@ -139,7 +113,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
image: quay.io/3scale/prometheus-exporter-operator:v0.3.0
image: quay.io/3scale/prometheus-exporter-operator:v0.3.1
livenessProbe:
httpGet:
path: /healthz
Expand All @@ -148,6 +122,9 @@ spec:
periodSeconds: 20
timeoutSeconds: 5
name: manager
ports:
- containerPort: 8080
name: http
readinessProbe:
httpGet:
path: /readyz
Expand Down Expand Up @@ -293,4 +270,4 @@ spec:
provider:
name: Red Hat
url: https://www.redhat.com
version: 0.3.0
version: 0.3.1
3 changes: 2 additions & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
#- manager_auth_proxy_patch.yaml
- manager_metrics_patch.yaml
17 changes: 17 additions & 0 deletions config/default/manager_metrics_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
args:
- "--metrics-addr=0.0.0.0:8080"
- "--enable-leader-election"
- "--leader-election-id=prometheus-exporter-operator"
ports:
- containerPort: 8080
name: http
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/3scale/prometheus-exporter-operator
newTag: v0.3.0
newTag: v0.3.1
5 changes: 3 additions & 2 deletions config/manual/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
#- manager_auth_proxy_patch.yaml
- manager_metrics_patch.yaml

patches:
- target:
Expand All @@ -32,5 +33,5 @@ patches:
name: controller-manager
patch: |-
- op: replace
path: /spec/template/spec/containers/1/env/1
path: /spec/template/spec/containers/0/env/1
value: { "name": "WATCH_NAMESPACE", "value": prometheus-exporter-operator-system }
17 changes: 17 additions & 0 deletions config/manual/manager_metrics_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
args:
- "--metrics-addr=0.0.0.0:8080"
- "--enable-leader-election"
- "--leader-election-id=prometheus-exporter-operator"
ports:
- containerPort: 8080
name: http
2 changes: 1 addition & 1 deletion config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
spec:
endpoints:
- path: /metrics
port: https
port: http
selector:
matchLabels:
control-plane: controller-manager
9 changes: 5 additions & 4 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ resources:
# Comment the following 4 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_client_clusterrole.yaml
#- auth_proxy_service.yaml
#- auth_proxy_role.yaml
#- auth_proxy_role_binding.yaml
#- auth_proxy_client_clusterrole.yaml
- metrics_service.yaml
14 changes: 14 additions & 0 deletions config/rbac/metrics_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
name: controller-manager-metrics-service
namespace: system
spec:
ports:
- name: http
port: 8080
targetPort: http
selector:
control-plane: controller-manager
5 changes: 3 additions & 2 deletions config/testing/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namePrefix: prometheus-exporter-operator-

patchesStrategicMerge:
- debug_logs_patch.yaml
- manager_auth_proxy_patch.yaml
#- manager_auth_proxy_patch.yaml
- manager_metrics_patch.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand All @@ -28,5 +29,5 @@ patches:
name: controller-manager
patch: |-
- op: replace
path: /spec/template/spec/containers/1/env/2
path: /spec/template/spec/containers/0/env/2
value: { "name": "WATCH_NAMESPACE", "value": default }
17 changes: 17 additions & 0 deletions config/testing/manager_metrics_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
args:
- "--metrics-addr=0.0.0.0:8080"
- "--enable-leader-election"
- "--leader-election-id=prometheus-exporter-operator"
ports:
- containerPort: 8080
name: http
4 changes: 2 additions & 2 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ make prepare-alpha-release
* Then you can manually execute opeator, bundle and catalog build/push.

## Stable
* Either if it is an **stable** release, execute the following target to create appropiate `alpha` and `stable` bundle files:
* But if it is an **stable** release, execute the following target to create appropiate `alpha` and `stable` bundle files:
```bash
make prepare-release
make prepare-stable-release
```
* Then open a [Pull Request](https://github.com/3scale-ops/prometheus-exporter-operator/pulls), and a GitHub Action will automatically detect if it is new release or not, in order to create it by building/pushing new operator, bundle and catalog images, as well as creating a GitHub release draft.