79 lines
2.0 KiB
YAML
79 lines
2.0 KiB
YAML
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: {{ .NAME }}
|
||
|
namespace: {{ .NAMESPACE }}
|
||
|
annotations:
|
||
|
external-dns.alpha.kubernetes.io/hostname: {{ .HOSTNAME }}
|
||
|
labels:
|
||
|
app: {{ .NAME }}
|
||
|
spec:
|
||
|
type: LoadBalancer
|
||
|
selector:
|
||
|
app: {{ .NAME }}
|
||
|
ports:
|
||
|
- port: 80
|
||
|
targetPort: {{ .PORT }}
|
||
|
name: {{ .NAME }}
|
||
|
protocol: TCP
|
||
|
|
||
|
---
|
||
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: {{ .NAME }}
|
||
|
namespace: {{ .NAMESPACE }}
|
||
|
spec:
|
||
|
replicas: {{ .REPLICAS }}
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: {{ .NAME }}
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: {{ .NAME }}
|
||
|
spec:
|
||
|
restartPolicy: Always
|
||
|
terminationGracePeriodSeconds: 40
|
||
|
containers:
|
||
|
- name: {{ .NAME }}
|
||
|
image: {{ .IMAGE_NAME }}
|
||
|
readinessProbe:
|
||
|
initialDelaySeconds: 30
|
||
|
periodSeconds: 20
|
||
|
timeoutSeconds: 3
|
||
|
failureThreshold: 3
|
||
|
httpGet:
|
||
|
path: /api/ready
|
||
|
port: {{ .PORT }}
|
||
|
livenessProbe:
|
||
|
initialDelaySeconds: 30
|
||
|
periodSeconds: 30
|
||
|
timeoutSeconds: 3
|
||
|
failureThreshold: 3
|
||
|
httpGet:
|
||
|
path: /api/health
|
||
|
port: {{ .PORT }}
|
||
|
env:
|
||
|
- name: WORMSCAN_PORT
|
||
|
value: "{{ .PORT }}"
|
||
|
- name: WORMSCAN_LOGLEVEL
|
||
|
value: {{ .WORMSCAN_LOGLEVEL }}
|
||
|
- name: WORMSCAN_RUNMODE
|
||
|
value: {{ .WORMSCAN_RUNMODE }}
|
||
|
- name: WORMSCAN_DB_URL
|
||
|
valueFrom:
|
||
|
secretKeyRef:
|
||
|
name: mongodb
|
||
|
key: mongo-uri
|
||
|
- name: WORMSCAN_DB_NAME
|
||
|
value: {{ .WORMSCAN_DB_NAME }}
|
||
|
resources:
|
||
|
limits:
|
||
|
memory: {{ .RESOURCES_LIMITS_MEMORY }}
|
||
|
cpu: {{ .RESOURCES_LIMITS_CPU }}
|
||
|
requests:
|
||
|
memory: {{ .RESOURCES_REQUESTS_MEMORY }}
|
||
|
cpu: {{ .RESOURCES_REQUESTS_CPU }}
|