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

Fix kube-rbac-proxy configuration for ws-manager-bridge and proxy #5818

Merged
merged 3 commits into from
Sep 23, 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
1 change: 1 addition & 0 deletions chart/templates/proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ spec:
- -c
- "sysctl -w net.core.somaxconn=32768; sysctl -w net.ipv4.ip_local_port_range='1024 65000'"
containers:
{{ include "gitpod.kube-rbac-proxy" $this | indent 6 }}
- name: proxy
image: {{ template "gitpod.comp.imageFull" $this }}
{{ include "gitpod.container.imagePullPolicy" $this | indent 8 }}
Expand Down
20 changes: 20 additions & 0 deletions chart/templates/proxy-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,23 @@ roleRef:
kind: ClusterRole
name: {{ .Release.Namespace }}-ns-psp:restricted-root-user
apiGroup: rbac.authorization.k8s.io

---

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Namespace }}-proxy-kube-rbac-proxy
labels:
app: {{ template "gitpod.fullname" . }}
component: proxy
kind: role-binding
stage: {{ .Values.installation.stage }}
subjects:
- kind: ServiceAccount
name: proxy
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Namespace }}-kube-rbac-proxy
apiGroup: rbac.authorization.k8s.io
25 changes: 25 additions & 0 deletions chart/templates/ws-manager-bridge-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,29 @@ roleRef:
kind: ClusterRole
name: {{ .Release.Namespace }}-ns-psp:unprivileged
apiGroup: rbac.authorization.k8s.io
roleRef:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplication roleRef

kind: ClusterRole
name: {{ .Release.Namespace }}-kube-rbac-proxy
apiGroup: rbac.authorization.k8s.io

---

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Namespace }}-ws-manager-bridge-kube-rbac-proxy
labels:
app: {{ template "gitpod.fullname" . }}
component: ws-manager-bridge
kind: role-binding
stage: {{ .Values.installation.stage }}
subjects:
- kind: ServiceAccount
name: ws-manager-bridge
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Namespace }}-kube-rbac-proxy
apiGroup: rbac.authorization.k8s.io

{{ end }}
3 changes: 3 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ components:
https:
expose: true
containerPort: 443
metrics:
expose: false
containerPort: 9500
loadBalancerIP: null
serviceType: "LoadBalancer"
serviceSessionAffinity: "None"
Expand Down
2 changes: 2 additions & 0 deletions components/proxy/conf/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@
:8003 {
respond /live 200
respond /ready 200
}

127.0.0.1:9500 {
metrics /metrics {
disable_openmetrics
}
Expand Down