Skip to content

Commit

Permalink
Merge branch 'master' into etcd-WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush1146115 authored Oct 8, 2021
2 parents 9db4e4e + a088dcd commit cf3f2e0
Show file tree
Hide file tree
Showing 65 changed files with 1,942 additions and 92 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Check out code into the Go module directory
Expand All @@ -40,6 +40,15 @@ jobs:
run: |
make ci
- name: Check metrics configuration
run: |
# install metrics-configuration-checker
curl -fsSL -o metrics-configuration-checker https://github.com/kmodules/metrics-configuration-checker/releases/download/v0.0.1/metrics-configuration-checker-linux-amd64
chmod +x metrics-configuration-checker
sudo mv metrics-configuration-checker /usr/local/bin/metrics-configuration-checker
# check stash-metrics chart
metrics-configuration-checker --content=./charts/stash-metrics/templates/
kubernetes:
name: Kubernetes
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS)
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

BASEIMAGE_PROD ?= gcr.io/distroless/static:nonroot
BASEIMAGE_PROD ?= gcr.io/distroless/static-debian10
BASEIMAGE_DBG ?= debian:buster

GO_VERSION ?= 1.16
GO_VERSION ?= 1.17
BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)
CHART_TEST_IMAGE ?= quay.io/helmpack/chart-testing:v3.4.0

Expand Down
24 changes: 24 additions & 0 deletions apis/installer/v1alpha1/stash_catalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type StashCatalogSpec struct {
PerconaXtraDB StashPerconaXtraDBSpec `json:"perconaxtradb"`
Postgres StashPostgresSpec `json:"postgres"`
Redis StashRedisSpec `json:"redis"`
NATS StashNATSSpec `json:"nats"`
}

// StashElasticsearchSpec is the schema for Stash Elasticsearch values file
Expand Down Expand Up @@ -180,6 +181,29 @@ type RedisRestore struct {
Args string `json:"args"`
}

// StashNATSSpec is the schema for Stash NATS values file
type StashNATSSpec struct {
Enabled bool `json:"enabled"`
Backup NATSBackup `json:"backup"`
Restore NATSRestore `json:"restore"`
}

type NATSBackup struct {
// +optional
Args string `json:"args"`
// +optional
Streams []string `json:"streams"`
}

type NATSRestore struct {
// +optional
Args string `json:"args"`
// +optional
Streams []string `json:"streams"`
// +optional
Overwrite bool `json:"overwrite"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// StashCatalogList is a list of StashCatalogs
Expand Down
66 changes: 64 additions & 2 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions catalog/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"4.1.7-v11",
"4.1.13-v11",
"4.2.3-v11",
"4.4.6-v2"
"4.4.6-v2",
"5.0.3"
]
},
{
Expand All @@ -47,6 +48,12 @@
"8.0.21-v6"
]
},
{
"name": "nats",
"versions": [
"2.4.0"
]
},
{
"name": "percona-xtradb",
"versions": [
Expand All @@ -60,7 +67,8 @@
"10.14-v10",
"11.9-v10",
"12.4-v10",
"13.1-v7"
"13.1-v7",
"14.0"
]
},
{
Expand Down
38 changes: 38 additions & 0 deletions catalog/raw/mongodb/5.0.3/mongodb-backup-function.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: stash.appscode.com/v1beta1
kind: Function
metadata:
name: mongodb-backup-5.0.3
spec:
args:
- backup-mongo
- --provider=${REPOSITORY_PROVIDER:=}
- --bucket=${REPOSITORY_BUCKET:=}
- --endpoint=${REPOSITORY_ENDPOINT:=}
- --region=${REPOSITORY_REGION:=}
- --path=${REPOSITORY_PREFIX:=}
- --secret-dir=/etc/repository/secret
- --scratch-dir=/tmp
- --enable-cache=${ENABLE_CACHE:=true}
- --max-connections=${MAX_CONNECTIONS:=0}
- --hostname=${HOSTNAME:=}
- --mongo-args=${args:=}
- --max-concurrency=${MAX_CONCURRENCY:=3}
- --wait-timeout=${waitTimeout:=300}
- --namespace=${NAMESPACE:=default}
- --appbinding=${TARGET_NAME:=}
- --backupsession=${BACKUP_SESSION:=}
- --retention-keep-last=${RETENTION_KEEP_LAST:=0}
- --retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0}
- --retention-keep-daily=${RETENTION_KEEP_DAILY:=0}
- --retention-keep-weekly=${RETENTION_KEEP_WEEKLY:=0}
- --retention-keep-monthly=${RETENTION_KEEP_MONTHLY:=0}
- --retention-keep-yearly=${RETENTION_KEEP_YEARLY:=0}
- --retention-keep-tags=${RETENTION_KEEP_TAGS:=}
- --retention-prune=${RETENTION_PRUNE:=false}
- --retention-dry-run=${RETENTION_DRY_RUN:=false}
- --output-dir=${outputDir:=}
- --license-apiservice=${LICENSE_APISERVICE:=}
image: stashed/stash-mongodb:5.0.3
volumeMounts:
- mountPath: /etc/repository/secret
name: ${secretVolume}
22 changes: 22 additions & 0 deletions catalog/raw/mongodb/5.0.3/mongodb-backup-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: stash.appscode.com/v1beta1
kind: Task
metadata:
name: mongodb-backup-5.0.3
spec:
steps:
- name: mongodb-backup-5.0.3
params:
- name: outputDir
value: /tmp/output
- name: secretVolume
value: secret-volume
- name: update-status
params:
- name: outputDir
value: /tmp/output
- name: secretVolume
value: secret-volume
volumes:
- name: secret-volume
secret:
secretName: ${REPOSITORY_SECRET_NAME}
31 changes: 31 additions & 0 deletions catalog/raw/mongodb/5.0.3/mongodb-restore-function.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: stash.appscode.com/v1beta1
kind: Function
metadata:
name: mongodb-restore-5.0.3
spec:
args:
- restore-mongo
- --provider=${REPOSITORY_PROVIDER:=}
- --bucket=${REPOSITORY_BUCKET:=}
- --endpoint=${REPOSITORY_ENDPOINT:=}
- --region=${REPOSITORY_REGION:=}
- --path=${REPOSITORY_PREFIX:=}
- --secret-dir=/etc/repository/secret
- --scratch-dir=/tmp
- --enable-cache=false
- --max-connections=${MAX_CONNECTIONS:=0}
- --hostname=${HOSTNAME:=}
- --source-hostname=${SOURCE_HOSTNAME:=}
- --mongo-args=${args:=}
- --max-concurrency=${MAX_CONCURRENCY:=3}
- --wait-timeout=${waitTimeout:=300}
- --namespace=${NAMESPACE:=default}
- --appbinding=${TARGET_NAME:=}
- --restoresession=${RESTORE_SESSION:=}
- --snapshot=${RESTORE_SNAPSHOTS:=}
- --output-dir=${outputDir:=}
- --license-apiservice=${LICENSE_APISERVICE:=}
image: stashed/stash-mongodb:5.0.3
volumeMounts:
- mountPath: /etc/repository/secret
name: ${secretVolume}
22 changes: 22 additions & 0 deletions catalog/raw/mongodb/5.0.3/mongodb-restore-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: stash.appscode.com/v1beta1
kind: Task
metadata:
name: mongodb-restore-5.0.3
spec:
steps:
- name: mongodb-restore-5.0.3
params:
- name: outputDir
value: /tmp/output
- name: secretVolume
value: secret-volume
- name: update-status
params:
- name: outputDir
value: /tmp/output
- name: secretVolume
value: secret-volume
volumes:
- name: secret-volume
secret:
secretName: ${REPOSITORY_SECRET_NAME}
39 changes: 39 additions & 0 deletions catalog/raw/nats/2.4.0/nats-backup-function.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: stash.appscode.com/v1beta1
kind: Function
metadata:
name: nats-backup-2.4.0
spec:
args:
- backup-nats
- --provider=${REPOSITORY_PROVIDER:=}
- --bucket=${REPOSITORY_BUCKET:=}
- --endpoint=${REPOSITORY_ENDPOINT:=}
- --region=${REPOSITORY_REGION:=}
- --path=${REPOSITORY_PREFIX:=}
- --secret-dir=/etc/repository/secret
- --scratch-dir=/tmp
- --enable-cache=${ENABLE_CACHE:=true}
- --max-connections=${MAX_CONNECTIONS:=0}
- --hostname=${HOSTNAME:=}
- --interim-data-dir=${INTERIM_DATA_DIR}
- --nats-args=${args:=}
- --streams=${streams:=}
- --wait-timeout=${waitTimeout:=300}
- --namespace=${NAMESPACE:=default}
- --appbinding=${TARGET_NAME:=}
- --backupsession=${BACKUP_SESSION:=}
- --retention-keep-last=${RETENTION_KEEP_LAST:=0}
- --retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0}
- --retention-keep-daily=${RETENTION_KEEP_DAILY:=0}
- --retention-keep-weekly=${RETENTION_KEEP_WEEKLY:=0}
- --retention-keep-monthly=${RETENTION_KEEP_MONTHLY:=0}
- --retention-keep-yearly=${RETENTION_KEEP_YEARLY:=0}
- --retention-keep-tags=${RETENTION_KEEP_TAGS:=}
- --retention-prune=${RETENTION_PRUNE:=false}
- --retention-dry-run=${RETENTION_DRY_RUN:=false}
- --output-dir=${outputDir:=}
- --license-apiservice=${LICENSE_APISERVICE:=}
image: stashed/stash-nats:2.4.0
volumeMounts:
- mountPath: /etc/repository/secret
name: ${secretVolume}
22 changes: 22 additions & 0 deletions catalog/raw/nats/2.4.0/nats-backup-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: stash.appscode.com/v1beta1
kind: Task
metadata:
name: nats-backup-2.4.0
spec:
steps:
- name: nats-backup-2.4.0
params:
- name: outputDir
value: /tmp/output
- name: secretVolume
value: secret-volume
- name: update-status
params:
- name: outputDir
value: /tmp/output
- name: secretVolume
value: secret-volume
volumes:
- name: secret-volume
secret:
secretName: ${REPOSITORY_SECRET_NAME}
Loading

0 comments on commit cf3f2e0

Please sign in to comment.