feat(registry-cache): add Docker Hub pull-through cache + dind mirror config
Deploy registry:2 as Docker Hub pull-through cache on chemavx-k8 (hostPort 5000, ClusterIP 10.43.163.56:5000). Configures dind runner to use local mirror via daemon.json to eliminate Docker Hub rate limit failures in CI/CD. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: docker-daemon-config
|
||||
namespace: gitea
|
||||
data:
|
||||
daemon.json: |
|
||||
{
|
||||
"registry-mirrors": ["http://registry-cache.registry-cache.svc.cluster.local:5000"],
|
||||
"insecure-registries": ["registry-cache.registry-cache.svc.cluster.local:5000"]
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: gitea-runner
|
||||
namespace: gitea
|
||||
labels:
|
||||
app: gitea-runner
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: gitea-runner
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: gitea-runner
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: chemavx-k8
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: runner-data
|
||||
emptyDir: {}
|
||||
- name: runner-config
|
||||
configMap:
|
||||
name: gitea-runner-config
|
||||
- name: dind-storage
|
||||
emptyDir: {}
|
||||
- name: docker-daemon-config
|
||||
configMap:
|
||||
name: docker-daemon-config
|
||||
containers:
|
||||
- name: dind
|
||||
image: docker:24-dind
|
||||
imagePullPolicy: IfNotPresent
|
||||
args:
|
||||
- --host=tcp://0.0.0.0:2375
|
||||
- --tls=false
|
||||
env:
|
||||
- name: DOCKER_TLS_CERTDIR
|
||||
value: ""
|
||||
securityContext:
|
||||
privileged: true
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: "2"
|
||||
memory: 2Gi
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/docker
|
||||
name: dind-storage
|
||||
- mountPath: /etc/docker/daemon.json
|
||||
name: docker-daemon-config
|
||||
subPath: daemon.json
|
||||
- name: runner
|
||||
image: gitea/act_runner:latest
|
||||
imagePullPolicy: Always
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
args:
|
||||
- |
|
||||
until nc -z localhost 2375 2>/dev/null; do sleep 1; done
|
||||
exec /usr/local/bin/run.sh
|
||||
env:
|
||||
- name: GITEA_INSTANCE_URL
|
||||
value: http://gitea.gitea.svc.cluster.local:3000
|
||||
- name: GITEA_RUNNER_NAME
|
||||
value: k8s-runner
|
||||
- name: CONFIG_FILE
|
||||
value: /etc/act_runner/config.yaml
|
||||
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: gitea-runner-secret
|
||||
key: GITEA_RUNNER_REGISTRATION_TOKEN
|
||||
- name: DOCKER_HOST
|
||||
value: tcp://localhost:2375
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: runner-data
|
||||
- mountPath: /etc/act_runner
|
||||
name: runner-config
|
||||
Reference in New Issue
Block a user