Skip to content

Commit 20a78f1

Browse files
authored
Allow passing registry fqdn (#170)
``` helm template charts/stash --set features.enterprise=true --set global.registry=tamal --set global.registryFQDN=quay.io | grep quay helm template charts/stash --set features.enterprise=true --set global.registryFQDN=quay.io | grep quay ``` Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent f2688f6 commit 20a78f1

24 files changed

+98
-36
lines changed

apis/installer/v1alpha1/stash_catalog_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ type StashCatalog struct {
4343

4444
// StashCatalogSpec is the schema for Stash Postgres values file
4545
type StashCatalogSpec struct {
46+
RegistryFQDN string `json:"registryFQDN"`
4647
Image RegistryRef `json:"image"`
4748
WaitTimeout int64 `json:"waitTimeout"`
4849
Elasticsearch StashElasticsearchSpec `json:"elasticsearch"`

apis/installer/v1alpha1/stash_community_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type StashCommunitySpec struct {
4949
//+optional
5050
FullnameOverride string `json:"fullnameOverride"`
5151
ReplicaCount int32 `json:"replicaCount"`
52+
RegistryFQDN string `json:"registryFQDN"`
5253
Operator Container `json:"operator"`
5354
Pushgateway Container `json:"pushgateway"`
5455
Cleaner CleanerRef `json:"cleaner"`

apis/installer/v1alpha1/stash_enterprise_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type StashEnterpriseSpec struct {
4949
//+optional
5050
FullnameOverride string `json:"fullnameOverride"`
5151
ReplicaCount int32 `json:"replicaCount"`
52+
RegistryFQDN string `json:"registryFQDN"`
5253
Operator Container `json:"operator"`
5354
Pushgateway Container `json:"pushgateway"`
5455
Cleaner CleanerRef `json:"cleaner"`

apis/installer/v1alpha1/stash_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ type StashSpec struct {
5656
}
5757

5858
type GlobalValues struct {
59-
License string `json:"license"`
60-
Registry string `json:"registry"`
59+
License string `json:"license"`
60+
Registry string `json:"registry"`
61+
RegistryFQDN string `json:"registryFQDN"`
6162
//+optional
6263
ImagePullSecrets []core.LocalObjectReference `json:"imagePullSecrets"`
6364
SkipCleaner bool `json:"skipCleaner"`

charts/stash-catalog/README.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,33 @@ The command removes all the Kubernetes components associated with the chart and
4444

4545
The following table lists the configurable parameters of the `stash-catalog` chart and their default values.
4646

47-
| Parameter | Description | Default |
48-
|-----------------------------------------|---------------------------------------------------------------------------------------|---------------------|
49-
| image.registry | Docker registry used to pull Postgres addon image | `stashed` |
50-
| waitTimeout | Number of seconds to wait for the database to be ready before backup/restore process. | `300` |
51-
| elasticsearch.enabled | If true, deploys Elasticsearch addon | `true` |
52-
| elasticsearch.backup.args | Arguments to pass to `multielasticdump` command during backup process | `""` |
53-
| elasticsearch.restore.args | Arguments to pass to `multielasticdump` command during restore process | `""` |
54-
| mariadb.enabled | If true, deploys MariaDB addon | `true` |
55-
| mariadb.backup.args | Arguments to pass to `mariadbdump` command during bakcup process | `"--all-databases"` |
56-
| mariadb.restore.args | Arguments to pass to `mariadb` command during restore process | `""` |
57-
| mongodb.enabled | If true, deploys MongoDB addon | `true` |
58-
| mongodb.maxConcurrency | Maximum concurrency to perform backup or restore tasks | `3` |
59-
| mongodb.backup.args | Arguments to pass to `mongodump` command during backup process | `""` |
60-
| mongodb.restore.args | Arguments to pass to `mongorestore` command during restore process | `""` |
61-
| mysql.enabled | If true, deploys MySQL addon | `true` |
62-
| mysql.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
63-
| mysql.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
64-
| perconaxtradb.enabled | If true, deploys Percona XtraDB addon | `true` |
65-
| perconaxtradb.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
66-
| perconaxtradb.backup.socatRetry | Optional argument sent to backup script | `30` |
67-
| perconaxtradb.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
68-
| perconaxtradb.restore.targetAppReplicas | Optional argument sent to recovery script | `1` |
69-
| postgres.enabled | If true, deploys PostgreSQL addon | `true` |
70-
| postgres.backup.cmd | Postgres dump command, can either be: pg_dumpall or pg_dump | `"pg_dumpall"` |
71-
| postgres.backup.args | Arguments to pass to `backup.cmd` command during backup process | `""` |
72-
| postgres.restore.args | Arguments to pass to `psql` command during restore process | `""` |
47+
| Parameter | Description | Default |
48+
|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|---------------------|
49+
| registryFQDN | Docker registry fqdn used to pull Stash related images. Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image} | `""` |
50+
| image.registry | Docker registry used to pull Postgres addon image | `stashed` |
51+
| waitTimeout | Number of seconds to wait for the database to be ready before backup/restore process. | `300` |
52+
| elasticsearch.enabled | If true, deploys Elasticsearch addon | `true` |
53+
| elasticsearch.backup.args | Arguments to pass to `multielasticdump` command during backup process | `""` |
54+
| elasticsearch.restore.args | Arguments to pass to `multielasticdump` command during restore process | `""` |
55+
| mariadb.enabled | If true, deploys MariaDB addon | `true` |
56+
| mariadb.backup.args | Arguments to pass to `mariadbdump` command during bakcup process | `"--all-databases"` |
57+
| mariadb.restore.args | Arguments to pass to `mariadb` command during restore process | `""` |
58+
| mongodb.enabled | If true, deploys MongoDB addon | `true` |
59+
| mongodb.maxConcurrency | Maximum concurrency to perform backup or restore tasks | `3` |
60+
| mongodb.backup.args | Arguments to pass to `mongodump` command during backup process | `""` |
61+
| mongodb.restore.args | Arguments to pass to `mongorestore` command during restore process | `""` |
62+
| mysql.enabled | If true, deploys MySQL addon | `true` |
63+
| mysql.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
64+
| mysql.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
65+
| perconaxtradb.enabled | If true, deploys Percona XtraDB addon | `true` |
66+
| perconaxtradb.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
67+
| perconaxtradb.backup.socatRetry | Optional argument sent to backup script | `30` |
68+
| perconaxtradb.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
69+
| perconaxtradb.restore.targetAppReplicas | Optional argument sent to recovery script | `1` |
70+
| postgres.enabled | If true, deploys PostgreSQL addon | `true` |
71+
| postgres.backup.cmd | Postgres dump command, can either be: pg_dumpall or pg_dump | `"pg_dumpall"` |
72+
| postgres.backup.args | Arguments to pass to `backup.cmd` command during backup process | `""` |
73+
| postgres.restore.args | Arguments to pass to `psql` command during restore process | `""` |
7374

7475

7576
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:

charts/stash-catalog/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ Create the name of the service account to use
6565
Returns the registry used for catalog docker images
6666
*/}}
6767
{{- define "catalog.registry" -}}
68-
{{- .Values.image.registry }}
68+
{{- list .Values.registryFQDN .Values.image.registry | compact | join "/" }}
6969
{{- end }}

charts/stash-catalog/values.openapiv3_schema.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ properties:
142142
- enabled
143143
- restore
144144
type: object
145+
registryFQDN:
146+
type: string
145147
waitTimeout:
146148
format: int64
147149
type: integer
@@ -153,5 +155,6 @@ required:
153155
- mysql
154156
- perconaxtradb
155157
- postgres
158+
- registryFQDN
156159
- waitTimeout
157160
type: object

charts/stash-catalog/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5+
# Docker registry fqdn used to pull Stash related images.
6+
# Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image}
7+
registryFQDN: ""
58
image:
69
# Docker registry used to pull Postgres addon image
710
registry: stashed

charts/stash-community/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The following table lists the configurable parameters of the `stash-community` c
5151
| replicaCount | Number of stash operator replicas to create (only 1 is supported) | `1` |
5252
| license | License for the product. Get a license by following the steps from [here](https://stash.run/docs/latest/setup/install/community/#get-a-license). <br> Example: <br> `helm install appscode/stash \` <br> `--set-file license=/path/to/license/file` <br> `or` <br> `helm install appscode/stash \` <br> `--set license=<license file content>` | `""` |
5353
| licenseApiService | Name of the ApiService to use by the addon to identify the respective service and certificate for license verification request | `v1beta1.admission.stash.appscode.com` |
54+
| registryFQDN | Docker registry fqdn used to pull Stash related images. Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image} | `""` |
5455
| operator.registry | Docker registry used to pull operator image | `appscode` |
5556
| operator.repository | Name of operator container image | `stash` |
5657
| operator.tag | Operator container image tag | `v0.12.0` |

charts/stash-community/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ Returns the appscode license
7373
Returns the registry used for operator docker image
7474
*/}}
7575
{{- define "operator.registry" -}}
76-
{{- .Values.operator.registry }}
76+
{{- list .Values.registryFQDN .Values.operator.registry | compact | join "/" }}
7777
{{- end }}
7878

7979
{{/*
8080
Returns the registry used for cleaner docker image
8181
*/}}
8282
{{- define "cleaner.registry" -}}
83-
{{- .Values.cleaner.registry }}
83+
{{- list .Values.registryFQDN .Values.cleaner.registry | compact | join "/" }}
8484
{{- end }}
8585

8686
{{/*

0 commit comments

Comments
 (0)