Skip to content

Commit 4ecf845

Browse files
author
Simon Emms
committed
[installer]: apply labels/annotations to minio and mysql
1 parent 0293a95 commit 4ecf845

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

install/installer/pkg/components/database/incluster/helm.go

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,37 @@ var Helm = common.CompositeHelmFunc(
2424
return nil, err
2525
}
2626

27+
customization := helm.CustomizeAnnotation([]string{}, "mysql.primary.podAnnotations", cfg, Component, common.TypeMetaDeployment)
28+
customization = helm.CustomizeLabel(customization, "mysql.primary.podLabels", cfg, Component, common.TypeMetaDeployment)
29+
customization = helm.CustomizeAnnotation(customization, "mysql.primary.service.annotations", cfg, Component, common.TypeMetaService)
30+
2731
return &common.HelmConfig{
2832
Enabled: true,
2933
Values: &values.Options{
30-
Values: []string{
31-
helm.KeyValue("mysql.auth.existingSecret", SQLPasswordName),
32-
helm.KeyValue("mysql.auth.database", Database),
33-
helm.KeyValue("mysql.auth.username", Username),
34-
helm.KeyValue("mysql.initdbScriptsConfigMap", SQLInitScripts),
35-
helm.KeyValue("mysql.serviceAccount.name", Component),
36-
helm.ImagePullSecrets("mysql.image.pullSecrets", cfg),
37-
helm.KeyValue("mysql.image.registry", ""),
38-
helm.KeyValue("mysql.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/mysql")),
39-
helm.ImagePullSecrets("mysql.metrics.image.pullSecrets", cfg),
40-
helm.KeyValue("mysql.metrics.image.registry", ""),
41-
helm.KeyValue("mysql.metrics.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/mysqld-exporter")),
42-
helm.ImagePullSecrets("mysql.volumePermissions.image.pullSecrets", cfg),
43-
helm.KeyValue("mysql.volumePermissions.image.pullPolicy", "IfNotPresent"),
44-
helm.KeyValue("mysql.volumePermissions.image.registry", ""),
45-
helm.KeyValue("mysql.volumePermissions.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/bitnami-shell")),
34+
Values: append(
35+
[]string{
36+
helm.KeyValue("mysql.auth.existingSecret", SQLPasswordName),
37+
helm.KeyValue("mysql.auth.database", Database),
38+
helm.KeyValue("mysql.auth.username", Username),
39+
helm.KeyValue("mysql.initdbScriptsConfigMap", SQLInitScripts),
40+
helm.KeyValue("mysql.serviceAccount.name", Component),
41+
helm.ImagePullSecrets("mysql.image.pullSecrets", cfg),
42+
helm.KeyValue("mysql.image.registry", ""),
43+
helm.KeyValue("mysql.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/mysql")),
44+
helm.ImagePullSecrets("mysql.metrics.image.pullSecrets", cfg),
45+
helm.KeyValue("mysql.metrics.image.registry", ""),
46+
helm.KeyValue("mysql.metrics.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/mysqld-exporter")),
47+
helm.ImagePullSecrets("mysql.volumePermissions.image.pullSecrets", cfg),
48+
helm.KeyValue("mysql.volumePermissions.image.pullPolicy", "IfNotPresent"),
49+
helm.KeyValue("mysql.volumePermissions.image.registry", ""),
50+
helm.KeyValue("mysql.volumePermissions.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/bitnami-shell")),
4651

47-
// improve start time
48-
helm.KeyValue("mysql.primary.startupProbe.enabled", "false"),
49-
helm.KeyValue("mysql.primary.livenessProbe.initialDelaySeconds", "30"),
50-
},
52+
// improve start time
53+
helm.KeyValue("mysql.primary.startupProbe.enabled", "false"),
54+
helm.KeyValue("mysql.primary.livenessProbe.initialDelaySeconds", "30"),
55+
},
56+
customization...,
57+
),
5158
// This is too complex to be sent as a string
5259
FileValues: []string{
5360
primaryAffinityTemplate,

install/installer/pkg/components/minio/helm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ var Helm = common.CompositeHelmFunc(
2626
helm.KeyValue("minio.volumePermissions.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/bitnami-shell")),
2727
}
2828

29+
commonHelmValues = helm.CustomizeAnnotation(commonHelmValues, "minio.podAnnotations", cfg, Component, common.TypeMetaDeployment)
30+
commonHelmValues = helm.CustomizeLabel(commonHelmValues, "minio.podLabels", cfg, Component, common.TypeMetaDeployment)
31+
commonHelmValues = helm.CustomizeAnnotation(commonHelmValues, "minio.service.annotations", cfg, Component, common.TypeMetaService)
32+
2933
if cfg.Config.ObjectStorage.Resources != nil && cfg.Config.ObjectStorage.Resources.Requests.Memory() != nil {
3034
memoryRequests := resource.MustParse(cfg.Config.ObjectStorage.Resources.Requests.Memory().String())
3135
commonHelmValues = append(commonHelmValues, helm.KeyValue("minio.resources.requests.memory", memoryRequests.String()))

0 commit comments

Comments
 (0)