Skip to content

Commit

Permalink
Add option to use cloud storage in self-hosted mode (#200)
Browse files Browse the repository at this point in the history
Signed-off-by: Masudur Rahman <[email protected]>
  • Loading branch information
masudur-rahman authored Oct 10, 2023
1 parent c648926 commit dd84710
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 20 deletions.
4 changes: 3 additions & 1 deletion apis/installer/v1alpha1/ace_ace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,10 @@ const (

type InfraObjstore struct {
Provider ObjstoreProvider `json:"provider"`
Host string `json:"host"`
Bucket string `json:"bucket"`
Prefix string `json:"prefix,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Region string `json:"region,omitempty"`
MountPath string `json:"mountPath"`
S3 *S3Auth `json:"s3,omitempty"`
Azure *AzureAuth `json:"azure,omitempty"`
Expand Down
8 changes: 6 additions & 2 deletions apis/installer/v1alpha1/ace_options_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ type AceOptionsInfraCloudServices struct {
}

type AceOptionsInfraObjstore struct {
Host string `json:"host"`
Bucket string `json:"bucket"`
Bucket string `json:"bucket"`
Prefix string `json:"prefix,omitempty"`
// Required for s3 type buckets other than AWS s3 buckets
Endpoint string `json:"endpoint,omitempty"`
// Required for s3 buckets
Region string `json:"region,omitempty"`
Auth ObjstoreAuth `json:"auth"`
}

Expand Down
2 changes: 1 addition & 1 deletion apis/installer/v1alpha1/stash_presets_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ type S3 struct {
type S3Auth struct {
AwsAccessKeyID string `json:"AWS_ACCESS_KEY_ID"`
AwsSecretAccessKey string `json:"AWS_SECRET_ACCESS_KEY"`
CaCertData string `json:"CA_CERT_DATA"`
CaCertData string `json:"CA_CERT_DATA,omitempty"`
}

type Azure struct {
Expand Down
12 changes: 12 additions & 0 deletions charts/accounts-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ spec:
key: AWS_REGION
{{- end }}
{{- end }}
{{- if and (include "settings.objstoreSecretName" .) (eq $infra.objstore.provider "azure") }}
- name: AZURE_STORAGE_ACCOUNT
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_NAME
- name: AZURE_STORAGE_KEY
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_KEY
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
Expand Down
3 changes: 1 addition & 2 deletions charts/ace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ The following table lists the configurable parameters of the `ace` chart and the
| global.infra.dns.provider | | <code>"cloudflare" # external,cloudflare,route53</code> |
| global.infra.dns.auth.cloudflare.token | | <code>xyz</code> |
| global.infra.objstore.provider | | <code>"" # s3,azure,gcs,swift</code> |
| global.infra.objstore.host | might be a file storage prefixed with file:// | <code>""</code> |
| global.infra.objstore.bucket | | <code>gs://ace-data</code> |
| global.infra.objstore.bucket | might be a file storage prefixed with file:// | <code>gs://ace-data</code> |
| global.infra.objstore.mountPath | | <code>/data/credentials</code> |
| global.infra.stash.backup.password | | <code>""</code> |
| global.infra.stash.backup.schedule | | <code>'0 */4 * * *'</code> |
Expand Down
12 changes: 12 additions & 0 deletions charts/ace/templates/platform/setup-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ spec:
key: AWS_REGION
{{- end }}
{{- end }}
{{- if and (include "settings.objstoreSecretName" .) (eq $infra.objstore.provider "azure") }}
- name: AZURE_STORAGE_ACCOUNT
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_NAME
- name: AZURE_STORAGE_KEY
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_KEY
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
Expand Down
10 changes: 6 additions & 4 deletions charts/ace/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3785,6 +3785,8 @@ properties:
type: object
bucket:
type: string
endpoint:
type: string
gcs:
properties:
GOOGLE_PROJECT_ID:
Expand All @@ -3795,17 +3797,19 @@ properties:
- GOOGLE_PROJECT_ID
- GOOGLE_SERVICE_ACCOUNT_JSON_KEY
type: object
host:
type: string
mountPath:
type: string
prefix:
type: string
provider:
enum:
- gcs
- s3
- azure
- swift
type: string
region:
type: string
s3:
properties:
AWS_ACCESS_KEY_ID:
Expand All @@ -3817,7 +3821,6 @@ properties:
required:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- CA_CERT_DATA
type: object
swift:
properties:
Expand Down Expand Up @@ -3867,7 +3870,6 @@ properties:
type: object
required:
- bucket
- host
- mountPath
- provider
type: object
Expand Down
1 change: 0 additions & 1 deletion charts/ace/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ global:
objstore:
provider: "" # s3,azure,gcs,swift
# might be a file storage prefixed with file://
host: ""
bucket: gs://ace-data
mountPath: /data/credentials
# gcs:
Expand Down
12 changes: 12 additions & 0 deletions charts/billing/templates/processor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ spec:
key: AWS_REGION
{{- end }}
{{- end }}
{{- if and (include "settings.objstoreSecretName" .) (eq $infra.objstore.provider "azure") }}
- name: AZURE_STORAGE_ACCOUNT
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_NAME
- name: AZURE_STORAGE_KEY
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_KEY
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
Expand Down
12 changes: 12 additions & 0 deletions charts/billing/templates/summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ spec:
key: AWS_REGION
{{- end }}
{{- end }}
{{- if and (include "settings.objstoreSecretName" .) (eq $infra.objstore.provider "azure") }}
- name: AZURE_STORAGE_ACCOUNT
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_NAME
- name: AZURE_STORAGE_KEY
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_KEY
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
Expand Down
1 change: 0 additions & 1 deletion charts/kubestash-presets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ The following table lists the configurable parameters of the `kubestash-presets`
| kubestash.backend.s3.spec.bucket | | <code>""</code> |
| kubestash.backend.s3.auth.AWS_ACCESS_KEY_ID | | <code>""</code> |
| kubestash.backend.s3.auth.AWS_SECRET_ACCESS_KEY | | <code>""</code> |
| kubestash.backend.s3.auth.CA_CERT_DATA | | <code>""</code> |
| kubestash.backend.azure.spec.container | | <code>""</code> |
| kubestash.backend.azure.auth.AZURE_ACCOUNT_NAME | | <code>""</code> |
| kubestash.backend.azure.auth.AZURE_ACCOUNT_KEY | | <code>""</code> |
Expand Down
1 change: 0 additions & 1 deletion charts/kubestash-presets/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ properties:
required:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- CA_CERT_DATA
type: object
spec:
properties:
Expand Down
2 changes: 1 addition & 1 deletion charts/kubestash-presets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kubestash:
auth:
AWS_ACCESS_KEY_ID: ""
AWS_SECRET_ACCESS_KEY: ""
CA_CERT_DATA: ""
# CA_CERT_DATA: ""
azure:
spec:
container: ""
Expand Down
12 changes: 12 additions & 0 deletions charts/platform-api/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ spec:
key: AWS_REGION
{{- end }}
{{- end }}
{{- if and (include "settings.objstoreSecretName" .) (eq $infra.objstore.provider "azure") }}
- name: AZURE_STORAGE_ACCOUNT
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_NAME
- name: AZURE_STORAGE_KEY
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_KEY
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
Expand Down
12 changes: 12 additions & 0 deletions charts/platform-links/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ spec:
key: AWS_REGION
{{- end }}
{{- end }}
{{- if and (include "settings.objstoreSecretName" .) (eq $infra.objstore.provider "azure") }}
- name: AZURE_STORAGE_ACCOUNT
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_NAME
- name: AZURE_STORAGE_KEY
valueFrom:
secretRef:
name: {{ include "settings.objstoreSecretName" . }}
key: AZURE_ACCOUNT_KEY
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
Expand Down
1 change: 0 additions & 1 deletion charts/stash-presets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ The following table lists the configurable parameters of the `stash-presets` cha
| stash.backend.s3.spec.bucket | | <code>""</code> |
| stash.backend.s3.auth.AWS_ACCESS_KEY_ID | | <code>""</code> |
| stash.backend.s3.auth.AWS_SECRET_ACCESS_KEY | | <code>""</code> |
| stash.backend.s3.auth.CA_CERT_DATA | | <code>""</code> |
| stash.backend.azure.spec.container | | <code>""</code> |
| stash.backend.azure.auth.AZURE_ACCOUNT_NAME | | <code>""</code> |
| stash.backend.azure.auth.AZURE_ACCOUNT_KEY | | <code>""</code> |
Expand Down
1 change: 0 additions & 1 deletion charts/stash-presets/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ properties:
required:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- CA_CERT_DATA
type: object
spec:
properties:
Expand Down
2 changes: 1 addition & 1 deletion charts/stash-presets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ stash:
auth:
AWS_ACCESS_KEY_ID: ""
AWS_SECRET_ACCESS_KEY: ""
CA_CERT_DATA: ""
# CA_CERT_DATA: ""
azure:
spec:
container: ""
Expand Down
10 changes: 7 additions & 3 deletions schema/ace-options/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ properties:
required:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- CA_CERT_DATA
type: object
swift:
properties:
Expand Down Expand Up @@ -363,12 +362,17 @@ properties:
type: object
bucket:
type: string
host:
endpoint:
description: Required for s3 type buckets other than AWS s3 buckets
type: string
prefix:
type: string
region:
description: Required for s3 buckets
type: string
required:
- auth
- bucket
- host
type: object
provider:
enum:
Expand Down

0 comments on commit dd84710

Please sign in to comment.