Skip to content

Commit f2b15f1

Browse files
dind-volume-utils rootless (#338)
* wip * wip * support rootless dind for localvolumes * bump chart * fix readme
1 parent 2d3ec0f commit f2b15f1

File tree

10 files changed

+76
-33
lines changed

10 files changed

+76
-33
lines changed

.deploy/cf-runtime/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A Helm chart for Codefresh Runner
33
name: cf-runtime
4-
version: 1.0.2
4+
version: 1.0.3
55
home: https://github.com/codefresh-io/venona
66
kubeVersion: '>=1.19.0-0'
77
keywords:

.deploy/cf-runtime/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Codefresh Runner
22

3-
![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.2-informational?style=flat-square)
3+
![Version: 1.0.3](https://img.shields.io/badge/Version-1.0.3-informational?style=flat-square)
44

55
## Prerequisites
66

@@ -85,15 +85,14 @@ Kubernetes: `>=1.19.0-0`
8585
| re.dindDaemon.hosts[1] | string | `"tcp://0.0.0.0:1300"` | |
8686
| re.dindDaemon.insecure-registries[0] | string | `"192.168.99.100:5000"` | |
8787
| re.dindDaemon.metrics-addr | string | `"0.0.0.0:9323"` | |
88-
| re.dindDaemon.storage-driver | string | `"overlay2"` | |
8988
| re.dindDaemon.tls | bool | `true` | |
9089
| re.dindDaemon.tlscacert | string | `"/etc/ssl/cf-client/ca.pem"` | |
9190
| re.dindDaemon.tlscert | string | `"/etc/ssl/cf/server-cert.pem"` | |
9291
| re.dindDaemon.tlskey | string | `"/etc/ssl/cf/server-key.pem"` | |
9392
| re.dindDaemon.tlsverify | bool | `true` | |
9493
| re.serviceAccount | object | `{"annotations":{}}` | Set annotation on engine Service Account Ref: https://codefresh.io/docs/docs/administration/codefresh-runner/#injecting-aws-arn-roles-into-the-cluster |
9594
| runner.env | object | `{}` | Add additional env vars |
96-
| runner.image | string | `"codefresh/venona:1.9.12"` | Set runner image |
95+
| runner.image | string | `"codefresh/venona:1.9.13"` | Set runner image |
9796
| runner.nodeSelector | object | `{}` | Set runner node selector |
9897
| runner.resources | object | `{}` | Set runner requests and limits |
9998
| runner.tolerations | list | `[]` | Set runner tolerations |
@@ -112,13 +111,13 @@ Kubernetes: `>=1.19.0-0`
112111
| storage.gcedisk.volumeType | string | `"pd-ssd"` | Set GCP volume backend type (`pd-ssd`/`pd-standard`) |
113112
| storage.local.volumeParentDir | string | `"/var/lib/codefresh/dind-volumes"` | Set volume path on the host filesystem |
114113
| storage.localVolumeMonitor.env | object | `{}` | |
115-
| storage.localVolumeMonitor.image | string | `"codefresh/dind-volume-utils:1.29.2"` | Set `dind-lv-monitor` image |
114+
| storage.localVolumeMonitor.image | string | `"codefresh/dind-volume-utils:1.29.3"` | Set `dind-lv-monitor` image |
116115
| storage.localVolumeMonitor.nodeSelector | object | `{}` | |
117116
| storage.localVolumeMonitor.resources | object | `{}` | |
118117
| storage.localVolumeMonitor.tolerations | list | `[]` | |
119118
| volumeProvisioner.annotations | object | `{}` | |
120119
| volumeProvisioner.env | object | `{}` | Add additional env vars |
121-
| volumeProvisioner.image | string | `"codefresh/dind-volume-provisioner:1.33.1"` | Set volume-provisioner image |
120+
| volumeProvisioner.image | string | `"codefresh/dind-volume-provisioner:1.33.2"` | Set volume-provisioner image |
122121
| volumeProvisioner.nodeSelector | object | `{}` | Set volume-provisioner node selector |
123122
| volumeProvisioner.resources | object | `{}` | Set volume-provisioner requests and limits |
124123
| volumeProvisioner.securityContext | object | `{"enabled":true}` | Enable volume-provisioner pod's security context (running as non root user) |

.deploy/cf-runtime/templates/volume-provisioner/daemonset.dind-lv-monitor.vp.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,28 @@ spec:
2727
{{- if .Values.storage.localVolumeMonitor.tolerations }}
2828
{{ toYaml .Values.storage.localVolumeMonitor.tolerations | indent 8 }}
2929
{{- end }}
30+
initContainers:
31+
- command:
32+
- chown
33+
- -R
34+
- 1000:1000
35+
- /var/lib/codefresh/dind-volumes
36+
image: alpine
37+
imagePullPolicy: Always
38+
name: fs-change-owner
39+
resources: {}
40+
terminationMessagePath: /dev/termination-log
41+
terminationMessagePolicy: File
42+
volumeMounts:
43+
- mountPath: /var/lib/codefresh/dind-volumes
44+
name: dind-volume-dir
3045
containers:
3146
- image: {{ include "cf-vp.docker-image-volume-utils" . }}
3247
name: lv-cleaner
3348
imagePullPolicy: Always
3449
resources: {{ toYaml .Values.storage.localVolumeMonitor.resources | nindent 12 }}
3550
command:
36-
- /bin/local-volumes-agent
51+
- /home/dind-volume-utils/bin/local-volumes-agent
3752
env:
3853
{{- if .Values.storage.localVolumeMonitor.env }}
3954
{{- range $key, $value := .Values.storage.localVolumeMonitor.env }}
@@ -51,6 +66,8 @@ spec:
5166
- mountPath: {{ $localVolumeParentDir }}
5267
readOnly: false
5368
name: dind-volume-dir
69+
securityContext:
70+
fsGroup: 1000
5471
volumes:
5572
- name: dind-volume-dir
5673
hostPath:

.deploy/cf-runtime/values.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dockerRegistry: "quay.io"
2727
# @default -- See below
2828
runner:
2929
# -- Set runner image
30-
image: "codefresh/venona:1.9.12"
30+
image: "codefresh/venona:1.9.13"
3131
# -- Add additional env vars
3232
env: {}
3333
# E.g
@@ -66,7 +66,7 @@ runner:
6666
# @default -- See below
6767
volumeProvisioner:
6868
# -- Set volume-provisioner image
69-
image: "codefresh/dind-volume-provisioner:1.33.1"
69+
image: "codefresh/dind-volume-provisioner:1.33.2"
7070
# -- Set annotation on volume-provisioner Service Account
7171
serviceAccount: {}
7272
# E.g
@@ -119,7 +119,7 @@ storage:
119119
# @default -- See below
120120
localVolumeMonitor:
121121
# -- Set `dind-lv-monitor` image
122-
image: codefresh/dind-volume-utils:1.29.2
122+
image: codefresh/dind-volume-utils:1.29.3
123123
nodeSelector: {}
124124
resources: {}
125125
tolerations: []
@@ -224,7 +224,6 @@ re:
224224
hosts:
225225
- unix:///var/run/docker.sock
226226
- tcp://0.0.0.0:1300
227-
storage-driver: overlay2
228227
tlsverify: true
229228
tls: true
230229
tlscacert: /etc/ssl/cf-client/ca.pem

venona/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.12
1+
1.9.13

venonactl/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.12
1+
1.9.13

venonactl/pkg/store/store.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,18 @@ func (s *Values) BuildValues() map[string]interface{} {
174174
"AwsAccessKeyId": "",
175175
"AwsSecretAccessKey": "",
176176
"VolumeProvisioner": map[string]interface{}{
177-
"Image": "codefresh/dind-volume-provisioner:1.33.1",
177+
"Image": "codefresh/dind-volume-provisioner:1.33.2",
178178
"NodeSelector": s.KubernetesAPI.NodeSelector,
179179
"Resources": s.VolumeProvisioner.Resources,
180180
"MountAzureJson": false,
181181
},
182-
"LocalVolumeMonitor": s.LocalVolumeMonitor.Resources,
182+
"LocalVolumeMonitor": map[string]interface{}{
183+
"Resources": s.LocalVolumeMonitor.Resources,
184+
"Image": map[string]string{
185+
"Name": "codefresh/dind-volume-utils",
186+
"Tag": "1.29.3",
187+
},
188+
},
183189
"VolumeCleaner": map[string]interface{}{
184190
"Image": map[string]string{
185191
"Name": "codefresh/dind-volume-cleanup",

venonactl/pkg/templates/kubernetes/daemonset.dind-lv-monitor.vp.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,38 @@ spec:
2020
prometheus_scrape: "true"
2121
spec:
2222
serviceAccountName: volume-provisioner-{{ .AppName }}
23-
# Debug:
24-
# hostNetwork: true
25-
# nodeSelector:
26-
# kubernetes.io/role: "node"
2723
tolerations:
2824
- key: 'codefresh/dind'
2925
operator: 'Exists'
3026
effect: 'NoSchedule'
27+
securityContext:
28+
fsGroup: 1000
3129

3230
{{ toYaml .Tolerations | indent 8 | unescape}}
3331

34-
32+
initContainers:
33+
- command:
34+
- chown
35+
- -R
36+
- 1000:1000
37+
- /var/lib/codefresh/dind-volumes
38+
image: alpine
39+
imagePullPolicy: Always
40+
name: fs-change-owner
41+
resources: {}
42+
terminationMessagePath: /dev/termination-log
43+
terminationMessagePolicy: File
44+
volumeMounts:
45+
- mountPath: /var/lib/codefresh/dind-volumes
46+
name: dind-volume-dir
3547
containers:
36-
- image: {{ if ne .DockerRegistry ""}} {{- .DockerRegistry }}/codefresh/dind-volume-utils:1.29.2 {{- else }}codefresh/dind-volume-utils:1.29.2{{- end}}
48+
- image: {{ if ne .DockerRegistry ""}} {{- .DockerRegistry }}/{{ .Storage.LocalVolumeMonitor.Image.Name }}:{{ .Storage.LocalVolumeMonitor.Image.Tag }} {{- else }}{{- .Storage.LocalVolumeMonitor.Image.Name }}:{{ .Storage.LocalVolumeMonitor.Image.Tag }} {{- end}}
3749
name: lv-cleaner
3850
resources:
39-
{{ toYaml .Storage.LocalVolumeMonitor | indent 10 }}
51+
{{ toYaml .Storage.LocalVolumeMonitor.Resources | indent 10 }}
4052
imagePullPolicy: Always
4153
command:
42-
- /bin/local-volumes-agent
54+
- /home/dind-volume-utils/bin/local-volumes-agent
4355
env:
4456
{{- if $.EnvVars }}
4557
{{- range $key, $value := $.EnvVars }}

venonactl/pkg/templates/kubernetes/dind-daemon-conf.re.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ data:
99
{
1010
"hosts": [ "unix:///var/run/docker.sock",
1111
"tcp://0.0.0.0:1300"],
12-
"storage-driver": "overlay2",
1312
"tlsverify": true,
1413
"tls": true,
1514
"tlscacert": "/etc/ssl/cf-client/ca.pem",

venonactl/pkg/templates/kubernetes/templates.go

Lines changed: 20 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)