From 3040d56070c479186d262b609e68ab0acecd3812 Mon Sep 17 00:00:00 2001 From: Mr lin <313478791@qq.com> Date: Wed, 17 Jan 2024 13:41:47 +0800 Subject: [PATCH] Create calibre.yaml --- template/calibre.yaml | 156 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 template/calibre.yaml diff --git a/template/calibre.yaml b/template/calibre.yaml new file mode 100644 index 00000000..2c9676ed --- /dev/null +++ b/template/calibre.yaml @@ -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 }}