Refactor code-server templates: Add secret, headless-service, scripts, persistantvolumeclaim, configmap, certificate, and service templates

This commit is contained in:
2024-10-02 22:51:25 +08:00
parent 3948b03cc8
commit 9d627b2fc2
17 changed files with 989 additions and 0 deletions
@@ -0,0 +1,36 @@
{{- if and .Values.ingressRoute.create .Values.service.enabled -}}
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: {{ printf "%s-route" (include "code-server.fullname" . ) }}
labels:
{{- include "code-server.labels" . | nindent 4 }}
{{- with .Values.ingressRoute.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingressRoute.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingressRoute.entryPoints }}
entryPoints:
{{- toYaml . | nindent 4 }}
{{- end }}
routes:
- kind: Rule
match: {{ required "Mandatory field \".ingressRoute.rule\" is empty!" .Values.ingressRoute.rule }}
services:
- kind: Service
name: {{ include "code-server.fullname" . }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.ports.http.port }}
{{- with .Values.ingressRoute.middlewares }}
middlewares:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (include "code-server.ingressRoute.tlsSecretName" .) }}
tls:
secretName: {{ . }}
{{- end }}
{{- end }}