Path: blob/main/install/installer/pkg/components/minio/incluster/minio.go
2504 views
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package incluster56import (7"fmt"89"github.com/gitpod-io/gitpod/installer/pkg/cluster"10"github.com/gitpod-io/gitpod/installer/pkg/common"11"github.com/gitpod-io/gitpod/installer/pkg/helm"12"github.com/gitpod-io/gitpod/installer/third_party/charts"13"helm.sh/helm/v3/pkg/cli/values"14)1516var Helm = func(apiPort int32, consolePort int32, commonHelmValues []string) common.HelmFunc {17return common.CompositeHelmFunc(18helm.ImportTemplate(charts.Minio(), helm.TemplateConfig{}, func(cfg *common.RenderContext) (*common.HelmConfig, error) {19affinity, err := helm.AffinityYaml(cluster.AffinityLabelMeta)20if err != nil {21return nil, err22}2324affinityTemplate, err := helm.KeyFileValue("minio.affinity", affinity)25if err != nil {26return nil, err27}2829tolerations, err := helm.WithTolerationWorkspaceComponentNotReadyYaml(cfg)30if err != nil {31return nil, err32}33tolerationsTemplate, err := helm.KeyFileValue("minio.tolerations", tolerations)34if err != nil {35return nil, err36}3738return &common.HelmConfig{39Enabled: true,40Values: &values.Options{41Values: append(42[]string{43helm.KeyValue("minio.auth.rootUser", cfg.Values.StorageAccessKey),44helm.KeyValue("minio.auth.rootPassword", cfg.Values.StorageSecretKey),45helm.KeyValue("minio.service.ports.api", fmt.Sprintf("%d", apiPort)),46helm.KeyValue("minio.service.ports.console", fmt.Sprintf("%d", consolePort)),47},48commonHelmValues...,49),50// This is too complex to be sent as a string51FileValues: []string{52affinityTemplate,53tolerationsTemplate,54},55},56}, nil57}),58)59}606162