Added NFS support for easier blue/green deployments

This commit is contained in:
kiloreux 2018-01-11 11:08:20 +01:00
parent baceec15ed
commit 6795bd7669
2 changed files with 23 additions and 8 deletions

View File

@ -1,15 +1,30 @@
apiVersion: v1
kind: PersistentVolumeClaim
kind: PersistentVolume
metadata:
name: tusd
namespace: tus
name: nfs-tusd
namespace: tusd
spec:
capacity:
storage: 50Gi
accessModes:
- ReadWriteMany
nfs:
server: NFS_SERVER_IP
path: "/tusd"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nfs-tusd
namespace: tusd
spec:
accessModes:
- ReadWriteOnce
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 50Gi
storageClassName: standard
---
apiVersion: extensions/v1beta1
kind: Deployment
@ -22,7 +37,7 @@ spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxSurge: 2
maxUnavailable: 0
template:
metadata:
@ -52,7 +67,7 @@ spec:
volumes:
- name: tusd-disk
persistentVolumeClaim:
claimName: tusd
claimName: nfs-tusd
---
apiVersion: v1
kind: Service

View File

@ -30,7 +30,7 @@ kubectl config set-credentials travis --token=$SA_TOKEN
kubectl config set-context travis --cluster=$CLUSTER_NAME --user=travis --namespace=tus
kubectl config use-context travis
sed -i 's#NFS_SERVER_IP#${NFS_SERVER_IP}#' ./.infra/kube/*.yaml
kubectl apply --validate=false -f "${__root}/.infra/kube/tusd-kube.yaml"