diff --git a/home-k8s/influxdb-pv.yml b/home-k8s/influxdb-pv.yml new file mode 100644 index 0000000..d155a6a --- /dev/null +++ b/home-k8s/influxdb-pv.yml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: influxdb-pv + labels: + type: local +spec: + storageClassName: manual + persistentVolumeReclaimPolicy: Recycle + capacity: + storage: 20Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/mnt/influxdb" + +--- + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: influxdb-pvc +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 20Gi diff --git a/home-k8s/influxdb.yml b/home-k8s/influxdb.yml new file mode 100644 index 0000000..8e4bd9e --- /dev/null +++ b/home-k8s/influxdb.yml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deoyment +metadata: + name: influxdb +spec: + selector: + matchLabels: + app: influxdb + replicas: 1 + template: + metadata: + labels: + app: influxdb + spec: + volumes: + - name: data + hostPath: + path: /mnt/influxdb + type: Directory + containers: + - name: influxdb + image: influxdb:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8086 + name: influxdb-port + protocol: TCP + env: + - name: INFLUXDB_DB + value: home + - name: INFLUXDB_DATA_ENGINE + value: tsm1 + - name: INFLUXDB_REPORTING_DISABLED + value: "false" + - name: INFLUXDB_ADMIN_USER + value: junv + - name: INFLUXDB_ADMIN_PASSWORD + value: "Lovewifi2020!" + - name: INFLUXDB_HTTP_AUTH_ENABLED + value: "true" + volumeMounts: + - name: data + mountPath: /var/lib/influxdb + resources: + requests: + cpu: 500m + memory: 1024Mi + limits: + cpu: 800m + memory: 1524Mi +--- + +apiVersion: v1 +kind: Service +metadata: + name: influxdb + labels: + app: influxdb +spec: + type: ClusterIP + ports: + - port: 8086 + targetPort: influxdb-port + protocol: TCP + name: web + selector: + app: influxdb +--- + +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: influxdb-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + kubernetes.io/tls-acme: "true" + cert-manager.io/cluster-issuer: "letsencrypt-prod" +spec: + tls: + - hosts: + - influx.home.toozhao.com + secretName: influxdb-tls + rules: + - host: influx.home.toozhao.com + http: + paths: + - backend: + serviceName: influxdb + servicePort: 8086 + path: / diff --git a/home-k8s/media.yaml b/home-k8s/media.yaml index 7fe8163..075b9cf 100644 --- a/home-k8s/media.yaml +++ b/home-k8s/media.yaml @@ -205,7 +205,7 @@ spec: cpu: 500m memory: 700Mi limits: - cpu: 700m + cpu: 1000m memory: 1500Mi --- @@ -452,3 +452,105 @@ spec: - backend: serviceName: jackett servicePort: 80 + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: files +spec: + selector: + matchLabels: + app: files + replicas: 1 + template: + metadata: + labels: + app: files + spec: + volumes: + - name: files-config + hostPath: + path: /mnt/configs/aria + type: Directory + - name: downloads + hostPath: + path: /mnt/downloads + type: Directory + - name: files-db + hostPath: + path: /mnt/configs/files/filebrowser.db + type: File + containers: + - name: files + image: wahyd4/aria2-ui:latest + securityContext: + runAsUser: 0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + name: files-port + protocol: TCP + env: + - name: ARIA2_EXTERNAL_PORT + value: "443" + - name: PUID + value: "1000" + - name: PGID + value: "1000" + volumeMounts: + - name: files-config + mountPath: /app/conf + - name: downloads + mountPath: /data + - name: files-db + mountPath: /app/filebrowser.db + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 300m + memory: 400Mi +--- + +apiVersion: v1 +kind: Service +metadata: + name: files + labels: + app: files +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: files-port + protocol: TCP + name: web + selector: + app: files + +--- + +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: files-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + kubernetes.io/tls-acme: "true" + cert-manager.io/cluster-issuer: "letsencrypt-prod" + nginx.ingress.kubernetes.io/auth-url: "https://id.home.toozhao.com/oauth2/auth" + nginx.ingress.kubernetes.io/auth-signin: "https://id.home.toozhao.com/oauth2/start?rd=https%3A%2F%2F$host$request_uri" +spec: + tls: + - hosts: + - files.home.toozhao.com + secretName: files-tls + rules: + - host: files.home.toozhao.com + http: + paths: + - backend: + serviceName: files + servicePort: 80