Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/minio/helm.go
2501 views
1
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
// Minio is used for both in-cluster deployments and as a facade for non-GCP storage providers
6
7
package minio
8
9
import (
10
"github.com/gitpod-io/gitpod/installer/pkg/common"
11
"github.com/gitpod-io/gitpod/installer/pkg/components/minio/incluster"
12
"github.com/gitpod-io/gitpod/installer/pkg/helm"
13
"k8s.io/apimachinery/pkg/api/resource"
14
"k8s.io/utils/pointer"
15
)
16
17
var Helm = common.CompositeHelmFunc(
18
func(cfg *common.RenderContext) ([]string, error) {
19
imageRegistry := common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL)
20
21
commonHelmValues := []string{
22
helm.ImagePullSecrets("minio.image.pullSecrets", cfg),
23
helm.KeyValue("minio.image.registry", imageRegistry),
24
helm.ImagePullSecrets("minio.volumePermissions.image.pullSecrets", cfg),
25
helm.KeyValue("minio.volumePermissions.image.registry", imageRegistry),
26
}
27
28
if cfg.Config.ObjectStorage.Resources != nil && cfg.Config.ObjectStorage.Resources.Requests.Memory() != nil {
29
memoryRequests := resource.MustParse(cfg.Config.ObjectStorage.Resources.Requests.Memory().String())
30
commonHelmValues = append(commonHelmValues, helm.KeyValue("minio.resources.requests.memory", memoryRequests.String()))
31
}
32
33
if pointer.BoolDeref(cfg.Config.ObjectStorage.InCluster, false) {
34
return incluster.Helm(ServiceAPIPort, ServiceConsolePort, commonHelmValues)(cfg)
35
}
36
37
return nil, nil
38
},
39
)
40
41