说明
k8s环境部署alist
详见https://github.com/AlistGo/alist/discussions/9514
配置文件
bash
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: alist-pvc
labels:
app: alist
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: alist-deployment
labels:
app: alist
spec:
replicas: 1
selector:
matchLabels:
app: alist
template:
metadata:
labels:
app: alist
spec:
containers:
- name: alist-container
image: xhofe/alist:v3.60.0
imagePullPolicy: Always
ports:
- name: http
containerPort: 5244
protocol: TCP
env:
- name: PUID
value: "0"
- name: PGID
value: "0"
- name: UMASK
value: "022"
volumeMounts:
- name: alist-data
mountPath: /opt/alist/data
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: "1"
memory: 1Gi
volumes:
- name: alist-data
persistentVolumeClaim:
claimName: alist-pvc
---
apiVersion: v1
kind: Service
metadata:
name: alist-clusterip-service
labels:
app: alist
spec:
type: ClusterIP
selector:
app: alist
ports:
- name: http
protocol: TCP
port: 5244
targetPort: 5244
---
apiVersion: v1
kind: Service
metadata:
name: alist-nodeport-service
labels:
app: alist
spec:
type: NodePort
selector:
app: alist
ports:
- name: http
protocol: TCP
port: 5244
targetPort: 5244