Skip to content

Commit

Permalink
Allow passing registry fqdn (#170)
Browse files Browse the repository at this point in the history
```
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>
  • Loading branch information
tamalsaha authored Apr 7, 2021
1 parent f2688f6 commit 20a78f1
Show file tree
Hide file tree
Showing 24 changed files with 98 additions and 36 deletions.
1 change: 1 addition & 0 deletions apis/installer/v1alpha1/stash_catalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type StashCatalog struct {

// StashCatalogSpec is the schema for Stash Postgres values file
type StashCatalogSpec struct {
RegistryFQDN string `json:"registryFQDN"`
Image RegistryRef `json:"image"`
WaitTimeout int64 `json:"waitTimeout"`
Elasticsearch StashElasticsearchSpec `json:"elasticsearch"`
Expand Down
1 change: 1 addition & 0 deletions apis/installer/v1alpha1/stash_community_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type StashCommunitySpec struct {
//+optional
FullnameOverride string `json:"fullnameOverride"`
ReplicaCount int32 `json:"replicaCount"`
RegistryFQDN string `json:"registryFQDN"`
Operator Container `json:"operator"`
Pushgateway Container `json:"pushgateway"`
Cleaner CleanerRef `json:"cleaner"`
Expand Down
1 change: 1 addition & 0 deletions apis/installer/v1alpha1/stash_enterprise_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type StashEnterpriseSpec struct {
//+optional
FullnameOverride string `json:"fullnameOverride"`
ReplicaCount int32 `json:"replicaCount"`
RegistryFQDN string `json:"registryFQDN"`
Operator Container `json:"operator"`
Pushgateway Container `json:"pushgateway"`
Cleaner CleanerRef `json:"cleaner"`
Expand Down
5 changes: 3 additions & 2 deletions apis/installer/v1alpha1/stash_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ type StashSpec struct {
}

type GlobalValues struct {
License string `json:"license"`
Registry string `json:"registry"`
License string `json:"license"`
Registry string `json:"registry"`
RegistryFQDN string `json:"registryFQDN"`
//+optional
ImagePullSecrets []core.LocalObjectReference `json:"imagePullSecrets"`
SkipCleaner bool `json:"skipCleaner"`
Expand Down
53 changes: 27 additions & 26 deletions charts/stash-catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,33 @@ The command removes all the Kubernetes components associated with the chart and

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

| Parameter | Description | Default |
|-----------------------------------------|---------------------------------------------------------------------------------------|---------------------|
| image.registry | Docker registry used to pull Postgres addon image | `stashed` |
| waitTimeout | Number of seconds to wait for the database to be ready before backup/restore process. | `300` |
| elasticsearch.enabled | If true, deploys Elasticsearch addon | `true` |
| elasticsearch.backup.args | Arguments to pass to `multielasticdump` command during backup process | `""` |
| elasticsearch.restore.args | Arguments to pass to `multielasticdump` command during restore process | `""` |
| mariadb.enabled | If true, deploys MariaDB addon | `true` |
| mariadb.backup.args | Arguments to pass to `mariadbdump` command during bakcup process | `"--all-databases"` |
| mariadb.restore.args | Arguments to pass to `mariadb` command during restore process | `""` |
| mongodb.enabled | If true, deploys MongoDB addon | `true` |
| mongodb.maxConcurrency | Maximum concurrency to perform backup or restore tasks | `3` |
| mongodb.backup.args | Arguments to pass to `mongodump` command during backup process | `""` |
| mongodb.restore.args | Arguments to pass to `mongorestore` command during restore process | `""` |
| mysql.enabled | If true, deploys MySQL addon | `true` |
| mysql.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
| mysql.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
| perconaxtradb.enabled | If true, deploys Percona XtraDB addon | `true` |
| perconaxtradb.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
| perconaxtradb.backup.socatRetry | Optional argument sent to backup script | `30` |
| perconaxtradb.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
| perconaxtradb.restore.targetAppReplicas | Optional argument sent to recovery script | `1` |
| postgres.enabled | If true, deploys PostgreSQL addon | `true` |
| postgres.backup.cmd | Postgres dump command, can either be: pg_dumpall or pg_dump | `"pg_dumpall"` |
| postgres.backup.args | Arguments to pass to `backup.cmd` command during backup process | `""` |
| postgres.restore.args | Arguments to pass to `psql` command during restore process | `""` |
| Parameter | Description | Default |
|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|---------------------|
| registryFQDN | Docker registry fqdn used to pull Stash related images. Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image} | `""` |
| image.registry | Docker registry used to pull Postgres addon image | `stashed` |
| waitTimeout | Number of seconds to wait for the database to be ready before backup/restore process. | `300` |
| elasticsearch.enabled | If true, deploys Elasticsearch addon | `true` |
| elasticsearch.backup.args | Arguments to pass to `multielasticdump` command during backup process | `""` |
| elasticsearch.restore.args | Arguments to pass to `multielasticdump` command during restore process | `""` |
| mariadb.enabled | If true, deploys MariaDB addon | `true` |
| mariadb.backup.args | Arguments to pass to `mariadbdump` command during bakcup process | `"--all-databases"` |
| mariadb.restore.args | Arguments to pass to `mariadb` command during restore process | `""` |
| mongodb.enabled | If true, deploys MongoDB addon | `true` |
| mongodb.maxConcurrency | Maximum concurrency to perform backup or restore tasks | `3` |
| mongodb.backup.args | Arguments to pass to `mongodump` command during backup process | `""` |
| mongodb.restore.args | Arguments to pass to `mongorestore` command during restore process | `""` |
| mysql.enabled | If true, deploys MySQL addon | `true` |
| mysql.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
| mysql.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
| perconaxtradb.enabled | If true, deploys Percona XtraDB addon | `true` |
| perconaxtradb.backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
| perconaxtradb.backup.socatRetry | Optional argument sent to backup script | `30` |
| perconaxtradb.restore.args | Arguments to pass to `mysql` command during restore process | `""` |
| perconaxtradb.restore.targetAppReplicas | Optional argument sent to recovery script | `1` |
| postgres.enabled | If true, deploys PostgreSQL addon | `true` |
| postgres.backup.cmd | Postgres dump command, can either be: pg_dumpall or pg_dump | `"pg_dumpall"` |
| postgres.backup.args | Arguments to pass to `backup.cmd` command during backup process | `""` |
| postgres.restore.args | Arguments to pass to `psql` command during restore process | `""` |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
Expand Down
2 changes: 1 addition & 1 deletion charts/stash-catalog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ Create the name of the service account to use
Returns the registry used for catalog docker images
*/}}
{{- define "catalog.registry" -}}
{{- .Values.image.registry }}
{{- list .Values.registryFQDN .Values.image.registry | compact | join "/" }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/stash-catalog/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ properties:
- enabled
- restore
type: object
registryFQDN:
type: string
waitTimeout:
format: int64
type: integer
Expand All @@ -153,5 +155,6 @@ required:
- mysql
- perconaxtradb
- postgres
- registryFQDN
- waitTimeout
type: object
3 changes: 3 additions & 0 deletions charts/stash-catalog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# Docker registry fqdn used to pull Stash related images.
# Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image}
registryFQDN: ""
image:
# Docker registry used to pull Postgres addon image
registry: stashed
Expand Down
1 change: 1 addition & 0 deletions charts/stash-community/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The following table lists the configurable parameters of the `stash-community` c
| replicaCount | Number of stash operator replicas to create (only 1 is supported) | `1` |
| 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>` | `""` |
| 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` |
| registryFQDN | Docker registry fqdn used to pull Stash related images. Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image} | `""` |
| operator.registry | Docker registry used to pull operator image | `appscode` |
| operator.repository | Name of operator container image | `stash` |
| operator.tag | Operator container image tag | `v0.12.0` |
Expand Down
4 changes: 2 additions & 2 deletions charts/stash-community/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ Returns the appscode license
Returns the registry used for operator docker image
*/}}
{{- define "operator.registry" -}}
{{- .Values.operator.registry }}
{{- list .Values.registryFQDN .Values.operator.registry | compact | join "/" }}
{{- end }}

{{/*
Returns the registry used for cleaner docker image
*/}}
{{- define "cleaner.registry" -}}
{{- .Values.cleaner.registry }}
{{- list .Values.registryFQDN .Values.cleaner.registry | compact | join "/" }}
{{- end }}

{{/*
Expand Down
3 changes: 3 additions & 0 deletions charts/stash-community/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,8 @@ properties:
- repository
- tag
type: object
registryFQDN:
type: string
replicaCount:
format: int32
type: integer
Expand Down Expand Up @@ -1153,6 +1155,7 @@ required:
- monitoring
- operator
- pushgateway
- registryFQDN
- replicaCount
- security
- serviceAccount
Expand Down
3 changes: 3 additions & 0 deletions charts/stash-community/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ replicaCount: 1
license: ""
# Name of the ApiService to use by the addon to identify the respective service and certificate for license verification request
licenseApiService: v1beta1.admission.stash.appscode.com
# Docker registry fqdn used to pull Stash related images.
# Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image}
registryFQDN: ""
operator:
# Docker registry used to pull operator image
registry: appscode
Expand Down
1 change: 1 addition & 0 deletions charts/stash-enterprise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The following table lists the configurable parameters of the `stash-enterprise`
| replicaCount | Number of stash operator replicas to create (only 1 is supported) | `1` |
| license | License for the product. Get a license by following the steps from [here](https://stash.run/docs/latest/setup/install/enterprise#get-a-trial-license). <br> Example: <br> `helm install appscode/stash-enterprise \` <br> `--set-file license=/path/to/license/file` <br> `or` <br> `helm install appscode/stash-enterprise \` <br> `--set license=<license file content>` | `""` |
| 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` |
| registryFQDN | Docker registry fqdn used to pull Stash related images. Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image} | `""` |
| operator.registry | Docker registry used to pull operator image | `stashed` |
| operator.repository | Name of operator container image | `stash-enterprise` |
| operator.tag | Operator container image tag | `v0.12.0` |
Expand Down
Loading

0 comments on commit 20a78f1

Please sign in to comment.