Compare commits
4 Commits
bbfa3f2964
...
drone-ci
| Author | SHA1 | Date | |
|---|---|---|---|
| 122cb1232c | |||
| 69f62182a1 | |||
| 08cd2ad211 | |||
| 30c3f47afd |
@@ -3,12 +3,6 @@
|
||||
This repository contains configuration files and other assets, that are used to
|
||||
deploy and operate this Gitea instance.
|
||||
|
||||
To upload the customization files to the running pod:
|
||||
|
||||
```
|
||||
./script/copy_customization
|
||||
```
|
||||
|
||||
Feel free to [open issues] for questions, suggestions, bugs, to-do items, and
|
||||
whatever else you want to discuss or resolve.
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#db231d bug ; Something is not working
|
||||
#76db1d enhancement ; Improving existing functionality
|
||||
#1d76db feature ; New functionality
|
||||
#db1d76 idea ; Something to consider
|
||||
#db1d76 question ; Looking for an answer
|
||||
#fbca04 security ; All your base are belong to us
|
||||
#1dd5db ui/ux ; User interface, process design, etc.
|
||||
#333333 dev environment ; Config, builds, CI, deployment, etc.
|
||||
#cccccc duplicate ; This issue or pull request already exists
|
||||
#cccccc invalid ; Not a bug
|
||||
#cccccc wontfix ; This won't be fixed
|
||||
@@ -1,14 +0,0 @@
|
||||
#db231d bug ; Something is not working
|
||||
#76db1d enhancement ; Improving existing functionality
|
||||
#1d76db feature ; New functionality
|
||||
#db1d76 idea ; Something to consider
|
||||
#db1d76 question ; Looking for an answer
|
||||
#fbca04 security ; All your base are belong to us
|
||||
#1dd5db ui/ux ; User interface, process design, etc.
|
||||
#333333 dev environment ; Config, builds, CI, deployment, etc.
|
||||
#008080 kredits-1 ; Small contribution
|
||||
#008080 kredits-2 ; Medium contribution
|
||||
#008080 kredits-3 ; Large contribution
|
||||
#cccccc duplicate ; This issue or pull request already exists
|
||||
#cccccc invalid ; Not a bug
|
||||
#cccccc wontfix ; This won't be fixed
|
||||
12
kubernetes/drone-rbac.yaml
Normal file
12
kubernetes/drone-rbac.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: kosmos-drone-rbac
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: kosmos
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
91
kubernetes/drone-server.yaml
Normal file
91
kubernetes/drone-server.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kosmos-drone-server
|
||||
namespace: kosmos
|
||||
labels:
|
||||
app: kosmos-drone
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: kosmos-drone-server
|
||||
app: kosmos-drone
|
||||
spec:
|
||||
containers:
|
||||
- name: kosmos-drone-server
|
||||
image: drone/drone:latest
|
||||
imagePullPolicy: Always
|
||||
env:
|
||||
- name: DRONE_KUBERNETES_ENABLED
|
||||
value: "true"
|
||||
- name: DRONE_KUBERNETES_NAMESPACE
|
||||
value: kosmos
|
||||
- name: DRONE_GITEA_SERVER
|
||||
value: https://gitea.kosmos.org
|
||||
- name: DRONE_RPC_SECRET
|
||||
value: 0500c55b6ae97a7f1e7c207477698b6d
|
||||
- name: DRONE_SERVER_HOST
|
||||
value: drone.kosmos.org
|
||||
- name: DRONE_SERVER_PROTO
|
||||
value: https
|
||||
- name: DRONE_TLS_AUTOCERT
|
||||
value: "true"
|
||||
- name: DRONE_ADMIN
|
||||
value: raucao,gregkare,galfert
|
||||
- name: DRONE_LOGS_DEBUG
|
||||
value: "true"
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/drone
|
||||
name: kosmos-drone-data
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- containerPort: 443
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 50Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
volumes:
|
||||
- name: kosmos-drone-data
|
||||
persistentVolumeClaim:
|
||||
claimName: kosmos-drone-data
|
||||
restartPolicy: Always
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: kosmos-drone-data
|
||||
namespace: kosmos
|
||||
labels:
|
||||
app: kosmos-drone
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 3000Mi
|
||||
status: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kosmos-drone-server
|
||||
namespace: kosmos
|
||||
labels:
|
||||
name: kosmos-drone-server
|
||||
app: kosmos-drone
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- name: "http"
|
||||
port: 80
|
||||
targetPort: 80
|
||||
- name: "https"
|
||||
port: 443
|
||||
targetPort: 443
|
||||
selector:
|
||||
name: kosmos-drone-server
|
||||
@@ -15,18 +15,18 @@ spec:
|
||||
initContainers:
|
||||
- name: init-config
|
||||
image: busybox
|
||||
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 && chown -R 1000:1000 /data/gitea'
|
||||
]
|
||||
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 && chown -R 1000:1000 /data/gitea']
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: gitea-server-data
|
||||
- mountPath: /root/conf
|
||||
name: config
|
||||
containers:
|
||||
# This is only used for the initial setup, it does nothing once a app.ini
|
||||
# file exists in the conf/ directory of the data directory
|
||||
# (/data/gitea/conf in our case)
|
||||
- name: gitea-server
|
||||
image: gitea/gitea:1.7.2
|
||||
image: gitea/gitea:1.7.1
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
- containerPort: 3001
|
||||
@@ -64,7 +64,7 @@ spec:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
storage: 1Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
6
kubernetes/kosmos-namespace.yaml
Normal file
6
kubernetes/kosmos-namespace.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: kosmos
|
||||
labels:
|
||||
app: kosmos
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for podname in $(kubectl get pods -l name=gitea-server -o json \
|
||||
| jq -r '.items[].metadata.name'); do
|
||||
for path in ./kubernetes/custom/*; do
|
||||
echo "Copying ${path}..."
|
||||
kubectl cp "${path}" "${podname}":"/data/gitea/"
|
||||
done
|
||||
# Fix permissions
|
||||
kubectl exec "${podname}" -- chown -R 1000:1000 /data/gitea/
|
||||
done
|
||||
Reference in New Issue
Block a user