Files
k8s-docs/k8s/xiongxiao.me/backup/deployment/verdaccio-deployment.yaml

63 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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