Fixing dind connection error

This commit is contained in:
Lukas 2024-05-15 17:50:11 +02:00
parent bbe1f27caa
commit 89a7ccacb0
No known key found for this signature in database
GPG key ID: B7940328383214B0

View file

@ -34,7 +34,14 @@ spec:
- name: make-config-writeable
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: [ "/bin/cp", "/etc/runner/.runner", "/data/.runner" ]
command: [ "sh", "-c" ]
args:
- |
cp /etc/runner/.runner /data/.runner && forgejo-runner generate-config > /data/config.yml ;
sed -i -e "s|network: .*|network: host|" config.yml ;
sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://localhost:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ;
sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ;
sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ;
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
@ -48,12 +55,12 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: [ "/bin/forgejo-runner", "daemon" ]
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; forgejo-runner --config config.yml daemon"]
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: DOCKER_HOST
value: tcp://127.0.0.1:2376
value: tcp://localhost:2376
- name: DOCKER_CERT_PATH
value: /certs/client
- name: DOCKER_TLS_VERIFY