diff --git a/apps/publicfiles/Caddyfile b/apps/publicfiles/Caddyfile new file mode 100644 index 0000000..46b31d1 --- /dev/null +++ b/apps/publicfiles/Caddyfile @@ -0,0 +1,4 @@ +http://publicfiles.default.svc.yakumo.prettysunflower.moe, http://files.prettysunflower.moe { + root * /srv + file_server browse +} diff --git a/apps/publicfiles/deployment.yaml b/apps/publicfiles/deployment.yaml new file mode 100644 index 0000000..efc36b0 --- /dev/null +++ b/apps/publicfiles/deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: publicfiles + labels: + app.kubernetes.io/name: publicfiles +spec: + replicas: 3 + selector: + matchLabels: + app.kubernetes.io/name: publicfiles + template: + metadata: + labels: + app.kubernetes.io/name: publicfiles + spec: + volumes: + - name: publicfiles + persistentVolumeClaim: + claimName: publicfiles + - name: config + configMap: + name: publicfiles-caddy-config + containers: + - image: caddy:latest + name: caddy + imagePullPolicy: Always + ports: + - containerPort: 80 + protocol: TCP + volumeMounts: + - name: publicfiles + mountPath: "/srv" + - name: config + mountPath: /etc/caddy \ No newline at end of file diff --git a/apps/publicfiles/kustomization.yaml b/apps/publicfiles/kustomization.yaml new file mode 100644 index 0000000..cf01493 --- /dev/null +++ b/apps/publicfiles/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - deployment.yaml + - pvc.yaml + - services.yaml +configMapGenerator: +- name: publicfiles-caddy-config + files: + - Caddyfile \ No newline at end of file diff --git a/apps/publicfiles/pvc.yaml b/apps/publicfiles/pvc.yaml new file mode 100644 index 0000000..9e4bb00 --- /dev/null +++ b/apps/publicfiles/pvc.yaml @@ -0,0 +1,43 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: publicfiles +spec: + storageClassName: s3yuyuko + capacity: + storage: 10T + accessModes: + - ReadOnlyMany + claimRef: + namespace: default + name: publicfiles + csi: + driver: ru.yandex.s3.csi + controllerPublishSecretRef: + name: csi-yuyuko-secret + namespace: kube-system + nodePublishSecretRef: + name: csi-yuyuko-secret + namespace: kube-system + nodeStageSecretRef: + name: csi-yuyuko-secret + namespace: kube-system + volumeAttributes: + capacity: 10Ti + mounter: geesefs + options: --memory-limit 1000 --dir-mode 0777 --file-mode 0666 + volumeHandle: publicfiles +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: publicfiles +spec: + storageClassName: "s3yuyuko" + resources: + requests: + storage: 10Ti + volumeMode: Filesystem + accessModes: + - ReadOnlyMany + volumeName: publicfiles \ No newline at end of file diff --git a/apps/publicfiles/services.yaml b/apps/publicfiles/services.yaml new file mode 100644 index 0000000..d7c42f9 --- /dev/null +++ b/apps/publicfiles/services.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: publicfiles +spec: + type: ClusterIP + selector: + app.kubernetes.io/name: publicfiles + ports: + - protocol: TCP + port: 80 + targetPort: 80 + name: http \ No newline at end of file