seaweedfs-s3-secret.yaml 1.3 KB

1234567891011121314151617181920212223242526272829
  1. {{- if not (or .Values.filer.s3.skipAuthSecretCreation .Values.s3.skipAuthSecretCreation) }}
  2. {{- $access_key_admin := randAlphaNum 16 -}}
  3. {{- $secret_key_admin := randAlphaNum 32 -}}
  4. {{- $access_key_read := randAlphaNum 16 -}}
  5. {{- $secret_key_read := randAlphaNum 32 -}}
  6. apiVersion: v1
  7. kind: Secret
  8. type: Opaque
  9. metadata:
  10. name: seaweedfs-s3-secret
  11. namespace: {{ .Release.Namespace }}
  12. annotations:
  13. "helm.sh/resource-policy": keep
  14. "helm.sh/hook": "pre-install"
  15. stringData:
  16. admin_access_key_id: {{ $access_key_admin }}
  17. admin_secret_access_key: {{ $secret_key_admin }}
  18. read_access_key_id: {{ $access_key_read }}
  19. read_secret_access_key: {{ $secret_key_read }}
  20. seaweedfs_s3_config: '{"identities":[{"name":"anvAdmin","credentials":[{"accessKey":"{{ $access_key_admin }}","secretKey":"{{ $secret_key_admin }}"}],"actions":["Admin","Read","Write"]},{"name":"anvReadOnly","credentials":[{"accessKey":"{{ $access_key_read }}","secretKey":"{{ $secret_key_read }}"}],"actions":["Read"]}]}'
  21. {{- if .Values.filer.s3.auditLogConfig }}
  22. filer_s3_auditLogConfig.json: |
  23. {{ toJson .Values.filer.s3.auditLogConfig | nindent 4 }}
  24. {{- end }}
  25. {{- if .Values.s3.auditLogConfig }}
  26. s3_auditLogConfig.json: |
  27. {{ toJson .Values.s3.auditLogConfig | nindent 4 }}
  28. {{- end }}
  29. {{- end }}