Skip to content

Commit 1ecb7a2

Browse files
authored
Disable servicelinks in all pods (#33)
1 parent 97bb26d commit 1ecb7a2

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

pkg/cluster/cluster_internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ func makeSvc(namespace string, depname, svcname string) corev1.Service {
597597
return svc
598598
}
599599

600-
601600
func makeDeployment(namespace string, depname string, replicas int32, hostnetwork bool, image string, labels []string) appsv1.Deployment {
602601
log.Debug("entering makeDeployment function")
603602
depname = utils.SanitizeString(depname)
@@ -633,6 +632,7 @@ func makeDeployment(namespace string, depname string, replicas int32, hostnetwor
633632
},
634633
Spec: corev1.PodSpec{
635634
AutomountServiceAccountToken: utils.BoolPtr(false),
635+
EnableServiceLinks: utils.BoolPtr(false),
636636
SecurityContext: &corev1.PodSecurityContext{
637637
RunAsNonRoot: utils.BoolPtr(true),
638638
RunAsGroup: utils.Int64Ptr(1000),

pkg/dnsperf/dnsperf.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ func makeDNSPerfPod(nodename string, namespace string, podname string, image str
540540
},
541541
Spec: corev1.PodSpec{
542542
AutomountServiceAccountToken: utils.BoolPtr(false),
543+
EnableServiceLinks: utils.BoolPtr(false),
543544
SecurityContext: &corev1.PodSecurityContext{
544545
RunAsNonRoot: utils.BoolPtr(true),
545546
RunAsGroup: utils.Int64Ptr(1000),
@@ -635,6 +636,7 @@ func makeDeployment(namespace string, depname string, replicas int32, hostnetwor
635636
},
636637
Spec: corev1.PodSpec{
637638
AutomountServiceAccountToken: utils.BoolPtr(false),
639+
EnableServiceLinks: utils.BoolPtr(false),
638640
SecurityContext: &corev1.PodSecurityContext{
639641
RunAsNonRoot: utils.BoolPtr(true),
640642
RunAsGroup: utils.Int64Ptr(1000),

pkg/iperf/iperf.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ func makePod(nodename string, namespace string, podname string, hostnetwork bool
336336
Type: corev1.SeccompProfileTypeRuntimeDefault,
337337
},
338338
},
339+
EnableServiceLinks: utils.BoolPtr(false),
339340
Containers: []corev1.Container{
340341
{
341342
Name: "iperf",

pkg/qperf/qperf.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ func makeQperfPod(nodename string, namespace string, podname string, image strin
365365
Type: corev1.SeccompProfileTypeRuntimeDefault,
366366
},
367367
},
368+
EnableServiceLinks: utils.BoolPtr(false),
368369
Containers: []corev1.Container{
369370
{
370371
Name: "qperf",

pkg/ttfr/ttfr.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ func makePod(nodename string, namespace string, podname string, hostnetwork bool
304304
},
305305
Spec: corev1.PodSpec{
306306
AutomountServiceAccountToken: utils.BoolPtr(false),
307+
EnableServiceLinks: utils.BoolPtr(false),
307308
SecurityContext: &corev1.PodSecurityContext{
308309
RunAsNonRoot: utils.BoolPtr(true),
309310
RunAsGroup: utils.Int64Ptr(1000),
@@ -356,6 +357,8 @@ func makeTestPod(nodename string, namespace string, podname string, hostnetwork
356357
RunAsGroup: utils.Int64Ptr(1000),
357358
RunAsUser: utils.Int64Ptr(1000),
358359
},
360+
AutomountServiceAccountToken: utils.BoolPtr(false),
361+
EnableServiceLinks: utils.BoolPtr(false),
359362
Containers: []corev1.Container{
360363
{
361364
Name: "ttfr",

0 commit comments

Comments
 (0)