111 lines
2.9 KiB
YAML
111 lines
2.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: xlog
|
|
namespace: crossbell
|
|
spec:
|
|
replicas: 1
|
|
serviceName: "xlog-lb"
|
|
selector:
|
|
matchLabels:
|
|
app: xlog
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: xlog
|
|
annotations:
|
|
prometheus.io/path: /metrics
|
|
prometheus.io/port: "8080"
|
|
prometheus.io/scrape: "true"
|
|
spec:
|
|
enableServiceLinks: false
|
|
initContainers:
|
|
- image: $IMAGE_TAG_RELEASE
|
|
envFrom:
|
|
- secretRef:
|
|
name: xlog
|
|
imagePullPolicy: Always
|
|
name: xlog-init
|
|
command: ["/bin/sh", "-c"]
|
|
args: ["npm install -g prisma; npm run prisma:migrate:deploy"]
|
|
containers:
|
|
- image: $IMAGE_TAG_RELEASE
|
|
imagePullPolicy: Always
|
|
name: xlog
|
|
envFrom:
|
|
- secretRef:
|
|
name: xlog
|
|
ports:
|
|
- containerPort: 3000
|
|
protocol: TCP
|
|
resources:
|
|
requests:
|
|
memory: "400Mi"
|
|
cpu: "150m"
|
|
limits:
|
|
memory: "1000Mi"
|
|
cpu: "500m"
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 3000
|
|
initialDelaySeconds: 40
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 3000
|
|
initialDelaySeconds: 40
|
|
periodSeconds: 20
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: "/app/.next/cache/images"
|
|
subPath: images
|
|
- name: caddy
|
|
image: kindjeff/caddy-tlsredis-docker
|
|
imagePullPolicy: Always
|
|
command: ["caddy", "run", "-config", "/app/Caddyfile"]
|
|
envFrom:
|
|
- secretRef:
|
|
name: xlog-caddy
|
|
ports:
|
|
- containerPort: 80
|
|
name: http
|
|
- containerPort: 443
|
|
name: https
|
|
volumeMounts:
|
|
- name: caddyfile
|
|
mountPath: /app
|
|
- name: caddy-validator
|
|
image: python
|
|
command: ["/bin/sh", "-c"]
|
|
args: ["pip install flask requests; flask --app=app run"]
|
|
ports:
|
|
- containerPort: 5000
|
|
name: http
|
|
volumeMounts:
|
|
- name: validator
|
|
mountPath: /app.py
|
|
subPath: app.py
|
|
dnsPolicy: ClusterFirst
|
|
restartPolicy: Always
|
|
schedulerName: default-scheduler
|
|
securityContext: {}
|
|
terminationGracePeriodSeconds: 30
|
|
volumes:
|
|
- name: caddyfile
|
|
configMap:
|
|
name: xlog-caddy
|
|
- name: validator
|
|
configMap:
|
|
name: xlog-caddy-validator
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
spec:
|
|
accessModes: ["ReadWriteOnce"]
|
|
storageClassName: "alicloud-disk-ssd"
|
|
resources:
|
|
requests:
|
|
storage: 20Gi
|