-
Notifications
You must be signed in to change notification settings - Fork 472
/
seed_logging_stack.go
397 lines (343 loc) · 19.6 KB
/
seed_logging_stack.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package logging
import (
"context"
"fmt"
"time"
"github.com/onsi/ginkgo/v2"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
rbacv1 "k8s.io/api/rbac/v1"
schedulingv1 "k8s.io/api/scheduling/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/client"
gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
v1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper"
"github.com/gardener/gardener/pkg/client/kubernetes"
kubernetesutils "github.com/gardener/gardener/pkg/utils/kubernetes"
"github.com/gardener/gardener/test/framework"
"github.com/gardener/gardener/test/framework/resources/templates"
)
const (
deltaLogsCount = 1
deltaLogsDuration = "180s"
logsCount = 2000
logsDuration = "90s"
numberOfSimulatedClusters = 100
initializationTimeout = 5 * time.Minute
getLogsFromLokiTimeout = 15 * time.Minute
loggerDeploymentCleanupTimeout = 5 * time.Minute
fluentBitName = "fluent-bit"
fluentBitConfigVolumeName = "config-dir"
lokiName = "loki"
lokiConfigDiskName = "config"
garden = "garden"
fluentBitClusterRoleName = "fluent-bit-read"
simulatedShootNamespacePrefix = "shoot--logging--test-"
)
var _ = ginkgo.Describe("Seed logging testing", func() {
var (
f = framework.NewShootFramework(nil)
fluentBit = &appsv1.DaemonSet{}
fluentBitConfMap = &corev1.ConfigMap{}
fluentBitService = &corev1.Service{}
fluentBitClusterRole = &rbacv1.ClusterRole{}
fluentBitClusterRoleBinding = &rbacv1.ClusterRoleBinding{}
fluentBitServiceAccount = &corev1.ServiceAccount{}
fluentBitPriorityClass = &schedulingv1.PriorityClass{}
clusterCRD = &apiextensionsv1.CustomResourceDefinition{}
gardenLokiSts = &appsv1.StatefulSet{}
gardenLokiService = &corev1.Service{}
gardenLokiConfMap = &corev1.ConfigMap{}
gardenLokiPriorityClass = &schedulingv1.PriorityClass{}
shootLokiService = &corev1.Service{}
shootLokiSts = &appsv1.StatefulSet{}
shootLokiPriorityClass = &schedulingv1.PriorityClass{}
shootLokiConfMap = &corev1.ConfigMap{}
grafanaIngress client.Object = &networkingv1.Ingress{}
// This shoot is used as seed for this test only
shootClient kubernetes.Interface
shootLokiLabels = map[string]string{
"app": "loki-shoot",
"role": "logging",
}
gardenLokiLabels = map[string]string{
"app": "loki",
"role": "logging",
}
)
framework.CBeforeEach(func(ctx context.Context) {
var err error
checkRequiredResources(ctx, f.SeedClient)
shootClient, err = kubernetes.NewClientFromSecret(ctx, f.SeedClient.Client(), framework.ComputeTechnicalID(f.Project.Name, f.Shoot), gardencorev1beta1.GardenerName, kubernetes.WithClientOptions(client.Options{
Scheme: kubernetes.SeedScheme,
}))
framework.ExpectNoError(err)
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: fluentBitName}, fluentBit))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: getConfigMapName(fluentBit.Spec.Template.Spec.Volumes, fluentBitConfigVolumeName)}, fluentBitConfMap))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: fluentBitName}, fluentBitService))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: fluentBitClusterRoleName}, fluentBitClusterRole))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: fluentBitClusterRoleName}, fluentBitClusterRoleBinding))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: fluentBitName}, fluentBitServiceAccount))
fluentBitPriorityClassName := fluentBit.Spec.Template.Spec.PriorityClassName
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: fluentBitPriorityClassName}, fluentBitPriorityClass))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: "", Name: "clusters.extensions.gardener.cloud"}, clusterCRD))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: lokiName}, gardenLokiSts))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: lokiName}, gardenLokiService))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: getConfigMapName(gardenLokiSts.Spec.Template.Spec.Volumes, lokiConfigDiskName)}, gardenLokiConfMap))
lokiPriorityClassName := gardenLokiSts.Spec.Template.Spec.PriorityClassName
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: v1beta1constants.GardenNamespace, Name: lokiPriorityClassName}, gardenLokiPriorityClass))
// Get the shoot logging components from the shoot running the test
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: f.ShootSeedNamespace(), Name: lokiName}, shootLokiService))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: f.ShootSeedNamespace(), Name: lokiName}, shootLokiSts))
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: f.ShootSeedNamespace(), Name: getConfigMapName(shootLokiSts.Spec.Template.Spec.Volumes, lokiConfigDiskName)}, shootLokiConfMap))
shootLokiPriorityClassName := shootLokiSts.Spec.Template.Spec.PriorityClassName
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: f.ShootSeedNamespace(), Name: shootLokiPriorityClassName}, shootLokiPriorityClass))
// Get the grafana Ingress
framework.ExpectNoError(f.SeedClient.Client().Get(ctx, types.NamespacedName{Namespace: f.ShootSeedNamespace(), Name: v1beta1constants.DeploymentNameGrafana}, grafanaIngress))
}, initializationTimeout)
f.Beta().Serial().CIt("should get container logs from loki for all namespaces", func(ctx context.Context) {
const (
emptyDirSize = "500Mi"
lokiPersistentVolumeName = "loki"
shootLokiName = "loki-shoots"
loggerRegex = loggerName + "-.*"
)
var (
loggerLabels = labels.SelectorFromSet(map[string]string{
"app": loggerName,
})
)
ginkgo.By("Get Loki tenant IDs")
id := getXScopeOrgID(grafanaIngress.GetAnnotations())
ginkgo.By("Deploy the garden Namespace")
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), newGardenNamespace(v1beta1constants.GardenNamespace)))
ginkgo.By("Deploy the Loki StatefulSet for Garden namespace")
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), gardenLokiConfMap))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), prepareGardenLokiService(gardenLokiService)))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), gardenLokiPriorityClass))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), prepareGardenLokiStatefulSet(gardenLokiSts, lokiPersistentVolumeName, emptyDirSize, shootLokiLabels)))
ginkgo.By("Deploy the Loki StatefulSet for Shoot namespaces")
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), prepareShootLokiService(shootLokiService, shootLokiName, shootLokiLabels)))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), shootLokiPriorityClass))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), prepareShootLokiConfigMap(shootLokiConfMap)))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), prepareShootLokiStatefulSet(shootLokiSts, gardenLokiSts, shootLokiName, shootLokiConfMap.Name, lokiPersistentVolumeName, emptyDirSize, shootLokiLabels, gardenLokiLabels)))
ginkgo.By("Wait until Loki StatefulSet for Garden namespace is ready")
framework.ExpectNoError(f.WaitUntilStatefulSetIsRunning(ctx, gardenLokiSts.Name, v1beta1constants.GardenNamespace, f.ShootClient))
ginkgo.By("Wait until Loki StatefulSet for Shoot namespaces is ready")
framework.ExpectNoError(f.WaitUntilStatefulSetIsRunning(ctx, shootLokiSts.Name, v1beta1constants.GardenNamespace, f.ShootClient))
ginkgo.By("Deploy the cluster CRD")
framework.ExpectNoError(create(ctx, shootClient.Client(), prepareClusterCRD(clusterCRD)))
ginkgo.By("Deploy the fluent-bit RBAC")
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), prepareFluentBitServiceAccount(fluentBitServiceAccount)))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), fluentBitPriorityClass))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), fluentBitClusterRole))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), fluentBitClusterRoleBinding))
if !v1beta1helper.IsPSPDisabled(f.Shoot) {
framework.ExpectNoError(f.RenderAndDeployTemplate(ctx, f.ShootClient, "fluent-bit-psp-clusterrolebinding.yaml", nil))
}
ginkgo.By("Deploy the fluent-bit DaemonSet")
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), fluentBitConfMap))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), fluentBit))
ginkgo.By("Wait until fluent-bit DaemonSet is ready")
framework.ExpectNoError(f.WaitUntilDaemonSetIsRunning(ctx, f.ShootClient.Client(), fluentBitName, v1beta1constants.GardenNamespace))
ginkgo.By("Deploy the simulated cluster and shoot controlplane namespaces")
nodeList := &corev1.NodeList{}
framework.ExpectNoError(f.ShootClient.Client().List(ctx, nodeList))
for i := 0; i < numberOfSimulatedClusters; i++ {
shootNamespace := getShootNamesapce(i)
ginkgo.By(fmt.Sprintf("Deploy namespace %s", shootNamespace.Name))
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), shootNamespace))
cluster := getCluster(i)
ginkgo.By(fmt.Sprintf("Deploy cluster %s", cluster.Name))
framework.ExpectNoError(create(ctx, shootClient.Client(), cluster))
ginkgo.By(fmt.Sprintf("Deploy the loki service in namespace %s", shootNamespace.Name))
lokiShootService := getLokiShootService(i)
framework.ExpectNoError(create(ctx, f.ShootClient.Client(), lokiShootService))
ginkgo.By(fmt.Sprintf("Deploy the logger application in namespace %s", shootNamespace.Name))
loggerParams := map[string]interface{}{
"LoggerName": loggerName,
"HelmDeployNamespace": shootNamespace.Name,
"AppLabel": loggerName,
"DeltaLogsCount": deltaLogsCount,
"DeltaLogsDuration": deltaLogsDuration,
"LogsCount": logsCount,
"LogsDuration": logsDuration,
}
// Try to distrubute the loggers even between nodes
if len(nodeList.Items) > 0 {
loggerParams["NodeName"] = nodeList.Items[i%len(nodeList.Items)].Name
}
framework.ExpectNoError(f.RenderAndDeployTemplate(ctx, f.ShootClient, templates.LoggerAppName, loggerParams))
}
for i := 0; i < numberOfSimulatedClusters; i++ {
shootNamespace := fmt.Sprintf("%s%v", simulatedShootNamespacePrefix, i)
ginkgo.By(fmt.Sprintf("Wait until logger application is ready in namespace %s", shootNamespace))
framework.ExpectNoError(f.WaitUntilDeploymentsWithLabelsIsReady(ctx, loggerLabels, shootNamespace, f.ShootClient))
}
ginkgo.By("Verify loki received all operator's logs for all shoot namespaces")
framework.ExpectNoError(WaitUntilLokiReceivesLogs(ctx, 30*time.Second, f, shootLokiLabels, id, v1beta1constants.GardenNamespace, "pod_name", loggerRegex, logsCount*numberOfSimulatedClusters, numberOfSimulatedClusters, f.ShootClient))
ginkgo.By("Verify loki didn't get the logs from the operator's application as user's logs for all shoot namespaces")
framework.ExpectNoError(WaitUntilLokiReceivesLogs(ctx, 30*time.Second, f, shootLokiLabels, "user", v1beta1constants.GardenNamespace, "pod_name", loggerRegex, 0, 0, f.ShootClient))
ginkgo.By("Verify loki received logger application logs for garden namespace")
framework.ExpectNoError(WaitUntilLokiReceivesLogs(ctx, 30*time.Second, f, gardenLokiLabels, "", v1beta1constants.GardenNamespace, "pod_name", loggerRegex, logsCount*numberOfSimulatedClusters, numberOfSimulatedClusters, f.ShootClient))
}, getLogsFromLokiTimeout, framework.WithCAfterTest(func(ctx context.Context) {
ginkgo.By("Cleanup logger app resources")
for i := 0; i < numberOfSimulatedClusters; i++ {
shootNamespace := getShootNamesapce(i)
loggerDeploymentToDelete := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Namespace: shootNamespace.Name,
Name: loggerName,
},
}
framework.ExpectNoError(kubernetesutils.DeleteObject(ctx, f.ShootClient.Client(), loggerDeploymentToDelete))
cluster := getCluster(i)
framework.ExpectNoError(kubernetesutils.DeleteObject(ctx, shootClient.Client(), cluster))
lokiShootService := getLokiShootService(i)
framework.ExpectNoError(kubernetesutils.DeleteObject(ctx, f.ShootClient.Client(), lokiShootService))
framework.ExpectNoError(kubernetesutils.DeleteObject(ctx, f.ShootClient.Client(), shootNamespace))
}
ginkgo.By("Cleanup garden namespace")
objectsToDelete := []client.Object{
fluentBit,
fluentBitConfMap,
fluentBitService,
fluentBitClusterRole,
fluentBitClusterRoleBinding,
fluentBitServiceAccount,
fluentBitPriorityClass,
clusterCRD,
gardenLokiSts,
gardenLokiService,
gardenLokiConfMap,
gardenLokiPriorityClass,
shootLokiService,
shootLokiSts,
shootLokiPriorityClass,
shootLokiConfMap,
newGardenNamespace(v1beta1constants.GardenNamespace),
}
for _, object := range objectsToDelete {
framework.ExpectNoError(kubernetesutils.DeleteObject(ctx, f.ShootClient.Client(), object))
}
}, loggerDeploymentCleanupTimeout))
})
func prepareGardenLokiService(service *corev1.Service) *corev1.Service {
// Remove the cluster IP because it could be already in use
service.Spec.ClusterIP = ""
service.Spec.ClusterIPs = nil
return service
}
func prepareGardenLokiStatefulSet(gardenLokiSts *appsv1.StatefulSet, lokiPersistentVolumeName, emptyDirSize string, antiAffinityLabels map[string]string) *appsv1.StatefulSet {
// Remove the Loki PVC as it is no needed for the test
gardenLokiSts.Spec.VolumeClaimTemplates = nil
// Instead use an empty dir volume
gardenLokiSts.Spec.Template.Spec.Volumes = append(gardenLokiSts.Spec.Template.Spec.Volumes, newEmptyDirVolume(lokiPersistentVolumeName, emptyDirSize))
// Spread the loki instances on separate nodes to let deploying of loggers afterwards to be relatively equal through the nodes
gardenLokiSts.Spec.Template.Spec.Affinity = &corev1.Affinity{PodAntiAffinity: newPodAntiAffinity(antiAffinityLabels)}
capLokiContainerResources(gardenLokiSts)
return gardenLokiSts
}
func prepareShootLokiService(shootLokiService *corev1.Service, name string, selector map[string]string) *corev1.Service {
shootLokiService.Name = name // "loki-shoots"
shootLokiService.Namespace = v1beta1constants.GardenNamespace
shootLokiService.Spec.Selector = selector
shootLokiService.Spec.ClusterIP = ""
shootLokiService.Spec.ClusterIPs = nil
return shootLokiService
}
func prepareShootLokiConfigMap(confMap *corev1.ConfigMap) *corev1.ConfigMap {
confMap.Namespace = v1beta1constants.GardenNamespace
return confMap
}
func prepareShootLokiStatefulSet(shootLokiSts, gardenLokiSts *appsv1.StatefulSet, name, configMapNAme, lokiPersistentVolumeName, emptyDirSize string, newLabels, antiAffinityLabels map[string]string) *appsv1.StatefulSet {
// Extract the containers related only to the seed logging stack
var containers []corev1.Container
for _, gardenCon := range gardenLokiSts.Spec.Template.Spec.Containers {
for _, shootCon := range shootLokiSts.Spec.Template.Spec.Containers {
if shootCon.Name == gardenCon.Name {
containers = append(containers, shootCon)
}
}
}
shootLokiSts.Spec.Template.Spec.Containers = containers
// Extract the volumes related only to the seed logging stack
var alreadyHasEmptyDirAsLokiPVC bool
var volumes []corev1.Volume
for _, gardenVolume := range gardenLokiSts.Spec.Template.Spec.Volumes {
for _, shootVolume := range shootLokiSts.Spec.Template.Spec.Volumes {
if shootVolume.Name == gardenVolume.Name {
volumes = append(volumes, shootVolume)
if gardenVolume.Name == lokiPersistentVolumeName && gardenVolume.EmptyDir != nil {
alreadyHasEmptyDirAsLokiPVC = true
}
}
}
}
shootLokiSts.Spec.Template.Spec.Volumes = volumes
// Remove the Loki PVC as it is no needed for the test
shootLokiSts.Spec.VolumeClaimTemplates = nil
// Instead use an empty dir volume
if !alreadyHasEmptyDirAsLokiPVC {
shootLokiSts.Spec.Template.Spec.Volumes = append(shootLokiSts.Spec.Template.Spec.Volumes, newEmptyDirVolume(lokiPersistentVolumeName, emptyDirSize))
}
// Spread the loki instances on separate nodes to let deploying of loggers afterwards to be relatively equal through the nodes
shootLokiSts.Spec.Template.Spec.Affinity = &corev1.Affinity{PodAntiAffinity: newPodAntiAffinity(antiAffinityLabels)}
// Rename the shoot Loki because it has the same name as the garden one
shootLokiSts.Name = name // "loki-shoots"
// Change the labels and the selectors because the shoot Loki has the same ones as garden Loki
shootLokiSts.Labels = newLabels
shootLokiSts.Spec.Selector.MatchLabels = newLabels
shootLokiSts.Spec.Template.Labels = newLabels
// Move the shoot Loki in the garden namespace
shootLokiSts.Namespace = v1beta1constants.GardenNamespace
capLokiContainerResources(shootLokiSts)
return shootLokiSts
}
func capLokiContainerResources(lokiSts *appsv1.StatefulSet) {
for i, container := range lokiSts.Spec.Template.Spec.Containers {
if container.Name == "loki" {
lokiSts.Spec.Template.Spec.Containers[i].Resources = corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("50m"),
corev1.ResourceMemory: resource.MustParse("300Mi"),
},
Limits: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("3Gi"),
},
}
return
}
}
}
func prepareClusterCRD(crd *apiextensionsv1.CustomResourceDefinition) *apiextensionsv1.CustomResourceDefinition {
crd.Spec.PreserveUnknownFields = false
for version := range crd.Spec.Versions {
crd.Spec.Versions[version].Schema.OpenAPIV3Schema.XPreserveUnknownFields = pointer.Bool(true)
}
return crd
}
func prepareFluentBitServiceAccount(serviceAccount *corev1.ServiceAccount) *corev1.ServiceAccount {
serviceAccount.AutomountServiceAccountToken = pointer.Bool(true)
return serviceAccount
}