Files
coder/helm/libcoder/templates/_coder.yaml
Rowan Smith 76242f8202 feat: add hostAliases support to Coder helm chart (#24729)
adds support for specifying hostAliases entries in the Coder control
plane pod.

```
➜  coder git:(rowan/helm-hostaliases) helm template coder . --set coder.image.tag=v2.32.0 --set coder.hostAliases[0].hostnames[0]=coder.nicecorp.org --set coder.hostAliases[0].ip=1.1.1.1 
....
---
# Source: coder/templates/coder.yaml
apiVersion: apps/v1
kind: Deployment
....
      hostAliases:
      - hostnames:
        - coder.nicecorp.org
        ip: 1.1.1.1
      restartPolicy: Always
      serviceAccountName: coder
      terminationGracePeriodSeconds: 60
      volumes: []
```
2026-04-29 12:45:54 +10:00

119 lines
3.6 KiB
YAML

{{- define "libcoder.deployment.tpl" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "coder.name" .}}
namespace: {{ .Release.Namespace }}
labels:
{{- include "coder.labels" . | nindent 4 }}
{{- with .Values.coder.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations: {{ toYaml .Values.coder.annotations | nindent 4}}
spec:
replicas: {{ .Values.coder.replicaCount }}
selector:
matchLabels:
{{- include "coder.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "coder.labels" . | nindent 8 }}
{{- with .Values.coder.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- include "coder.componentAnnotation" . | nindent 8 }}
{{- with .Values.coder.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.coder.serviceAccount.name | quote }}
{{- with .Values.coder.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
{{- with .Values.coder.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Always
{{- with .Values.coder.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: 60
{{- with .Values.coder.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.initContainers }}
initContainers:
{{ toYaml . | nindent 8 }}
{{- end }}
containers: []
{{- include "coder.volumes" . | nindent 6 }}
{{- end -}}
{{- define "libcoder.deployment" -}}
{{- include "libcoder.util.merge" (append . "libcoder.deployment.tpl") -}}
{{- end -}}
{{- define "libcoder.containerspec.tpl" -}}
name: coder
image: {{ include "coder.image" . | quote }}
imagePullPolicy: {{ .Values.coder.image.pullPolicy }}
command:
{{- toYaml .Values.coder.command | nindent 2 }}
resources:
{{- if and (hasKey .Values.coder "resources") (not (empty .Values.coder.resources)) }}
{{- toYaml .Values.coder.resources | nindent 2 }}
{{- else }}
limits:
cpu: 2000m
memory: 4096Mi
requests:
cpu: 2000m
memory: 4096Mi
{{- end }}
lifecycle:
{{- toYaml .Values.coder.lifecycle | nindent 2 }}
securityContext: {{ toYaml .Values.coder.securityContext | nindent 2 }}
{{ include "coder.volumeMounts" . }}
{{- end -}}
{{- define "libcoder.containerspec" -}}
{{- include "libcoder.util.merge" (append . "libcoder.containerspec.tpl") -}}
{{- end -}}
{{- define "libcoder.serviceaccount.tpl" -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.coder.serviceAccount.name | quote }}
namespace: {{ .Release.Namespace }}
annotations: {{ toYaml .Values.coder.serviceAccount.annotations | nindent 4 }}
labels:
{{- include "coder.labels" . | nindent 4 }}
{{- with .Values.coder.serviceAccount.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
{{- define "libcoder.serviceaccount" -}}
{{- include "libcoder.util.merge" (append . "libcoder.serviceaccount.tpl") -}}
{{- end -}}