Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d1ed395
feat: remvoe rbac proxy
emirot Feb 23, 2026
86d7952
chore: remove rbac-kube-proxy
emirot Feb 25, 2026
73ca580
Merge branch 'main' into remove-kube-rbac
emirot Feb 26, 2026
05a47d9
Update config/release/kustomization.yaml
emirot Feb 26, 2026
e3212f9
Update Tiltfile
emirot Feb 26, 2026
c4a3e9d
chore: remove rbac-kube-proxy
emirot Feb 26, 2026
89b5472
Merge branch 'main' into remove-kube-rbac
emirot Feb 26, 2026
925de7c
Merge branch 'main' into remove-kube-rbac
emirot Feb 26, 2026
cca4050
Merge branch 'main' into remove-kube-rbac
emirot Feb 26, 2026
41badbc
Merge branch 'main' into remove-kube-rbac
emirot Feb 26, 2026
2d20f7b
feat: remove kube-rbac-proxy
emirot Feb 26, 2026
201b400
feat
emirot Feb 27, 2026
45d9493
feat: remove kube-rbac-proxy
emirot Feb 27, 2026
01616f3
feat: remove kube-rbac-proxy
emirot Feb 27, 2026
85125ac
Merge branch 'main' into remove-kube-rbac
emirot Feb 27, 2026
16be7a2
Merge branch 'main' into remove-kube-rbac
emirot Mar 2, 2026
e9f484a
chore: update deps
emirot Mar 2, 2026
06c30ab
Merge branch 'main' into remove-kube-rbac
emirot Mar 3, 2026
e6c2672
Merge branch 'main' into remove-kube-rbac
emirot Mar 4, 2026
c377c4b
feat: remove kube-rbac-proxy
emirot Mar 5, 2026
a2809c4
feat: remove kube-rbac-proxy
emirot Mar 5, 2026
ffb1f44
Merge remote-tracking branch 'upstream/main' into remove-kube-rbac
emirot Mar 5, 2026
f01fcc8
Merge branch 'main' into remove-kube-rbac
emirot Mar 5, 2026
743e796
Merge main into remove-kube-rbac
emirot Mar 6, 2026
bf4afb0
update deps
emirot Mar 6, 2026
57ba4be
Merge branch 'main' into remove-kube-rbac
emirot Mar 6, 2026
410ea53
Merge branch
emirot Mar 9, 2026
d085e1c
update deps
emirot Mar 9, 2026
64339d2
Merge branch 'main' into remove-kube-rbac
emirot Mar 9, 2026
c4217e9
Merge branch 'main' into remove-kube-rbac
emirot Mar 10, 2026
0c8b752
add documentation for https
emirot Mar 10, 2026
3a63025
Merge branch 'main' into remove-kube-rbac
emirot Mar 10, 2026
a0caba3
add documentation for https
emirot Mar 10, 2026
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
7 changes: 4 additions & 3 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ k8s_resource(
'promoter-gitcommitstatus-admin-role:clusterrole',
'promoter-gitcommitstatus-editor-role:clusterrole',
'promoter-gitcommitstatus-viewer-role:clusterrole',
'promoter-metrics-reader:clusterrole',
'promoter-proxy-role:clusterrole',
'promoter-timedcommitstatus-admin-role:clusterrole',
'promoter-timedcommitstatus-editor-role:clusterrole',
'promoter-timedcommitstatus-viewer-role:clusterrole',
'promoter-proxy-rolebinding:clusterrolebinding',
'promoter-metrics-auth-role:clusterrole',
'promoter-metrics-auth-rolebinding:clusterrolebinding',
'promoter-metrics-reader:clusterrole',
'promoter-metrics-reader-rolebinding:clusterrolebinding',
'promoter-controller-configuration:controllerconfiguration',
]
)
23 changes: 13 additions & 10 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
"runtime/debug"
"syscall"

"go.uber.org/zap/zapcore"
"sigs.k8s.io/controller-runtime/pkg/cluster"

"github.com/argoproj-labs/gitops-promoter/cmd/demo"
"github.com/argoproj-labs/gitops-promoter/internal/controller"
"github.com/argoproj-labs/gitops-promoter/internal/utils"
"github.com/argoproj-labs/gitops-promoter/internal/webserver"
"go.uber.org/zap/zapcore"
"sigs.k8s.io/controller-runtime/pkg/cluster"
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"

"sigs.k8s.io/controller-runtime/pkg/log/zap"

Expand Down Expand Up @@ -161,14 +161,17 @@ func runController(

// Create the provider first, then the manager with the provider
provider := kubeconfigprovider.New(providerOpts)

metricsOpts := metricsserver.Options{
BindAddress: metricsAddr,
SecureServing: secureMetrics,
TLSOpts: tlsOpts,
}
if secureMetrics {
metricsOpts.FilterProvider = filters.WithAuthenticationAndAuthorization
}
mcMgr, err := mcmanager.New(ctrl.GetConfigOrDie(), provider, ctrl.Options{
Scheme: scheme,
Metrics: metricsserver.Options{
BindAddress: metricsAddr,
SecureServing: secureMetrics,
TLSOpts: tlsOpts,
},
Scheme: scheme,
Metrics: metricsOpts,
WebhookServer: webhookServer,
HealthProbeBindAddress: probeAddr,
PprofBindAddress: pprofAddr,
Expand Down
28 changes: 2 additions & 26 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This patch inject a sidecar container which is a HTTP proxy for the
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
# This patch configures the controller manager with proper bind addresses
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -13,28 +12,5 @@ spec:
image: quay.io/argoprojlabs/gitops-promoter:latest
args:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=127.0.0.1:8080"
- "--metrics-bind-address=:9080"
- "--leader-elect"
- name: kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
image: quay.io/brancz/kube-rbac-proxy:v0.20.2
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=0"
ports:
- containerPort: 8443
protocol: TCP
name: https
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
10 changes: 10 additions & 0 deletions config/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ spec:
- --leader-elect
image: quay.io/argoprojlabs/gitops-promoter:latest
name: manager
ports:
- containerPort: 8443
name: https
protocol: TCP
- containerPort: 9080
name: http
protocol: TCP
- containerPort: 8081
name: health
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
1 change: 1 addition & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ resources:
- namespace.yaml
- deployment.yaml
- webhook_service.yaml
- metrics_service.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
apiVersion: v1
kind: Service
metadata:
name: controller-manager-metrics-service
labels:
control-plane: controller-manager
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/component: metrics
app.kubernetes.io/created-by: promoter
app.kubernetes.io/part-of: promoter
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: https
selector:
control-plane: controller-manager
ports:
- name: https
port: 8443
protocol: TCP
targetPort: https
- name: http
port: 9080
protocol: TCP
targetPort: http
16 changes: 0 additions & 16 deletions config/rbac/auth_proxy_client_clusterrole.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions config/rbac/auth_proxy_role.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions config/rbac/auth_proxy_role_binding.yaml

This file was deleted.

11 changes: 4 additions & 7 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ resources:
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# 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
- metrics_auth_role.yaml
- metrics_auth_role_binding.yaml
- metrics_reader_role.yaml
- metrics_reader_role_binding.yaml
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
# default, aiding admins in cluster management. Those roles are
# not used by the Project itself. You can comment the following lines
Expand Down
17 changes: 17 additions & 0 deletions config/rbac/metrics_auth_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: metrics-auth-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
12 changes: 12 additions & 0 deletions config/rbac/metrics_auth_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metrics-auth-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metrics-auth-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
9 changes: 9 additions & 0 deletions config/rbac/metrics_reader_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: metrics-reader
rules:
- nonResourceURLs:
- "/metrics"
verbs:
- get
12 changes: 12 additions & 0 deletions config/rbac/metrics_reader_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metrics-reader-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metrics-reader
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
Loading
Loading