diff --git a/.infra/kube/nfs.yaml b/.infra/kube/nfs.yaml new file mode 100644 index 0000000..68a4fae --- /dev/null +++ b/.infra/kube/nfs.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nfs-tusd + namespace: tus +spec: + capacity: + storage: 20Gi + accessModes: + - ReadWriteMany + nfs: + # FIXME: use the right IP + server: NFS_SERVER_IP + path: "/" diff --git a/.infra/kube/tusd-kube.yaml b/.infra/kube/tusd-kube.yaml index 63a8e15..22ae98d 100644 --- a/.infra/kube/tusd-kube.yaml +++ b/.infra/kube/tusd-kube.yaml @@ -1,17 +1,3 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: nfs-tusd - namespace: tus -spec: - capacity: - storage: 50Gi - accessModes: - - ReadWriteMany - nfs: - server: NFS_SERVER_IP - path: "/tusd" ---- kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -23,7 +9,7 @@ spec: storageClassName: "" resources: requests: - storage: 50Gi + storage: 20Gi --- apiVersion: extensions/v1beta1 kind: Deployment @@ -58,8 +44,8 @@ spec: ports: - containerPort: 8080 securityContext: - runAsUser: 1000 - fsGroup: 1000 + runAsUser: 0 + fsGroup: 0 volumeMounts: - name: tusd-disk mountPath: /srv/tusd-data diff --git a/.scripts/deploy_gcloud.sh b/.scripts/deploy_gcloud.sh index 55147cb..0316ede 100755 --- a/.scripts/deploy_gcloud.sh +++ b/.scripts/deploy_gcloud.sh @@ -30,7 +30,9 @@ 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 +sed -i "s#NFS_SERVER_IP#${NFS_SERVER_IP}#" ./.infra/kube/nfs.yaml +kubectl apply -f "${__root}/.infra/kube/nfs.yaml" +sleep 10s # This cost me some precious debugging time. kubectl apply --validate=false -f "${__root}/.infra/kube/tusd-kube.yaml"