feat(halo): 增加halo配置 & 优化apps结构

这个提交包含在:
2024-08-14 14:11:36 +08:00 未验证
父节点 d997bb2e56
当前提交 87793b89ac
修改 35 个文件,包含 105 行新增9 行删除
@@ -0,0 +1,27 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: gitea-custom-templates
namespace: infra-devops
data:
home.tmpl: |-
{{template "base/head" .}}
<div class="page-content home">
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<div>
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg"/>
</div>
<div class="hero">
<h1 class="ui icon header title">
{{AppName}}
</h1>
<h2><a href="https://git.dev.cm">dev.cm</a> - Git 仓库</h2>
</div>
</div>
</div>
</div>
{{template "base/footer" .}}
extra_links.tmpl: |-
<a class="item" href="https://ci.dev.cm" target="_blank">CI</a>
+102
查看文件
@@ -0,0 +1,102 @@
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: gitea
namespace: infra-devops
spec:
repo: https://dl.gitea.com/charts
chart: gitea
targetNamespace: infra-devops
version: 10.1.4
valuesContent: |-
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchLabels:
cnpg.io/cluster: cnpg-cluster-sh
role: primary
app.kubernetes.io/name: redis
app.kubernetes.io/component: master
topologyKey: kubernetes.io/hostname
namespaceSelector: {}
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- homea
redis-cluster:
enabled: false
postgresql-ha:
enabled: false
image:
tag: 1.22.0
ingress:
enabled: true
className: nginx
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
hosts:
- host: git.dev.cm
paths:
- path: /
pathType: Prefix
gitea:
config:
APP_NAME: Git.dev.cm
RUN_MODE: prod
server:
DOMAIN: git.dev.cm
ROOT_URL: https://git.dev.cm/
database:
DB_TYPE: postgres
HOST: cnpg-cluster-sh-rw.infra-data:5432
NAME: gitea
USER: app
PASSWD: 6UeWq0EEQaP47eMjAt3hmmquGY3e6bqDanCeSKWDmLtLCuMe1TH0UGTKuaw2LfIO
SSL_MODE: disable
session:
PROVIDER: redis
PROVIDER_CONFIG: redis://:[email protected]:6379/0
cache:
ADAPTER: redis
HOST: redis://:[email protected]:6379/0?pool_size=100&idle_timeout=180s
queue:
TYPE: redis
CONN_STR: redis://:[email protected]:6379/0
repository:
DEFAULT_REPO_UNITS: repo.code,repo.releases,repo.issues,repo.pulls
service:
DISABLE_REGISTRATION: true
NO_REPLY_ADDRESS: noreply.dev.cm
picture:
GRAVATAR_SOURCE: https://cravatar.cn/avatar/
i18n:
LANGS: zh-CN,en-US
NAMES: 简体中文,English
other:
SHOW_FOOTER_VERSION: false
log:
LEVEL: Info
extraVolumes:
- name: gitea-custom-templates-volume
configMap:
name: gitea-custom-templates
items:
- key: home.tmpl
path: home.tmpl
- key: extra_links.tmpl
path: custom/extra_links.tmpl
extraContainerVolumeMounts:
- name: gitea-custom-templates-volume
readOnly: true
mountPath: /data/gitea/templates
@@ -0,0 +1,30 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gitea-static
namespace: infra-devops
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/proxy-buffering: "on"
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_cache cache;
proxy_cache_valid 200 302 7d;
proxy_cache_valid 404 10m;
proxy_cache_valid any 1h;
proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504;
proxy_cache_bypass $http_x_purge;
proxy_ignore_headers Cache-Control;
add_header X-Cache-Status $upstream_cache_status;
spec:
ingressClassName: nginx
rules:
- host: git.dev.cm
http:
paths:
- path: /(.*\.(css|js|png|jpg|jpeg|gif|svg|webp|ico|woff|woff2|ttf|eot)|avatars/[^/]+)$
pathType: ImplementationSpecific
backend:
service:
name: gitea-http
port:
number: 3000
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: gitea-ssh-lb
namespace: infra-devops
spec:
selector:
app.kubernetes.io/name: gitea
app.kubernetes.io/instance: gitea
ports:
- protocol: TCP
port: 22
targetPort: 2222
type: LoadBalancer