Update k8s deployment example

Update k8s deployment example

* remove unused gem-caches
* update entrypoints to correspond 0.22.x
* add liveness probe
This commit is contained in:
Andrey Bondarenko 2025-01-12 12:31:49 +01:00
parent c23c8d5b13
commit e59f7631b9
No known key found for this signature in database
GPG key ID: 7D3F42F6E565F1CD

View file

@ -36,37 +36,7 @@ spec:
storageClassName: longhorn storageClassName: longhorn
resources: resources:
requests: requests:
storage: 15Gi storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: dawarich
name: gem-cache
labels:
storage.k8s.io/name: longhorn
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 15Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: dawarich
name: gem-sidekiq
labels:
storage.k8s.io/name: longhorn
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 15Gi
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
@ -81,7 +51,7 @@ spec:
storageClassName: longhorn storageClassName: longhorn
resources: resources:
requests: requests:
storage: 15Gi storage: 1Gi
``` ```
### Deployment ### Deployment
@ -143,14 +113,12 @@ spec:
image: freikin/dawarich:0.16.4 image: freikin/dawarich:0.16.4
imagePullPolicy: Always imagePullPolicy: Always
volumeMounts: volumeMounts:
- mountPath: /usr/local/bundle/gems
name: gem-app
- mountPath: /var/app/public - mountPath: /var/app/public
name: public name: public
- mountPath: /var/app/tmp/imports/watched - mountPath: /var/app/tmp/imports/watched
name: watched name: watched
command: command:
- "dev-entrypoint.sh" - "web-entrypoint.sh"
args: args:
- "bin/rails server -p 3000 -b ::" - "bin/rails server -p 3000 -b ::"
resources: resources:
@ -199,16 +167,14 @@ spec:
image: freikin/dawarich:0.16.4 image: freikin/dawarich:0.16.4
imagePullPolicy: Always imagePullPolicy: Always
volumeMounts: volumeMounts:
- mountPath: /usr/local/bundle/gems
name: gem-sidekiq
- mountPath: /var/app/public - mountPath: /var/app/public
name: public name: public
- mountPath: /var/app/tmp/imports/watched - mountPath: /var/app/tmp/imports/watched
name: watched name: watched
command: command:
- "dev-entrypoint.sh" - "sidekiq-entrypoint.sh"
args: args:
- "sidekiq" - "bundle exec sidekiq"
resources: resources:
requests: requests:
memory: "1Gi" memory: "1Gi"
@ -216,6 +182,22 @@ spec:
limits: limits:
memory: "3Gi" memory: "3Gi"
cpu: "1500m" cpu: "1500m"
livenessProbe:
httpGet:
path: /api/v1/health
port: 3000
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
volumes: volumes:
- name: gem-cache - name: gem-cache
persistentVolumeClaim: persistentVolumeClaim: