This website works better with JavaScript.
Home
Explore
Help
Register
Sign In
creylopez
/
k8s-cluster-projects
Watch
1
Star
1
Fork
0
Code
Issues
1
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
Correccioes en Gogs para hacerlo persistente
main
Celestino Rey
2 years ago
parent
0306850fac
commit
d6adeeba2b
8 changed files
with
110 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-0
Gogs/creaTodo.sh
+1
-0
Gogs/entra.sh
+69
-0
Gogs/gogs-deployment.yaml
+11
-0
Gogs/gogs-statefulset.yaml
+1
-0
Gogs/paraTodo.sh
+11
-0
Gogs/pv-local-gogs.yaml
+2
-2
Gogs/pv-local-mysql-gogs.yaml
+14
-0
Gogs/pvc-gogs.yaml
+ 1
- 0
Gogs/creaTodo.sh
View File
@ -1,4 +1,5 @@
kubectl create namespace gogs
kubectl create -f pv-local-mysql-gogs.yaml
kubectl create -f pv-local-gogs.yaml
kubectl create -k ./
watch kubectl get all -n gogs
+ 1
- 0
Gogs/entra.sh
View File
@ -0,0 +1 @@
kubectl
exec
-ti deployment.apps/gogs -n gogs -- /bin/bash
+ 69
- 0
Gogs/gogs-deployment.yaml
View File
@ -0,0 +1,69 @@
apiVersion
:
v1
kind
:
PersistentVolumeClaim
metadata:
name
:
gogs-pv-claim
namespace
:
gogs
labels:
app
:
gogs-app
spec:
accessModes:
-
ReadWriteOnce
storageClassName
:
""
resources:
requests:
storage
:
10Gi
---
apiVersion
:
apps/v1
kind
:
Deployment
metadata:
name
:
gogs
namespace
:
gogs
labels:
app
:
gogs-app
spec:
selector:
matchLabels:
app
:
gogs-app
tier
:
frontend
strategy:
type
:
Recreate
template:
metadata:
labels:
app
:
gogs-app
tier
:
frontend
spec:
containers:
-
image
:
gogs/gogs:latest
name
:
gogs
env:
-
name
:
DB_TYPE
value
:
mysql
-
name
:
DB_NAME
value
:
gogs
-
name
:
DB_HOST
value
:
gogs-mysql
-
name
:
DB_PASS
valueFrom:
secretKeyRef:
name
:
mysqlgogs-pass
key
:
password
-
name
:
DB_USER
valueFrom:
secretKeyRef:
name
:
mysqlgogs-pass
key
:
db_user
ports:
-
containerPort
:
3000
name
:
http
protocol
:
TCP
-
containerPort
:
22
name
:
ssh
protocol
:
TCP
volumeMounts:
-
name
:
gogs-persistent-storage
mountPath
:
/data
volumes:
-
name
:
gogs-persistent-storage
persistentVolumeClaim:
claimName
:
gogs-pv-claim
+ 11
- 0
Gogs/gogs-statefulset.yaml
View File
@ -28,6 +28,17 @@ spec:
-
containerPort
:
22
name
:
ssh
protocol
:
TCP
volumeMounts:
-
name
:
gogs-pv
mountPath
:
/data
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
terminationGracePeriodSeconds
:
30
volumeClaimTemplates:
-
metadata:
name
:
gogs-pv
spec:
accessModes
:
[
"ReadWriteOnce"
]
resources:
requests:
storage
:
10Gi
+ 1
- 0
Gogs/paraTodo.sh
View File
@ -1,3 +1,4 @@
kubectl delete -k ./
kubectl delete -f pv-local-mysql-gogs.yaml
kubectl delete -f pv-local-gogs.yaml
kubectl delete namespace gogs
+ 11
- 0
Gogs/pv-local-gogs.yaml
View File
@ -0,0 +1,11 @@
apiVersion
:
v1
kind
:
PersistentVolume
metadata:
name
:
gogs-data
spec:
capacity:
storage
:
10Gi
accessModes:
-
ReadWriteOnce
hostPath:
path
:
"/mnt/cluster/gogs/gogs_data"
+ 2
- 2
Gogs/pv-local-mysql-gogs.yaml
View File
@ -1,11 +1,11 @@
apiVersion
:
v1
kind
:
PersistentVolume
metadata:
name
:
gogs-d
ata
name
:
gogs-d
b
spec:
capacity:
storage
:
20Gi
accessModes:
-
ReadWriteOnce
hostPath:
path
:
"/mnt/cluster/gogs"
path
:
"/mnt/cluster/gogs
/gogs_db
"
+ 14
- 0
Gogs/pvc-gogs.yaml
View File
@ -0,0 +1,14 @@
apiVersion
:
v1
kind
:
PersistentVolumeClaim
metadata:
name
:
gogs-pv-claim
namespace
:
gogs
labels:
app
:
gogs-app
spec:
accessModes:
-
ReadWriteOnce
storageClassName
:
""
resources:
requests:
storage
:
10Gi
Write
Preview
Loading…
Cancel
Save