feat: add .gitignore and apps/template for new apps
This commit is contained in:
55
apps/template/manifests/app-deployment.yaml
Normal file
55
apps/template/manifests/app-deployment.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
# Deployment 範本
|
||||
# 使用方式:複製此檔案,將 {{APP_NAME}} 替換為你的應用名稱
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{APP_NAME}}
|
||||
namespace: default
|
||||
labels:
|
||||
app: {{APP_NAME}}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{APP_NAME}}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{APP_NAME}}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{APP_NAME}}
|
||||
image: {{IMAGE}}:{{TAG|latest}}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{PORT|8080}}
|
||||
# 資源限制(建議設定)
|
||||
resources:
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "250m"
|
||||
# 健康檢查(可選)
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
volumeMounts:
|
||||
- name: data-vol
|
||||
mountPath: {{DATA_MOUNT_PATH|/data}}
|
||||
volumes:
|
||||
- name: data-vol
|
||||
persistentVolumeClaim:
|
||||
claimName: {{APP_NAME}}-pvc
|
||||
24
apps/template/manifests/app-ingress.yaml
Normal file
24
apps/template/manifests/app-ingress.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# Ingress 範本 - Traefik
|
||||
# 使用方式:將 {{APP_NAME}}、{{HOST}} 替換為實際值
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{APP_NAME}}-ingress
|
||||
labels:
|
||||
app: {{APP_NAME}}
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: {{HOST}}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{APP_NAME}}-service
|
||||
port:
|
||||
number: {{PORT|8080}}
|
||||
16
apps/template/manifests/app-pvc.yaml
Normal file
16
apps/template/manifests/app-pvc.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
# PVC 範本 - Longhorn 儲存
|
||||
# 使用方式:將 {{APP_NAME}} 替換為你的應用名稱
|
||||
# 儲存大小可調整:1Gi, 5Gi, 10Gi...
|
||||
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{APP_NAME}}-pvc
|
||||
namespace: default
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: {{SIZE|5Gi}}
|
||||
18
apps/template/manifests/app-service.yaml
Normal file
18
apps/template/manifests/app-service.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
# Service 範本
|
||||
# 使用方式:將 {{APP_NAME}}、{{PORT}} 替換為實際值
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{APP_NAME}}-service
|
||||
namespace: default
|
||||
labels:
|
||||
app: {{APP_NAME}}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: {{APP_NAME}}
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: {{PORT|8080}
|
||||
Reference in New Issue
Block a user