Browse Source

Enable two replicas for the website to make it possible to do rolling upgrades.

Add PersistentVolume example and update .gitignore for data directory.
master
Ray Burgemeestre 6 years ago
parent
commit
f46a9ef67f
3 changed files with 37 additions and 1 deletions
  1. +1
    -0
      .gitignore
  2. +15
    -0
      kube/cheerp_data.yaml
  3. +21
    -1
      kube/cheerpweb.yaml

+ 1
- 0
.gitignore View File

dist/*.worker.js dist/*.worker.js
dist/css/* dist/css/*
docker_web/dist/ docker_web/dist/
data/

+ 15
- 0
kube/cheerp_data.yaml View File

kind: PersistentVolume
apiVersion: v1
metadata:
name: kube-cheerp-volume
labels:
type: local
spec:
storageClassName: cheerp-storage
capacity:
storage: 200Gi
accessModes:
- ReadWriteMany
hostPath:
path: /home/kube/cheerpweb/data/


+ 21
- 1
kube/cheerpweb.yaml View File

metadata: metadata:
name: cheerpweb name: cheerpweb
spec: spec:
replicas: 1
replicas: 2
revisionHistoryLimit: 2 revisionHistoryLimit: 2
template: template:
metadata: metadata:
ports: ports:
- containerPort: 5000 - containerPort: 5000
name: http name: http
volumeMounts:
- mountPath: "/data"
name: cheerpstorage
volumes:
- name: cheerpstorage
persistentVolumeClaim:
claimName: cheerp-api-claim
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
selector: selector:
app: cheerpapiapp app: cheerpapiapp
tier: cheerpapi tier: cheerpapi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: cheerp-api-claim
spec:
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 200Gi
storageClassName: cheerp-storage

Loading…
Cancel
Save