Files
duocthu/infra/helm/medical-chatbot/templates/api-gateway.yaml
T

57 lines
2.1 KiB
YAML

{{- if .Values.apiGateway.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "medical-chatbot.fullname" . }}-api-gateway
labels:
{{- include "medical-chatbot.labels" . | nindent 4 }}
app.kubernetes.io/component: api-gateway
spec:
replicas: {{ .Values.apiGateway.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: api-gateway
template:
metadata:
labels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: api-gateway
annotations:
checksum/runtime-config: {{ dict "port" .Values.apiGateway.service.port | toJson | sha256sum | quote }}
spec:
serviceAccountName: {{ include "medical-chatbot.serviceAccountName" . }}
imagePullSecrets:
{{- toYaml .Values.global.imagePullSecrets | nindent 8 }}
containers:
- name: api-gateway
image: {{ include "medical-chatbot.image" (dict "image" .Values.apiGateway.image "name" "apiGateway") | quote }}
imagePullPolicy: {{ .Values.apiGateway.image.pullPolicy }}
ports:
- { name: http, containerPort: {{ .Values.apiGateway.service.port }} }
env:
- name: PORT
value: {{ .Values.apiGateway.service.port | quote }}
- name: AUTH_SERVICE_URL
value: {{ printf "http://%s-auth-service:%d" (include "medical-chatbot.fullname" .) (.Values.authService.service.port | int) | quote }}
resources:
{{- toYaml .Values.apiGateway.resources | nindent 12 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "medical-chatbot.fullname" . }}-api-gateway
labels:
{{- include "medical-chatbot.labels" . | nindent 4 }}
app.kubernetes.io/component: api-gateway
spec:
type: {{ .Values.apiGateway.service.type }}
selector:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: api-gateway
ports:
- name: http
port: {{ .Values.apiGateway.service.port }}
targetPort: http
{{- end }}