gitea service deployment
This commit is contained in:
@@ -39,4 +39,10 @@ apps:
|
||||
state: present
|
||||
namespace: stashapp
|
||||
mariadb:
|
||||
enabled: false
|
||||
namespace: mariadb
|
||||
gitea:
|
||||
enabled: true
|
||||
namespace: gitea
|
||||
state: present
|
||||
|
||||
|
||||
30
ansible-5/roles/prod.k3s/files/gitea/values.yaml
Normal file
30
ansible-5/roles/prod.k3s/files/gitea/values.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
# values file for gitea helm chart
|
||||
replicaCount: 1
|
||||
ingress:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: git.xai-corp.net
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
persistence:
|
||||
enabled: true
|
||||
|
||||
postgresql:
|
||||
enabled: false
|
||||
|
||||
gitea:
|
||||
config:
|
||||
APP_NAME: "Gitea: With a cup of tea, for 2."
|
||||
server:
|
||||
ROOT_URL: https://git.xai-corp.net
|
||||
database:
|
||||
HOST: mysql:3306
|
||||
PATH: /data/gitea/gitea.db
|
||||
DB_TYPE: sqlite3
|
||||
USER: rmorgan
|
||||
PASSWD: rom105
|
||||
SSL_MODE: disable
|
||||
repository:
|
||||
ROOT: /data/git/repositories
|
||||
47
ansible-5/roles/prod.k3s/tasks/deployments/gitea.yaml
Normal file
47
ansible-5/roles/prod.k3s/tasks/deployments/gitea.yaml
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
#deployment tasks for gitea
|
||||
|
||||
- name: Create a namespace for gitea
|
||||
k8s:
|
||||
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
|
||||
name: "{{apps.gitea.namespace}}"
|
||||
api_version: v1
|
||||
kind: Namespace
|
||||
state: "{{apps.gitea.state}}"
|
||||
become: true
|
||||
|
||||
- name: create persistent volume resources
|
||||
kubernetes.core.k8s:
|
||||
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
|
||||
state: "{{apps.gitea.state}}"
|
||||
definition: "{{ lookup('template', item) | from_yaml }}"
|
||||
loop:
|
||||
- gitea/pv.yaml
|
||||
- gitea/pv-claim.yaml
|
||||
become: true
|
||||
|
||||
|
||||
- name: Install gitea globally available
|
||||
block:
|
||||
- name: Add gitea chart helm repo
|
||||
local_action:
|
||||
module: kubernetes.core.helm_repository
|
||||
name: gitea-charts
|
||||
repo_url: https://dl.gitea.io/charts/
|
||||
|
||||
- name: load variables files/gitea/values.yaml
|
||||
ansible.builtin.include_vars:
|
||||
file: files/gitea/values.yaml
|
||||
name: release_values
|
||||
|
||||
- name: Install gitea Release
|
||||
local_action:
|
||||
module: kubernetes.core.helm
|
||||
release_state: "{{apps.gitea.state}}"
|
||||
name: gitea
|
||||
namespace: "{{apps.gitea.namespace}}"
|
||||
create_namespace: yes
|
||||
update_repo_cache: True
|
||||
chart_ref: gitea-charts/gitea
|
||||
values: "{{release_values}}"
|
||||
wait: true
|
||||
@@ -19,6 +19,9 @@
|
||||
#- name: deploy mariadb
|
||||
# include_tasks: deployments/mariadb.yaml
|
||||
|
||||
- name: deploy gitea
|
||||
include_tasks: deployments/gitea.yaml
|
||||
when: apps.gitea.enabled
|
||||
|
||||
#-----------------------------------------------------
|
||||
#- include_tasks: mariadb.yaml
|
||||
|
||||
13
ansible-5/roles/prod.k3s/templates/gitea/pv-claim.yaml
Normal file
13
ansible-5/roles/prod.k3s/templates/gitea/pv-claim.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: data-gitea-0
|
||||
namespace: "{{apps.gitea.namespace}}"
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
17
ansible-5/roles/prod.k3s/templates/gitea/pv.yaml
Normal file
17
ansible-5/roles/prod.k3s/templates/gitea/pv.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# persistent volume
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: gitea-pv-local
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 100Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/data/gitea"
|
||||
|
||||
Reference in New Issue
Block a user