14 Commits

Author SHA1 Message Date
1928fdad6e WIP: StatefulSet config for gitea-server
A deployment cannot actually attach the same persistent storage across
nodes. We have to switch to a StatefulSet for any and all programs that
need shared persistent storage.

I tried applying this config, but it didn't attach the same volume/disk
as before, so I had to revert to the Deployment for now.
2019-12-19 14:10:57 +01:00
2ab0db6c2a Merge branch 'chore/update_gitea' of kosmos/gitea.kosmos.org into master 2019-12-19 13:10:13 +00:00
d6d70af0ad Upgrade Gitea to 1.10.1 2019-12-19 14:09:35 +01:00
75881c4c3f Merge branch 'chore/update_gitea' of kosmos/gitea.kosmos.org into master 2019-11-24 12:17:10 +00:00
3cd4b3102c Update Gitea to 1.10.0 2019-11-24 13:13:12 +01:00
11ae884dea Merge branch 'chore/update_gitea' of kosmos/gitea.kosmos.org into master 2019-10-31 11:58:21 +00:00
6785287227 Update Gitea to 1.9.5 2019-10-31 12:57:25 +01:00
d4784e9787 Merge branch 'chore/update_gitea' of kosmos/gitea.kosmos.org into master 2019-10-13 11:45:42 +00:00
da278556ed Adapt CPU resource request and limit
After the new pod wasn't able to be scheduled due to insufficient CPU
resources, I checked the current usage and it was well below the
requested amount. Lowering request and limit fixed the deployment issue.
2019-10-13 13:42:34 +02:00
4dd0f4b844 Update Gitea to 1.9.4 2019-10-13 13:42:24 +02:00
b6894598a6 Update Gitea to 1.9.2 2019-08-31 12:01:16 +02:00
972bbedb87 Improve customizations documentation (#35) 2019-08-16 09:26:00 +00:00
db396d6ee1 Merge branch 'chore/update_gitea' of kosmos/gitea.kosmos.org into master 2019-08-15 15:33:48 +00:00
d821e02dec Update Gitea to 1.9.1 2019-08-15 17:32:38 +02:00
4 changed files with 127 additions and 21 deletions

View File

@@ -6,21 +6,4 @@ issues](https://gitea.kosmos.org/kosmos/gitea.kosmos.org/issues) for questions,
suggestions, bugs, to-do items, and whatever else you want to discuss or
resolve.
## Building & deploying
To create a new image containing the customizations:
Edit `packer/custom.json` to increment the tag, then run this script (needs
[Packer](https://www.packer.io/) in your path)
./script/build_customizations_image
Then edit `kubernetes/gitea-server.yaml` to use the new tag
(`image: eu.gcr.io/fluted-magpie-218106/gitea_custom:$VERSION`) and apply the
change:
cd kubernetes
kubectl apply -f gitea-server.yaml
See `doc/` folder for some technical info.

View File

@@ -0,0 +1,20 @@
## Customizations image
### Build
To create a new Docker image containing our Gitea customizations (label sets,
styles, page content, etc.):
Edit `packer/custom.json` to increment the tag, then run this script (needs
[Packer](https://www.packer.io/) in your path)
./script/build_customizations_image
### Deploy
Edit `kubernetes/gitea-server.yaml` to use the new tag
(`image: eu.gcr.io/fluted-magpie-218106/gitea_custom:$VERSION`) and apply the
change:
cd kubernetes
kubectl apply -f gitea-server.yaml

View File

@@ -0,0 +1,103 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: gitea-server
labels:
app: gitea
spec:
serviceName: gitea-server
updateStrategy:
type: RollingUpdate
replicas: 1
selector:
matchLabels:
app: gitea
template:
metadata:
labels:
name: gitea-server
app: gitea
spec:
initContainers:
- name: init-config
# This is a busybox image with our gitea customizations saved to
# /custom, built using ./script/build_customizations_image from the
# root of the repo
image: eu.gcr.io/fluted-magpie-218106/gitea_custom:0.1.2
command: [
'sh', '-c',
'mkdir -p /data/gitea/conf && mkdir -p /data/gitea/https && cp /root/conf/app.ini /data/gitea/conf/app.ini && chown 1000:1000 /data/gitea/conf/app.ini && chmod 660 /data/gitea/conf/app.ini && cp /root/conf/*.pem /data/gitea/https && chmod 600 /data/gitea/https/*.pem && cp -R /custom/* /data/gitea && chown -R 1000:1000 /data/gitea'
]
volumeMounts:
- mountPath: /data
name: gitea-server-data
- mountPath: /root/conf
name: config
containers:
- name: gitea-server
image: gitea/gitea:1.10.1
ports:
- containerPort: 3000
- containerPort: 3001
- containerPort: 22
volumeMounts:
- mountPath: /data
name: gitea-server-data
resources:
requests:
cpu: 150m
memory: 256Mi
limits:
cpu: 250m
memory: 512Mi
restartPolicy: Always
volumes:
- name: config
secret:
secretName: gitea-config
items:
- key: app.ini
path: app.ini
mode: 256
- key: cert.pem
path: cert.pem
mode: 256
- key: key.pem
path: key.pem
mode: 256
volumeClaimTemplates:
- metadata:
name: gitea-server-data
labels:
app: gitea
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: gcePersistentDisk
---
apiVersion: v1
kind: Service
metadata:
name: gitea-server
labels:
name: gitea-server
app: gitea
spec:
type: LoadBalancer
# preserves the client source IP
externalTrafficPolicy: Local
ports:
- name: "ssh"
port: 22
targetPort: 22
- name: "http"
port: 80
targetPort: 3001
- name: "https"
port: 443
targetPort: 3000
selector:
name: gitea-server

View File

@@ -32,7 +32,7 @@ spec:
name: config
containers:
- name: gitea-server
image: gitea/gitea:1.9.0
image: gitea/gitea:1.10.1
ports:
- containerPort: 3000
- containerPort: 3001
@@ -42,10 +42,10 @@ spec:
name: gitea-server-data
resources:
requests:
cpu: 250m
cpu: 150m
memory: 256Mi
limits:
cpu: 500m
cpu: 250m
memory: 512Mi
restartPolicy: Always
volumes: