This commit is contained in:
2025-11-26 15:44:15 +08:00
parent 1cd698ed64
commit 2418891634
42 changed files with 3715 additions and 5 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