删除 Verdaccio 部署和服务配置文件,并新增备份文件

This commit is contained in:
2026-03-22 23:53:07 +08:00
parent f572f233e7
commit 4bbb6cef8a
3 changed files with 7 additions and 4 deletions

View File

@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: verdaccio
namespace: default
labels:
machine: library
app: verdaccio
spec:
replicas: 1
selector:
matchLabels:
app: verdaccio
template:
metadata:
labels:
app: verdaccio
machine: library
spec:
# 指定调度到特定节点
nodeSelector:
machine: library
# 或者使用 nodeAffinity更灵活推荐用于生产
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/hostname
# operator: In
# values:
# - vm-32-6-ubuntu
containers:
- name: verdaccio
image: verdaccio/verdaccio:latest
ports:
- containerPort: 4873
volumeMounts:
- name: verdaccio-storage
mountPath: /verdaccio/storage
- name: verdaccio-config
mountPath: /verdaccio/conf
env:
- name: VERDACCIO_PORT
value: "4873"
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
volumes:
- name: verdaccio-storage
hostPath:
path: /opt/docker/verdaccio/data/storage
type: DirectoryOrCreate
- name: verdaccio-config
hostPath:
path: /opt/docker/verdaccio/data/conf