apiVersion: apps/v1 kind: Deployment metadata: name: xlog namespace: crossbell spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 5 selector: matchLabels: app: xlog strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate 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 args: - "start" - "-i" - "1" - "ecosystem.config.js" envFrom: - secretRef: name: xlog ports: - containerPort: 3000 protocol: TCP resources: requests: memory: "1000Mi" cpu: "300m" limits: memory: "3000Mi" cpu: "2000m" terminationMessagePath: /dev/termination-log terminationMessagePolicy: File readinessProbe: httpGet: path: /api/healthcheck port: 3000 initialDelaySeconds: 40 periodSeconds: 20 livenessProbe: tcpSocket: port: 3000 initialDelaySeconds: 40 periodSeconds: 20 dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 --- apiVersion: apps/v1 kind: Deployment metadata: name: xlog-caddy namespace: crossbell spec: selector: matchLabels: app: xlog-caddy template: metadata: labels: app: xlog-caddy spec: containers: - name: caddy image: kindjeff/caddy-tlsredis-docker imagePullPolicy: Always command: ["caddy", "run", "-config", "/app/Caddyfile"] resources: requests: cpu: 50m memory: 64Mi limits: cpu: 100m memory: 128Mi 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"] resources: requests: cpu: 50m memory: 64Mi limits: cpu: 100m memory: 128Mi ports: - containerPort: 5000 name: http volumeMounts: - name: validator mountPath: /app.py subPath: app.py volumes: - name: caddyfile configMap: name: xlog-caddy - name: validator configMap: name: xlog-caddy-validator