---
version: 1
kind: component

requires:
- kubernetes
- helm

parameters:

- name: bucket
  parameters:
  - name: accessKey
  - name: secretKey
  - name: region
    value: us-east-1
  - name: name
    value: default

- name: storage.class
  value: default

- name: minio
  parameters:
  - name: namespace
    value: minio
    env: NAMESPACE
  - name: replicas
    value: 4
  - name:  existingClaim
    empty: allow
  - name: storageSize
    value: 20Gi
  - name: requests.memory
    value: 4Gi
  - name: mode
    value: distributed
  - name: requests.ram
    value: 1Gi
  - name: logLevel
    value: info

- name: helm
  parameters:
  - name: repo
    value: https://charts.min.io/
    env: HELM_REPO
  - name: chart
    env: HELM_CHART
    value: minio
  - name: version
    value: 5.0.4
    env: HELM_CHART_VERSION
  - name: baseValuesFile
    value: values.yaml
    env: CHART_VALUES_FILE

- name: docker
  parameters:
  - name: image
    value: quay.io/minio/minio
  - name: tag
    value: RELEASE.2022-12-12T19-27-27Z
  - name: mcImage
    value: quay.io/minio/mc
  - name: mcTag
    value: RELEASE.2022-12-13T00-23-28Z

- name: ingress
  parameters:
  - name: protocol
    value: http
  - name: hosts
    empty: allow
  - name: fileSize
    empty: allow
    value: 640m
  - name: class
    empty: allow

- name: nginx
  empty: allow
  parameters:
  - name: uploadTimeout
    value: "1800"
  - name: readTimeout
    value: "1800"

outputs:
- name: bucket.kind
  value: minio
- name: bucket.host
  value: minio.${minio.namespace}.svc
- name: bucket.port
  value: 9000
- name: bucket.name
- name: bucket.region
- name: bucket.endpoint
  value: http://minio.${minio.namespace}.svc:9000

templates:
  files:
  - "*.template"
  extra:
  - kind: go
    files:
    - "*.gotemplate"
