Skip to content

Commit 58969ea

Browse files
committed
Fix certificate errors in vcluster container
We need to ensure that the syncer's TLS certificate is also valid for the pod IP. This only needs the pod IP passed to the container as an environment variable, cf. loft-sh/vcluster#549
1 parent 695709f commit 58969ea

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

component/cluster.libsonnet

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,17 @@ local cluster = function(name, options)
345345
securityContext: {
346346
allowPrivilegeEscalation: false,
347347
},
348-
env: [],
348+
env: [
349+
// ensure that syncer TLS certificate is also valid for pod IP
350+
{
351+
name: 'POD_IP',
352+
valueFrom: {
353+
fieldRef: {
354+
fieldPath: 'status.podIP',
355+
},
356+
},
357+
},
358+
],
349359
volumeMounts: [
350360
{
351361
mountPath: '/data',

tests/golden/defaults/defaults/defaults/10_cluster.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ spec:
221221
- --tls-san=defaults.syn-defaults.svc
222222
- --tls-san=defaults.syn-defaults
223223
- --tls-san=defaults
224-
env: []
224+
env:
225+
- name: POD_IP
226+
valueFrom:
227+
fieldRef:
228+
fieldPath: status.podIP
225229
image: docker.io/loftsh/vcluster:0.12.2
226230
livenessProbe:
227231
failureThreshold: 10

tests/golden/oidc/oidc/oidc/10_cluster.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ spec:
225225
- --tls-san=oidc.testns.svc
226226
- --tls-san=oidc.testns
227227
- --tls-san=oidc
228-
env: []
228+
env:
229+
- name: POD_IP
230+
valueFrom:
231+
fieldRef:
232+
fieldPath: status.podIP
229233
image: docker.io/loftsh/vcluster:0.12.2
230234
livenessProbe:
231235
failureThreshold: 10

tests/golden/openshift/openshift/openshift/10_cluster.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ spec:
227227
- --tls-san=openshift.syn-openshift.svc
228228
- --tls-san=openshift.syn-openshift
229229
- --tls-san=openshift
230-
env: []
230+
env:
231+
- name: POD_IP
232+
valueFrom:
233+
fieldRef:
234+
fieldPath: status.podIP
231235
image: docker.io/loftsh/vcluster:0.12.2
232236
livenessProbe:
233237
failureThreshold: 10

0 commit comments

Comments
 (0)