Skip to content

Commit

Permalink
add minio.claimSize param to configure the size of the Minio PVC
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Aug 20, 2021
1 parent 7ddaafc commit f89ba6f
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 5 deletions.
6 changes: 5 additions & 1 deletion addons/minio/2020-01-25T02-50-51Z/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ function minio_pre_init() {
if [ -z "$MINIO_NAMESPACE" ]; then
MINIO_NAMESPACE=minio
fi

if [ -z "$MINIO_CLAIM_SIZE" ]; then
MINIO_CLAIM_SIZE="10Gi"
fi
}

function minio() {
Expand All @@ -20,7 +24,7 @@ function minio() {
render_yaml_file "$src/tmpl-deployment-hostpath.yaml" > "$dst/deployment-hostpath.yaml"
insert_patches_strategic_merge "$dst/kustomization.yaml" deployment-hostpath.yaml
else
cp "$src/pvc.yaml" "$dst/"
render_yaml_file "$src/tmpl-pvc.yaml" > "$dst/pvc.yaml"
insert_resources "$dst/kustomization.yaml" pvc.yaml
render_yaml_file "$src/tmpl-deployment-pvc.yaml" > "$dst/deployment-pvc.yaml"
insert_patches_strategic_merge "$dst/kustomization.yaml" deployment-pvc.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ spec:
resources:
# This is the request for storage. Should be available in the cluster.
requests:
storage: 10Gi
storage: ${MINIO_CLAIM_SIZE}
26 changes: 26 additions & 0 deletions addons/minio/template/testgrid/k8s-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,29 @@
minio:
version: "__testver__"
s3Override: "__testdist__"

- installerSpec:
kubernetes:
version: "latest"
weave:
version: "latest"
longhorn:
version: "latest"
containerd:
version: "latest"
minio:
version: "__testver__"
# claimSize: "20Gi"
s3Override: "__testdist__"

- installerSpec:
kubernetes:
version: "latest"
weave:
version: "latest"
containerd:
version: "latest"
minio:
version: "__testver__"
hostPath: "/opt/minio"
s3Override: "__testdist__"
7 changes: 4 additions & 3 deletions kurl_util/cmd/yamltobash/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ func convertToBash(kurlValues map[string]interface{}, fieldsSet map[string]bool)
"MetricsServer.S3Override": "METRICS_SERVER_S3_OVERRIDE",
"MetricsServer.Version": "METRICS_SERVER_VERSION",
"Minio.Namespace": "MINIO_NAMESPACE",
"Minio.ClaimSize": "MINIO_CLAIM_SIZE",
"Minio.S3Override": "MINIO_S3_OVERRIDE",
"Minio.HostPath": "MINIO_HOSTPATH",
"Minio.Version": "MINIO_VERSION",
Expand Down Expand Up @@ -335,13 +336,13 @@ func convertToBash(kurlValues map[string]interface{}, fieldsSet map[string]bool)
}

switch {
case yamlKey == "Kubernetes.LoadBalancerAddress" && bashVal != "" :
case yamlKey == "Kubernetes.LoadBalancerAddress" && bashVal != "":
finalDictionary["HA_CLUSTER"] = "1"
case yamlKey == "Kurl.Airgap" && bashVal != "" :
case yamlKey == "Kurl.Airgap" && bashVal != "":
finalDictionary["OFFLINE_DOCKER_INSTALL"] = "1"
case yamlKey == "Weave.PodCidrRange" || yamlKey == "Kubernetes.ServiceCidrRange" || yamlKey == "Antrea.PodCidrRange" && bashVal != "":
bashVal = strings.Replace(bashVal, "/", "", -1)
case yamlKey == "Docker.HardFailOnLoopback" && bashVal == "" && !fieldsSet[yamlKey] :
case yamlKey == "Docker.HardFailOnLoopback" && bashVal == "" && !fieldsSet[yamlKey]:
bashVal = "1"
case yamlKey == "Weave.NoMasqLocal":

Expand Down
2 changes: 2 additions & 0 deletions kurlkinds/config/crds/v1beta1/cluster.kurl.sh_installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ spec:
type: object
minio:
properties:
claimSize:
type: string
hostPath:
type: string
namespace:
Expand Down
1 change: 1 addition & 0 deletions kurlkinds/pkg/apis/cluster/v1beta1/installer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ type Kurl struct {
}

type Minio struct {
ClaimSize string `json:"claimSize,omitempty" yaml:"claimSize,omitempty"`
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
S3Override string `json:"s3Override,omitempty" yaml:"s3Override,omitempty"`
HostPath string `json:"hostPath,omitempty" yaml:"hostPath,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions web/src/installers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export interface MinioConfig {
s3Override?: string;
namespace?: string;
hostPath?: string;
claimSize?: string;
}

export const minioConfigSchema = {
Expand All @@ -234,6 +235,7 @@ export const minioConfigSchema = {
s3Override: { type: "string", flag: "s3-override", description: "Override the download location for addon package distribution (used for CI/CD testing alpha addons)" },
namespace: { type: "string", flag: "minio-namespace", description: "The namespace Minio is installed to" },
hostPath: { type: "string", flag: "minio-hostpath", description: "Configure the minio deployment to use a local hostPath for storing data." },
claimSize: { type: "string", flag: "claim-size", description: "Configure the size of the Persistent Volume Claim that Minio will use, defaulting to 10Gi" },
},
required: ["version"],
additionalProperties: false,
Expand Down

0 comments on commit f89ba6f

Please sign in to comment.