Kubernetes/File/Yaml/registry-proxy-ds.yaml

66 lines
1.3 KiB
YAML
Raw Normal View History

2024-08-07 10:54:39 +00:00
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: registry-proxy-pvc
namespace: hub
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: registry-proxy
namespace: hub
labels:
name: registry-proxy
spec:
selector:
matchLabels:
name: registry-proxy
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
name: registry-proxy
spec:
volumes:
# - name: data
# hostPath:
# path: /var/lib/registryproxy
# type: Directory
- name: data
persistentVolumeClaim:
claimName: registry-proxy-pvc
containers:
- name: registry-proxy
image: hub.offends.cn/registry-proxy:latest
imagePullPolicy: IfNotPresent
ports:
- name: registry-port
containerPort: 5000
protocol: TCP
env:
- name: PROXY_REMOTE_URL
value: 'http://registry:5000'
volumeMounts:
- name: data
mountPath: /var/lib/registry
---
apiVersion: v1
kind: Service
metadata:
name: registry-proxy-service
namespace: hub
spec:
selector:
name: registry-proxy
ports:
- protocol: TCP
port: 5000
targetPort: 5000
type: ClusterIP