Skip to content

Commit

Permalink
Refactor helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored and roboquat committed Nov 5, 2021
1 parent 037eb40 commit 5454cac
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 18 deletions.
12 changes: 1 addition & 11 deletions chart/templates/ws-proxy-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,12 @@ metadata:
data:
config.json: |-
{
"namespace": {{ .Release.Namespace | quote }},
"ingress": {
"httpAddress": ":{{- $comp.ports.httpProxy.containerPort -}}",
"httpsAddress": ":{{- $comp.ports.httpsProxy.containerPort -}}",
"header": "{{- $comp.hostHeader -}}"
},
"workspaceInfoProviderConfig": {
"wsManagerAddr": "ws-manager:8080",
"reconnectInterval": "3s",
"tls": {
"ca": "/ws-manager-client-tls-certs/ca.crt",
"crt": "/ws-manager-client-tls-certs/tls.crt",
"key": "/ws-manager-client-tls-certs/tls.key"
}
},
"proxy": {
"https": {
"crt": "/mnt/certificates/tls.crt",
Expand All @@ -53,8 +45,6 @@ data:
"workspaceHostSuffixRegex": {{ ($comp.workspaceHostSuffixRegex | default (printf "%s%s" "\\.ws[^\\.]*\\." ($.Values.hostname | replace "." "\\."))) | quote }}
},
"workspacePodConfig": {
"serviceTemplate": "http://ws-{{"{{ .workspaceID }}"}}-theia.{{- .Release.Namespace -}}.svc.cluster.local:{{"{{ .port }}"}}",
"portServiceTemplate": "http://ws-{{"{{ .workspaceID }}"}}-ports.{{- .Release.Namespace -}}.svc.cluster.local:{{"{{ .port }}"}}",
"theiaPort": {{ .Values.components.workspace.ports.http.containerPort }},
"supervisorPort": {{ .Values.components.workspace.ports.http.supervisorPort }},
"supervisorImage": "{{ template "gitpod.comp.imageFull" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.supervisor) }}"
Expand Down
9 changes: 3 additions & 6 deletions chart/templates/ws-proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
periodSeconds: 5
failureThreshold: 10
httpGet:
path: /
path: /readyz
port: 60088
livenessProbe:
initialDelaySeconds: 2
Expand All @@ -75,15 +75,12 @@ spec:
successThreshold: 1
timeoutSeconds: 2
httpGet:
path: /
path: /healthz
port: 60088
volumeMounts:
- name: config
mountPath: "/config"
readOnly: true
- mountPath: /ws-manager-client-tls-certs
name: ws-manager-client-tls-certs
readOnly: true
{{- if $.Values.certificatesSecret.secretName }}
- name: config-certificates
mountPath: "/mnt/certificates"
Expand All @@ -93,4 +90,4 @@ spec:
{{ include "gitpod.container.defaultEnv" $this | indent 8 }}
{{ include "gitpod.container.tracingEnv" $this | indent 8 }}
{{ toYaml .Values.defaults | indent 6 }}
{{ end }}
{{ end }}
21 changes: 21 additions & 0 deletions chart/templates/ws-proxy-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app: {{ template "gitpod.fullname" . }}
component: ws-proxy
kind: role
stage: {{ .Values.installation.stage }}
name: ws-proxy
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
21 changes: 20 additions & 1 deletion chart/templates/ws-proxy-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,23 @@ roleRef:
kind: ClusterRole
name: {{ .Release.Namespace }}-ns-psp:unprivileged
apiGroup: rbac.authorization.k8s.io
{{ end }}
---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ws-proxy-api
labels:
app: {{ template "gitpod.fullname" . }}
component: ws-proxy
kind: role-binding
stage: {{ .Values.installation.stage }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ws-proxy
subjects:
- kind: ServiceAccount
name: ws-proxy

{{ end }}

0 comments on commit 5454cac

Please sign in to comment.