Skip to content

feat: add ingress to helm chart #4446

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

Merged
merged 3 commits into from
Oct 10, 2022
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
53 changes: 53 additions & 0 deletions helm/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

{{- if .Values.coder.ingress.enable }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: coder
labels:
{{- include "coder.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.coder.ingress.annotations | nindent 4 }}
spec:
{{- if .Values.coder.ingress.className }}
{{/* If this is set to an empty string it fails validation on K8s */}}
ingressClassName: {{ .Values.coder.ingress.className | quote }}
{{- end }}

rules:
- host: {{ .Values.coder.ingress.host | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: coder
port:
name: {{ include "coder.portName" . | quote }}
{{- if .Values.coder.ingress.wildcardHost }}
- host: {{ .Values.coder.ingress.wildcardHost | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: coder
port:
name: {{ include "coder.portName" . | quote }}
{{- end }}

{{- if .Values.coder.ingress.tls.enable }}
tls:
- hosts:
- {{ .Values.coder.ingress.host | quote }}
secretName: {{ .Values.coder.ingress.tls.secretName | quote}}
{{- if .Values.coder.ingress.tls.wildcardSecretName }}
- hosts:
- {{ .Values.coder.ingress.wildcardHost | quote }}
secretName: {{ .Values.coder.ingress.tls.wildcardSecretName | quote}}
{{- end }}
{{- end }}
{{- end }}
29 changes: 28 additions & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ coder:

# coder.resources -- The resources to request for Coder. These are optional
# and are not set by default.
resources: {}
resources:
{}
# limits:
# cpu: 100m
# memory: 128Mi
Expand Down Expand Up @@ -88,3 +89,29 @@ coder:
# coder.service.annotations -- The service annotations. See:
# https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
annotations: {}

# coder.ingress -- The Ingress object to expose for Coder.
ingress:
# coder.ingress.enable -- Whether to create the Ingress object. If using an
# Ingress, we recommend not specifying coder.tls.secretNames as the Ingress
# will handle TLS termination.
enable: false
# coder.ingress.className -- The name of the Ingress class to use.
className: ""
# coder.ingress.host -- The hostname to match on.
host: ""
# coder.ingress.wildcardHost -- The wildcard hostname to match on. Should be
# in the form "*.example.com". Optional if not using applications over
# subdomains.
wildcardHost: ""
# coder.ingress.annotations -- The ingress annotations.
annotations: {}
# coder.ingress.tls -- The TLS configuration to use for the Ingress.
tls:
# coder.ingress.tls.enable -- Whether to enable TLS on the Ingress.
enable: false
# coder.ingress.tls.secretName -- The name of the TLS secret to use.
secretName: ""
# coder.ingress.tls.wildcardSecretName -- The name of the TLS secret to
# use for the wildcard host.
wildcardSecretName: ""