-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Recently I am configing chatwoot for k8s deployment, and it confuses me a bit and I found that:
- It is better to align with k8s convention. It confuses a bit when setting the port mapping.
charts/chatwoot/templates/web-service.yaml
apiVersion: v1
kind: Service
metadata:
name: {{ template "chatwoot.fullname" . }}
creationTimestamp: null
labels:
app: {{ template "chatwoot.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- with .Values.services.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
- name: {{ .Values.services.name | quote}}
port: {{ int .Values.services.internalPort }} # here we should use port to align the naming '.Values.services.port'
targetPort: {{ int .Values.services.targetPort }}
type: {{ .Values.services.type }}
selector:
app: {{ template "chatwoot.fullname" . }}
role: web
status:
loadBalancer: {}- also it is better to allow controlling the container port with containerPort
charts/chatwoot/templates/web-deployment.yaml
...
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
name: {{ .Chart.Name }}-web
ports:
- containerPort: {{ int .Values.services.internalPort }} # should accept container port '.Values.services.containerPort'
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.web.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
...Metadata
Metadata
Assignees
Labels
No labels