Compare commits
No commits in common. "f8346fbe7bb142f113127e1159998cc2ace6ef51" and "fc49a6f412afadea311b0e6bafc8ec1967b16c2a" have entirely different histories.
f8346fbe7b
...
fc49a6f412
44
README.md
44
README.md
@ -3,47 +3,3 @@
|
|||||||
Front end for Git, with integrated Container Registry and CI/CD capabilities.
|
Front end for Git, with integrated Container Registry and CI/CD capabilities.
|
||||||
This repository only contains configuration used for Kubernetes.
|
This repository only contains configuration used for Kubernetes.
|
||||||
|
|
||||||
## From Docker to Gitea
|
|
||||||
|
|
||||||
Get a dump of your current Docker instance:
|
|
||||||
```bash
|
|
||||||
gitea dump -c /data/gitea/conf/app.ini
|
|
||||||
```
|
|
||||||
In this context, my `/data` path is mounted to the host.
|
|
||||||
|
|
||||||
Then modify the `deployment.yaml` file to only start a "sleeping" container:
|
|
||||||
```yaml
|
|
||||||
[...]
|
|
||||||
image: gitea/gitea:1.22.3
|
|
||||||
ports:
|
|
||||||
- containerPort: 3000
|
|
||||||
command: ["/bin/sh", "-c", "sleep 1000000000"] # Add this line
|
|
||||||
env:
|
|
||||||
- name: GITEA__database__DB_TYPE
|
|
||||||
value: "postgres"
|
|
||||||
[...]
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, copy the dump to the container:
|
|
||||||
```bash
|
|
||||||
kubectl cp <dump file> <namespace>/<pod name>:/data/dump
|
|
||||||
```
|
|
||||||
|
|
||||||
Get into the pod and go as follows.
|
|
||||||
|
|
||||||
Unzip the dump
|
|
||||||
```bash
|
|
||||||
unzip <dump file>
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, restore the dump
|
|
||||||
```bash
|
|
||||||
mv repo/* /data/git/repositories
|
|
||||||
mv lfs/* /data/git/lfs
|
|
||||||
mv data/* /data/gitea
|
|
||||||
```
|
|
||||||
|
|
||||||
And finally, restore the database
|
|
||||||
```bash
|
|
||||||
PGPASSWORD=$GITEA__database_PASSWD psql -h $GITEA__database_HOST -U $GITEA__database_USER < gitea-db.sql
|
|
||||||
```
|
|
||||||
|
@ -4,15 +4,13 @@ metadata:
|
|||||||
name: gitea-config
|
name: gitea-config
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
data:
|
data:
|
||||||
APP_NAME: Halis hosted git solution
|
APP_NAME: Halia hosted git solution
|
||||||
RUN_MODE: prod
|
RUN_MODE: prod
|
||||||
GITEA__server__DISABLE_SSH: "true"
|
GITEA__server__DISABLE_SSH: "true"
|
||||||
GITEA__server__ROOT_URL: "https://git.halis.io"
|
GITEA__server__ROOT_URL: "https://git.beta.halia.dev"
|
||||||
GITEA__security__INSTALL_LOCK: "true"
|
GITEA__security__INSTALL_LOCK: "true"
|
||||||
GITEA__service__DISABLE_REGISTRATION: "true"
|
GITEA__service__DISABLE_REGISTRATION: "true"
|
||||||
GITEA__metrics__ENABLED: "true"
|
GITEA__metrics__ENABLED: "true"
|
||||||
GITEA__queue__TYPE: "level"
|
|
||||||
#GITEA__indexer__REPO_INDEXER_ENABLED: "false"
|
|
||||||
#app.ini: |
|
#app.ini: |
|
||||||
# APP_NAME = K8s implementation
|
# APP_NAME = K8s implementation
|
||||||
# RUN_MODE = prod
|
# RUN_MODE = prod
|
||||||
|
@ -9,7 +9,7 @@ spec:
|
|||||||
|
|
||||||
storage:
|
storage:
|
||||||
size: 1Gi
|
size: 1Gi
|
||||||
storageClass: redundant-storage-class
|
storageClass: flat-storage-class
|
||||||
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
initdb:
|
initdb:
|
||||||
|
@ -4,7 +4,7 @@ metadata:
|
|||||||
name: gitea
|
name: gitea
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 2
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: gitea
|
app: gitea
|
||||||
@ -17,9 +17,13 @@ spec:
|
|||||||
subdomain: gitea
|
subdomain: gitea
|
||||||
containers:
|
containers:
|
||||||
- name: gitea
|
- name: gitea
|
||||||
image: gitea/gitea:1.22.3
|
image: gitea/gitea:1.19.3
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
|
lifecycle:
|
||||||
|
postStart:
|
||||||
|
exec:
|
||||||
|
command: ["sh", "-c", "sleep 1 && su git -c 'sh /admin-creator.sh'"]
|
||||||
env:
|
env:
|
||||||
- name: GITEA__database__DB_TYPE
|
- name: GITEA__database__DB_TYPE
|
||||||
value: "postgres"
|
value: "postgres"
|
||||||
|
@ -20,12 +20,10 @@ spec:
|
|||||||
entryPoints:
|
entryPoints:
|
||||||
- websecure
|
- websecure
|
||||||
routes:
|
routes:
|
||||||
- match: Host(`git.halis.io`) && PathPrefix(`/`)
|
- match: Host(`git.beta.halia.dev`) && PathPrefix(`/`)
|
||||||
kind: Rule
|
kind: Rule
|
||||||
middlewares:
|
middlewares:
|
||||||
- name: replace-regex
|
- name: replace-regex
|
||||||
services:
|
services:
|
||||||
- name: gitea-svc
|
- name: gitea-svc
|
||||||
port: 80
|
port: 80
|
||||||
tls:
|
|
||||||
certResolver: letsencrypt
|
|
||||||
|
@ -5,8 +5,8 @@ metadata:
|
|||||||
namespace: gitea
|
namespace: gitea
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 15Gi
|
storage: 5Gi
|
||||||
storageClassName: redundant-storage-class
|
storageClassName: flat-storage-class
|
||||||
|
@ -8,8 +8,8 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://git.halia.dev/athens-school/k3s-secrets.git
|
repoURL: https://git.halis.io/athens-school/k3s-secrets.git
|
||||||
targetRevision: prod-migration
|
targetRevision: dev
|
||||||
path: gitea
|
path: gitea
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
automated:
|
automated:
|
||||||
|
Loading…
Reference in New Issue
Block a user