From 82b46ae11f5b02c41bc9fc4b637c28b5b2c8d63d Mon Sep 17 00:00:00 2001 From: Sense T Date: Mon, 18 May 2026 05:37:35 +0000 Subject: [PATCH] =?UTF-8?q?ipfs=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipfs/deploy.yaml | 50 +++++++++++++++++++++++++++++++++++++++ ipfs/ingress.yaml | 25 ++++++++++++++++++++ ipfs/kustomization.yaml | 17 ++++++++++++++ ipfs/services.yaml | 52 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 ipfs/deploy.yaml create mode 100644 ipfs/ingress.yaml create mode 100644 ipfs/kustomization.yaml create mode 100644 ipfs/services.yaml diff --git a/ipfs/deploy.yaml b/ipfs/deploy.yaml new file mode 100644 index 0000000..c3cb3bc --- /dev/null +++ b/ipfs/deploy.yaml @@ -0,0 +1,50 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: ipfs + namespace: ipfs +spec: + strategy: + type: Recreate + replicas: 1 + selector: + matchLabels: + app: ipfs + template: + metadata: + labels: + app: ipfs + spec: + volumes: + - name: data + hostPath: + path: /data/ipfs + type: DirectoryOrCreate + containers: + - name: ipfs + # image: cr.wetofu.me/ipfs/kubo:v0.41.0 + image: image + ports: + - containerPort: 4001 + name: ipfs-p2p + - containerPort: 5001 + name: ipfs-api + - containerPort: 8080 + name: ipfs-webui + volumeMounts: + - name: data + mountPath: /data/ipfs + subPath: ipfs + - name: data + mountPath: /export + subPath: export + resources: + requests: + cpu: 250m + memory: 256M + limits: + cpu: '1' + memory: '1Gi' + envFrom: + - configMapRef: + name: ipfs-env diff --git a/ipfs/ingress.yaml b/ipfs/ingress.yaml new file mode 100644 index 0000000..e7b30a3 --- /dev/null +++ b/ipfs/ingress.yaml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ipfs + labels: + app.kubernetes.io/name: ipfs +spec: + rules: + - host: ipfs.233.local + http: + paths: + - pathType: Prefix + path: "/api" + backend: + service: + name: ipfs-svc + port: + number: 5001 + - pathType: Prefix + path: "/" + backend: + service: + name: ipfs-svc + port: + number: 8080 \ No newline at end of file diff --git a/ipfs/kustomization.yaml b/ipfs/kustomization.yaml new file mode 100644 index 0000000..652dc38 --- /dev/null +++ b/ipfs/kustomization.yaml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json + +kind: Kustomization +namespace: ipfs +resources: +- services.yaml +- deploy.yaml +- ingress.yaml +images: +- name: image + newName: cr.wetofu.me/ipfs/kubo + newTag: v0.41.0 +configMapGenerator: +- name: ipfs-env + files: + - ./config/IPFS_PROFILE + - ./config/IPFS_TELEMETRY \ No newline at end of file diff --git a/ipfs/services.yaml b/ipfs/services.yaml new file mode 100644 index 0000000..d806781 --- /dev/null +++ b/ipfs/services.yaml @@ -0,0 +1,52 @@ +apiVersion: v1 +kind: Service +metadata: + name: ipfs-p2p-tcp +spec: + selector: + app: ipfs + ports: + - port: 4001 + targetPort: ipfs-p2p + protocol: TCP + type: LoadBalancer + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 +--- +apiVersion: v1 +kind: Service +metadata: + name: ipfs-p2p-udp +spec: + selector: + app: ipfs + ports: + - port: 4001 + targetPort: ipfs-p2p + protocol: UDP + type: LoadBalancer + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 +--- +apiVersion: v1 +kind: Service +metadata: + name: ipfs-svc +spec: + selector: + app: ipfs + ports: + - port: 5001 + targetPort: ipfs-api + name: api + - port: 8080 + targetPort: ipfs-webui + name: webui + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 \ No newline at end of file