101 lines
3.0 KiB
YAML
101 lines
3.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Release.Name }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
minReadySeconds: {{ .Values.deployment.minReadySeconds }}
|
|
progressDeadlineSeconds: {{ .Values.deployment.progressDeadlineSeconds }}
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxUnavailable: {{ .Values.deployment.maxUnavailable }}
|
|
maxSurge: {{ .Values.deployment.maxSurge }}
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
{{- with .Values.image.pullSecretName }}
|
|
imagePullSecrets:
|
|
- name: {{ . | quote }}
|
|
{{- end }}
|
|
containers:
|
|
- name: rule-engine
|
|
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- name: health
|
|
containerPort: 8080
|
|
env:
|
|
- name: HEALTH_ADDR
|
|
value: "0.0.0.0:8080"
|
|
- name: NATS_URL
|
|
value: {{ .Values.nats.url | quote }}
|
|
- name: NATS_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Values.nats.secretName }}
|
|
key: {{ .Values.nats.usernameKey }}
|
|
- name: NATS_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Values.nats.secretName }}
|
|
key: {{ .Values.nats.passwordKey }}
|
|
- name: NATS_QUEUE_GROUP
|
|
value: {{ .Values.nats.queueGroup | quote }}
|
|
- name: RULE_MAX_CONCURRENCY
|
|
value: {{ .Values.runtime.maxConcurrency | quote }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health/ready
|
|
port: health
|
|
periodSeconds: 5
|
|
timeoutSeconds: 2
|
|
failureThreshold: 3
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health/live
|
|
port: health
|
|
periodSeconds: 10
|
|
timeoutSeconds: 2
|
|
failureThreshold: 3
|
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
runAsNonRoot: true
|
|
capabilities:
|
|
drop: ["ALL"]
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ .Release.Name }}
|
|
spec:
|
|
type: ClusterIP
|
|
selector:
|
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
ports:
|
|
- name: health
|
|
port: {{ .Values.service.port }}
|
|
targetPort: health
|
|
---
|
|
apiVersion: policy/v1
|
|
kind: PodDisruptionBudget
|
|
metadata:
|
|
name: {{ .Release.Name }}
|
|
spec:
|
|
minAvailable: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|