Skip to content

Commit

Permalink
Merge branch 'k8up-io:master' into add_insecure_tls
Browse files Browse the repository at this point in the history
  • Loading branch information
eunames authored Apr 1, 2024
2 parents f2bf064 + b16b4bf commit 970e98b
Show file tree
Hide file tree
Showing 65 changed files with 7,011 additions and 6,169 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download cr
uses: giantswarm/install-binary-action@v1.0.0
uses: giantswarm/install-binary-action@v1.1.0
with:
binary: cr
version: "1.4.0"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@v3
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
uses: ossf/scorecard-action@v2.3.1
with:
results_file: results.sarif
results_format: sarif
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ coverage/
.cache
_public/
_archive/
tmp/

.github/release-notes.md

Expand Down
6 changes: 6 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Community Code of Conduct

K8up observes the [CNCF Community Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).

The code of conduct is overseen by the K8up project maintainers.
Possible code of conduct violations should be emailed to the project maintainers [email protected].
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/alpine:3.17 as restic
FROM docker.io/library/alpine:3.19 as restic

RUN apk add --update --no-cache \
bash \
Expand All @@ -7,9 +7,9 @@ RUN apk add --update --no-cache \

COPY go.mod fetch_restic.sh ./
RUN ./fetch_restic.sh /usr/local/bin/restic \
&& /usr/local/bin/restic version
&& /usr/local/bin/restic version

FROM docker.io/library/alpine:3.17 as k8up
FROM docker.io/library/alpine:3.19 as k8up

ENTRYPOINT ["k8up"]

Expand Down
11 changes: 5 additions & 6 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# K8up Project Governance

Please note: K8up is a young Open Source project, evolved from the project sponsor [VSHN](https://www.vshn.ch/).
As such we're in the process of setting up a proper project governance.
As such, we're in the process of setting up a proper project governance.
If you have any wish, let use know via a [GitHub Discussion](https://github.com/k8up-io/k8up/discussions).

## Principles
Expand All @@ -11,7 +11,7 @@ The K8up community adheres to the following principles:
- Open: K8up is open source.
- Welcoming and respectful: See [Code of Conduct](#code-of-conduct).
- Transparent and accessible: Changes to the K8up organization, K8up code repositories,
and CNCF related activities (e.g. level, involvement, etc) are done in public.
and CNCF related activities (e.g. level, involvement, etc.) are done in public.
- Merit: Ideas and contributions are accepted according to their technical merit and alignment with
project objectives, scope, and design principles.

Expand All @@ -24,7 +24,7 @@ The K8up roadmap is on GitHub, see [Projects -> Roadmap](https://github.com/k8up
Every contribution is welcome.
Please see our [Contribution Guide](https://k8up.io/k8up/about/contribution_guide.html) how to best contribute.

## Github Project Administration
## GitHub Project Administration

The __k8up-io__ GitHub project maintainers team reflects the list of Maintainers.

Expand All @@ -35,12 +35,12 @@ As such, K8up might be involved in CNCF (or other CNCF projects) related marketi

## Code of Conduct

Please read our code of conduct here: https://k8up.io/k8up/about/code_of_conduct.html
Please read our code of conduct here: [CODE_OF_CONDUCT.md](https://github.com/k8up-io/k8up/blob/master/CODE_OF_CONDUCT.md).

The code of conduct is overseen by the K8up project maintainers.
Possible code of conduct violations should be emailed to the project maintainers [email protected].

If the possible violation is against one of the project maintainers that member will be recused from voting on the issue.
If the possible violation is against one of the project maintainers, that member will be recused from voting on the issue.
Such issues must be escalated to the appropriate CNCF contact, and CNCF may choose to intervene.

## DCO and Licenses
Expand All @@ -49,4 +49,3 @@ The following licenses and contributor agreements will be used for K8up projects

* [Apache 2.0](https://opensource.org/licenses/Apache-2.0) for code
* [Developer Certificate of Origin](https://developercertificate.org/) for new contributions

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MAKEFLAGS += --no-builtin-variables

.PHONY: help
help: ## Show this help
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
@grep -E -h '^[^#].+\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

# extensible array of targets. Modules can add target to this variable for the all-in-one target.
clean_targets := build-clean
Expand Down Expand Up @@ -54,7 +54,7 @@ run-restic: run ## Run the restic module. Use ARGS to pass arguments to the com
.PHONY: install
install: export KUBECONFIG = $(KIND_KUBECONFIG)
install: generate kind-setup ## Install CRDs into a cluster
kubectl apply $(KIND_KUBECTL_ARGS) -f $(CRD_ROOT_DIR)/v1
kubectl apply $(KIND_KUBECTL_ARGS) -f $(CRD_ROOT_DIR)/v1 --server-side

.PHONY: uninstall
uninstall: export KUBECONFIG = $(KIND_KUBECONFIG)
Expand Down
4 changes: 2 additions & 2 deletions Makefile.vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CRD_DOCS_REF_PATH ?= docs/modules/ROOT/pages/references/api-reference.adoc
SAMPLES_ROOT_DIR ?= config/samples
minio_sentinel = $(e2etest_dir)/minio_sentinel

KIND_NODE_VERSION ?= v1.24.4
KIND_NODE_VERSION ?= v1.26.6
KIND_KUBECONFIG ?= $(e2etest_dir)/kind-kubeconfig-$(KIND_NODE_VERSION)
KIND_CLUSTER ?= k8up-$(KIND_NODE_VERSION)
KIND_KUBECTL_ARGS ?= --validate=true
Expand All @@ -46,4 +46,4 @@ K8UP_QUAY_IMG ?= quay.io/k8up-io/k8up:$(IMG_TAG)
ENVTEST_ADDITIONAL_FLAGS ?= --bin-dir "$(go_bin)"
INTEGRATION_TEST_DEBUG_OUTPUT ?= false
# See https://storage.googleapis.com/kubebuilder-tools/ for list of supported K8s versions
ENVTEST_K8S_VERSION = 1.24.x
ENVTEST_K8S_VERSION = 1.26.x
8 changes: 7 additions & 1 deletion OWNERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ This will be built up when time comes.

## Maintainers

We document the list of maintainers in the [GitHub team "Maintainer"](https://github.com/orgs/k8up-io/teams/maintainer/members).
* Tobias Brunner <[email protected]> ([tobru](https://github.com/tobru))
* Simon Beck <[email protected]> ([Kidswiss](https://github.com/Kidswiss))
* Nicolas Bigler <[email protected]> ([TheBigLee](https://github.com/TheBigLee))
* Łukasz Widera <[email protected]> ([wejdross](https://github.com/wejdross))
* Gabriel Saratura <[email protected]> ([zugao](https://github.com/zugao))

We also document the list of maintainers in the [GitHub team "Maintainer"](https://github.com/orgs/k8up-io/teams/maintainer/members).

## Reviewers

Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ K8up is a Kubernetes backup operator based on [Restic](https://restic.readthedoc
Just create a `schedule` and a `credentials` object in the namespace you’d like to backup.
It’s that easy. K8up takes care of the rest. It also provides a Prometheus endpoint for monitoring.

K8up is production ready. It is used in production deployments since 2019.

## Documentation

The documentation is written in AsciiDoc and published with Antora to [k8up.io](https://k8up.io/).
Expand Down Expand Up @@ -141,7 +143,19 @@ make clean
There are a number of example configurations in [`config/samples`](config/samples).
Apply them using `kubectl apply -f config/samples/somesample.yaml`

### Code of Conduct
# Community

Read more about our community [in the documentation](https://k8up.io/k8up/about/community.html).

## Chat with us

The K8up project is present in the [CNCF Slack Workspace](https://slack.cncf.io/) in the [#k8up channel](https://app.slack.com/client/T08PSQ7BQ/C06GP0D5FEF).

## Monthly community meeting

We host a monthly community meeting. For more information, head over to [the community documentation](https://k8up.io/k8up/about/community.html).

## Code of Conduct

Our code of conduct can be read at [k8up.io](https://k8up.io/k8up/about/code_of_conduct.html).

Expand Down
14 changes: 11 additions & 3 deletions api/v1/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v1
import (
"fmt"
"reflect"
"strings"

corev1 "k8s.io/api/core/v1"

Expand Down Expand Up @@ -204,6 +205,7 @@ func (in *GCSSpec) String() string {

type AzureSpec struct {
Container string `json:"container,omitempty"`
Path string `json:"path,omitempty"`
AccountNameSecretRef *corev1.SecretKeySelector `json:"accountNameSecretRef,omitempty"`
AccountKeySecretRef *corev1.SecretKeySelector `json:"accountKeySecretRef,omitempty"`
}
Expand All @@ -215,9 +217,14 @@ func (in *AzureSpec) EnvVars(vars map[string]*corev1.EnvVarSource) map[string]*c
return vars
}

// String returns "azure:container:/"
// String returns "azure:container:path"
// If Path is empty, the default value "/" will be used as path
func (in *AzureSpec) String() string {
return fmt.Sprintf("azure:%s:/", in.Container)
path := "/"
if in.Path != "" {
path = in.Path
}
return fmt.Sprintf("azure:%s:%s", in.Container, path)
}

type SwiftSpec struct {
Expand Down Expand Up @@ -269,5 +276,6 @@ func (in *RestServerSpec) EnvVars(vars map[string]*corev1.EnvVarSource) map[stri

// String returns "rest:URL"
func (in *RestServerSpec) String() string {
return fmt.Sprintf("rest:%s", in.URL)
protocol, url, _ := strings.Cut(in.URL, "://")
return fmt.Sprintf("rest:%s://%s:%s@%s", protocol, "$(USER)", "$(PASSWORD)", url)
}
17 changes: 16 additions & 1 deletion api/v1/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ var tests = map[string]struct {
},
expectedRepositoryString: "azure:container:/",
},
"GivenAzureBackendAndPath_ThenExpectAzureContainerWithCustomPath": {
givenBackend: &Backend{
Azure: &AzureSpec{
Container: "container",
Path: "foo",
AccountNameSecretRef: newSecretRef("name"),
AccountKeySecretRef: newSecretRef("key"),
},
},
expectedVars: map[string]*corev1.EnvVarSource{
cfg.AzureAccountEnvName: {SecretKeyRef: newSecretRef("name")},
cfg.AzureAccountKeyEnvName: {SecretKeyRef: newSecretRef("key")},
},
expectedRepositoryString: "azure:container:foo",
},
"GivenB2Backend_ThenExpectB2BucketAndPath": {
givenBackend: &Backend{
B2: &B2Spec{
Expand Down Expand Up @@ -103,7 +118,7 @@ var tests = map[string]struct {
cfg.RestPasswordEnvName: {SecretKeyRef: newSecretRef("password")},
cfg.RestUserEnvName: {SecretKeyRef: newSecretRef("user")},
},
expectedRepositoryString: "rest:https://server",
expectedRepositoryString: "rest:https://$(USER):$(PASSWORD)@server",
},
}

Expand Down
1 change: 0 additions & 1 deletion api/v1/zz_generated.deepcopy.go

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

81 changes: 45 additions & 36 deletions charts/go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
module charts

go 1.19
go 1.22

toolchain go1.22.1

require (
github.com/norwoodj/helm-docs v1.11.0
github.com/norwoodj/helm-docs v1.13.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.59.2
)

require (
cloud.google.com/go v0.83.0 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/aws/aws-sdk-go v1.40.56 // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 // indirect
Expand All @@ -23,7 +26,7 @@ require (
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-sql-driver/mysql v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/gruntwork-io/go-commons v0.8.0 // indirect
Expand All @@ -39,16 +42,24 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pquerna/otp v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/urfave/cli v1.22.2 // indirect
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
k8s.io/klog/v2 v2.80.0 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 // indirect
Expand All @@ -59,39 +70,37 @@ require (

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gruntwork-io/terratest v0.40.22
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.1 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v0.0.5 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.4.0 // indirect
github.com/stretchr/testify v1.8.1
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/text v0.3.7 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.25.3
k8s.io/apimachinery v0.25.3
k8s.io/client-go v0.24.2 // indirect
k8s.io/helm v2.14.3+incompatible // indirect
k8s.io/helm v2.17.0+incompatible // indirect
)
Loading

0 comments on commit 970e98b

Please sign in to comment.