github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/helm/templates/storageprovider/cos.yaml (about)

     1  # cos is a storage provider for [Tencent Cloud Object Storage](https://cloud.tencent.com/product/cos)
     2  apiVersion: storage.kubeblocks.io/v1alpha1
     3  kind: StorageProvider
     4  metadata:
     5    name: cos
     6    labels:
     7      {{- include "kubeblocks.labels" . | nindent 4 }}
     8  spec:
     9    csiDriverName: ru.yandex.s3.csi
    10    csiDriverSecretTemplate: |
    11      accessKeyID: {{ `{{ index .Parameters "accessKeyId" }}` }}
    12      secretAccessKey: {{ `{{ index .Parameters "secretAccessKey" }}` }}
    13      {{ `{{- $region := index .Parameters "region" }}` }}
    14      {{ `{{- $endpoint := index .Parameters "endpoint" }}` }}
    15      {{ `{{- if not $endpoint }}` }}
    16        {{ `{{- $endpoint = (printf "https://cos.%s.myqcloud.com" $region) }}` }}
    17      {{ `{{- end }}` }}
    18      endpoint: {{ `{{ $endpoint }}` }}
    19  
    20    storageClassTemplate: |
    21      provisioner: ru.yandex.s3.csi
    22      parameters:
    23        mounter: geesefs
    24        # you can set mount options here, for example limit memory cache size (recommended)
    25        options: {{ `{{ printf "--memory-limit 1000 --dir-mode 0777 --file-mode 0666 %s --subdomain" (index .Parameters "mountOptions") }}` }}
    26        bucket: {{ `{{ index .Parameters "bucket" }}` }}
    27        csi.storage.k8s.io/provisioner-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
    28        csi.storage.k8s.io/provisioner-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
    29        csi.storage.k8s.io/controller-publish-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
    30        csi.storage.k8s.io/controller-publish-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
    31        csi.storage.k8s.io/node-stage-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
    32        csi.storage.k8s.io/node-stage-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
    33        csi.storage.k8s.io/node-publish-secret-name: {{ `{{ .CSIDriverSecretRef.Name }}` }}
    34        csi.storage.k8s.io/node-publish-secret-namespace: {{ `{{ .CSIDriverSecretRef.Namespace }}` }}
    35  
    36    datasafedConfigTemplate: |
    37      [storage]
    38      type = s3
    39      provider = TencentCOS
    40      env_auth = false
    41      access_key_id = {{ `{{ index .Parameters "accessKeyId" }}` }}
    42      secret_access_key = {{ `{{ index .Parameters "secretAccessKey" }}` }}
    43      endpoint = {{ `{{ printf "cos.%s.myqcloud.com" .Parameters.region }}` }}
    44      root = {{ `{{ index .Parameters "bucket" }}` }}
    45      chunk_size = 50Mi
    46  
    47    parametersSchema:
    48      openAPIV3Schema:
    49        type: "object"
    50        properties:
    51          region:
    52            type: string
    53            description: "COS region, e.g. cn-guangzhou"
    54          bucket:
    55            type: string
    56            description: "COS bucket"
    57          endpoint:
    58            type: string
    59            description: "COS endpoint (optional)"
    60          mountOptions:
    61            type: string
    62            description: "mount options for geesefs"
    63          accessKeyId:
    64            type: string
    65            description: "COS access key"
    66          secretAccessKey:
    67            type: string
    68            description: "COS secret key"
    69  
    70        required:
    71          - bucket
    72          - region
    73          - accessKeyId
    74          - secretAccessKey
    75  
    76      credentialFields:
    77        - accessKeyId
    78        - secretAccessKey