Factor out storage creation

This commit is contained in:
Jim Nicholson 2021-10-30 13:14:24 -07:00
parent b930129093
commit 2223590d72
6 changed files with 86 additions and 82 deletions

22
gitea-pv.yaml Normal file
View File

@ -0,0 +1,22 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: gitea-pv
namespace: gitea
labels:
app: gitea
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
mountOptions:
- nolock
nfs:
server: 10.0.96.2
path: "/volume1/storage/git-repo"
claimRef:
namespace: gitea
name: gitea-pvc

14
gitea-pvc.yaml Normal file
View File

@ -0,0 +1,14 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-pvc
namespace: gitea
labels:
app: gitea
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi

View File

@ -1,18 +1,22 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: gitea
# secretGenerator:
# - literals:
# - pg_password=some1pass5here9
# name: gitea-secrets
# generatorOptions:
# disableNameSuffixHash: true
# labels:
# type: generated
secretGenerator:
- literals:
- pg_username=postgres
- pg_password=some1pass5here9
name: gitea-secrets
generatorOptions:
disableNameSuffixHash: true
labels:
type: generated
resources:
- namespace.yaml
- secrets.yaml
- storage.yaml
# - secrets.yaml
- postgres-pv.yaml
- postgres-pvc.yaml
- gitea-pv.yaml
- gitea-pvc.yaml
- configuration.yaml
- postgres-deployment.yaml
- postgres-service.yaml

22
postgres-pv.yaml Normal file
View File

@ -0,0 +1,22 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv
namespace: gitea
labels:
app: gitea
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
mountOptions:
- nolock
nfs:
server: 10.0.96.2
path: "/volume1/storage/git-database"
claimRef:
namespace: gitea
name: postgres-pvc

14
postgres-pvc.yaml Normal file
View File

@ -0,0 +1,14 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: gitea
labels:
app: gitea
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi

View File

@ -1,72 +0,0 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv
namespace: gitea
labels:
app: gitea
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
mountOptions:
- nolock
nfs:
server: 10.0.96.2
path: "/volume1/storage/git-database"
claimRef:
namespace: gitea
name: postgres-pvc
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: gitea-pv
namespace: gitea
labels:
app: gitea
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
mountOptions:
- nolock
nfs:
server: 10.0.96.2
path: "/volume1/storage/git-repo"
claimRef:
namespace: gitea
name: gitea-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: gitea
labels:
app: gitea
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-pvc
namespace: gitea
labels:
app: gitea
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi