Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add calibre.yaml #183

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions template/calibre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
apiVersion: app.sealos.io/v1
kind: Template
metadata:
name: ${{ defaults.app_name }}
spec:
title: 'Cailbre'
description: ' Calibre 是电子书管理软件,功能十分强大'
templateType: inline
defaults:
app_host:
type: string
value: ${{ random(8) }}
app_name:
type: string
value: cailbre-${{ random(8) }}
inputs:
user:
description: 'Set UserName default : admin'
type: string
default: admin
required: true
passowrd:
description: 'Set Password default : admin123'
type: string
default: admin123
required: true
volume_size:
description: 'save data size (Gi)'
type: string
default: '1'
required: false
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ${{ defaults.app_name }}
annotations:
originImageName: dmtc/calibre
deploy.cloud.sealos.io/minReplicas: '1'
deploy.cloud.sealos.io/maxReplicas: '1'
labels:
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
app: ${{ defaults.app_name }}
spec:
replicas: 1
revisionHistoryLimit: 1
minReadySeconds: 10
serviceName: ${{ defaults.app_name }}
selector:
matchLabels:
app: ${{ defaults.app_name }}
template:
metadata:
labels:
app: ${{ defaults.app_name }}
spec:
terminationGracePeriodSeconds: 10
containers:
- name: ${{ defaults.app_name }}
image: dmtc/calibre
env:
- name: QTWEBENGINE_CHROMIUM_FLAGS
value: '--no-sandbox'
- name: LANG
value: C.UTF-8
- name: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- name: WEBLANGUAGE
value: zh_CN
- name: USER
value: ${{ inputs.user }}
- name: PASSWORD
value: ${{ inputs.passowrd }}
resources:
requests:
cpu: 50m
memory: 51Mi
limits:
cpu: 500m
memory: 512Mi
ports:
- containerPort: 8083
imagePullPolicy: Always
volumeMounts:
- name: vn-appvn-data
mountPath: /library
volumes: []
volumeClaimTemplates:
- metadata:
annotations:
path: /library
value: '1'
name: vn-appvn-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: ${{ inputs.volume_size }}Gi

---
apiVersion: v1
kind: Service
metadata:
name: ${{ defaults.app_name }}
labels:
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
spec:
ports:
- port: 8083
selector:
app: ${{ defaults.app_name }}

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ${{ defaults.app_name }}
labels:
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
cloud.sealos.io/app-deploy-manager-domain: ${{ defaults.app_host }}
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: 32m
nginx.ingress.kubernetes.io/server-snippet: |
client_header_buffer_size 64k;
large_client_header_buffers 4 128k;
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
nginx.ingress.kubernetes.io/backend-protocol: HTTP
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/client-body-buffer-size: 64k
nginx.ingress.kubernetes.io/proxy-buffer-size: 64k
nginx.ingress.kubernetes.io/proxy-send-timeout: '300'
nginx.ingress.kubernetes.io/proxy-read-timeout: '300'

nginx.ingress.kubernetes.io/configuration-snippet: |
if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
expires 30d;
add_header Cache-Control "public";
}
spec:
rules:
- host: ${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}
http:
paths:
- pathType: Prefix
path: /()(.*)
backend:
service:
name: ${{ defaults.app_name }}
port:
number: 8083
tls:
- hosts:
- ${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}
secretName: ${{ SEALOS_Cert_Secret_Name }}