Skip to content

Commit

Permalink
Merge pull request #368 from appuio/k8up-v2
Browse files Browse the repository at this point in the history
[k8up] K8up v2 support
  • Loading branch information
ccremer authored Nov 1, 2021
2 parents 4e50811 + 2b4ca62 commit 87a8291
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 150 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ make sure you are aware of our technical requirements and best practices:

#### Checklist
<!-- Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields. -->
- [ ] [DCO](https://github.com/appuio/charts/blob/master/CONTRIBUTING.md#sign-your-work) signed
- [ ] I have run `make docs`
- [ ] Variables are documented in the values.yaml using the format required by [Helm-Docs](https://github.com/norwoodj/helm-docs#valuesyaml-metadata).
- [ ] Title of the PR contains starts with chart name e.g. `[chart]`
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MAKEFLAGS += --warn-undefined-variables
MASTER_BRANCH=master
SOURCE_README=README.gotmpl
TARGET_README=README.md
CHARTS_DIR=charts/
CHARTS_DIR=appuio

HELM_DOCS_VERSION=v1.5.0

Expand Down Expand Up @@ -47,7 +47,7 @@ lint\:versions: ## Checks if chart versions have been changed
@echo " If this target fails, one of the listed charts below has not its version updated!"
@changed_charts=$$(git diff --dirstat=files,0 origin/master..HEAD -- appuio | cut -d '/' -f 2 | uniq) ; \
echo $$changed_charts ; echo ; \
for dir in $$changed_charts; do git diff origin/master..HEAD -- "appuio/$${dir}/Chart.yaml" | grep -H --label=$${dir} "+version"; done
for dir in $$changed_charts; do git diff origin/master..HEAD -- "$(CHARTS_DIR)/$${dir}/Chart.yaml" | grep -H --label=$${dir} "+version"; done

.PHONY: lint
lint: lint\:fmt lint\:vet ## All-in-one linting and checks for uncommitted changes
Expand Down
7 changes: 3 additions & 4 deletions appuio/k8up/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ keywords:
- backup
- operator
- restic
version: 1.1.0
appVersion: v1.2.0
version: 2.0.0
appVersion: v2.0.0
sources:
- https://github.com/vshn/k8up
- https://github.com/vshn/wrestic
- https://github.com/k8up-io/k8up
maintainers:
- name: APPUiO Team
email: [email protected]
13 changes: 9 additions & 4 deletions appuio/k8up/README.gotmpl.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
```bash
# Install CRDs for K8s >= 1.16:
kubectl apply -f https://github.com/vshn/k8up/releases/download/{{ template "chart.appVersion" . }}/k8up-crd.yaml
# Install CRDs for K8s <= 1.15 (e.g. OpenShift 3.11):
kubectl apply -f https://github.com/vshn/k8up/releases/download/{{ template "chart.appVersion" . }}/k8up-crd-legacy.yaml
kubectl apply -f https://github.com/k8up-io/k8up/releases/download/{{ template "chart.appVersion" . }}/k8up-crd.yaml
```

<!---
Expand Down Expand Up @@ -34,3 +31,11 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
* `replicaCount` is now configurable, defaults to `1`.
* Note: Deployment strategy type has changed from `Recreate` to `RollingUpdate`.
* CRDs need to be installed separately, they are no longer included in this chart.

## Upgrading from Charts 1.x to 2.x

* Note: `image.repository` changed from `vshn/k8up` to `k8up-io/k8up`.
* Note: `image.registry` changed from `quay.io` to `ghcr.io`.
* Note: `image.tag` changed from `v1.x` to `v2.x`. Please see the [full changelog](https://github.com/k8up-io/k8up/releases/tag/v2.0.0).
* `metrics.prometheusRule.legacyRules` has been removed (no support for OpenShift 3.11 anymore).
* Note: `k8up.backupImage.repository` changed from `quay.io/vshn/wrestic` to `ghcr.io/k8up-io/k8up` (`wrestic` is not needed anymore in K8up v2).
34 changes: 18 additions & 16 deletions appuio/k8up/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# k8up

![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![AppVersion: v1.2.0](https://img.shields.io/badge/AppVersion-v1.2.0-informational?style=flat-square)
![Version: 2.0.0](https://img.shields.io/badge/Version-2.0.0-informational?style=flat-square) ![AppVersion: v2.0.0](https://img.shields.io/badge/AppVersion-v2.0.0-informational?style=flat-square)

Kubernetes and OpenShift Backup Operator based on restic

Expand All @@ -13,10 +13,7 @@ helm repo add appuio https://charts.appuio.ch
helm install k8up appuio/k8up
```
```bash
# Install CRDs for K8s >= 1.16:
kubectl apply -f https://github.com/vshn/k8up/releases/download/v1.2.0/k8up-crd.yaml
# Install CRDs for K8s <= 1.15 (e.g. OpenShift 3.11):
kubectl apply -f https://github.com/vshn/k8up/releases/download/v1.2.0/k8up-crd-legacy.yaml
kubectl apply -f https://github.com/k8up-io/k8up/releases/download/v2.0.0/k8up-crd.yaml
```

<!---
Expand All @@ -32,8 +29,7 @@ Edit the README.gotmpl.md template instead.

## Source Code

* <https://github.com/vshn/k8up>
* <https://github.com/vshn/wrestic>
* <https://github.com/k8up-io/k8up>

<!---
The values below are generated with helm-docs!
Expand All @@ -46,13 +42,13 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| image.pullPolicy | string | `"IfNotPresent"` | Operator image pull policy |
| image.registry | string | `"quay.io"` | Operator image registry |
| image.repository | string | `"vshn/k8up"` | Operator image repository |
| image.tag | string | `"v1.2.0"` | Operator image tag (version) |
| image.registry | string | `"ghcr.io"` | Operator image registry |
| image.repository | string | `"k8up-io/k8up"` | Operator image repository |
| image.tag | string | `"v2.0.0"` | Operator image tag (version) |
| imagePullSecrets | list | `[]` | |
| k8up.backupImage.repository | string | `"quay.io/vshn/wrestic"` | The backup runner image repository |
| k8up.backupImage.tag | string | `"v0.3.2"` | The backup runner image tag |
| k8up.enableLeaderElection | bool | `true` | Specifies whether leader election should be enabled. Disable this for K8s versions < 1.16 |
| k8up.backupImage.repository | string | `"ghcr.io/k8up-io/k8up"` | The backup runner image repository |
| k8up.backupImage.tag | string | `"v2.0.0"` | The backup runner image tag |
| k8up.enableLeaderElection | bool | `true` | Specifies whether leader election should be enabled. |
| k8up.envVars | list | `[]` | envVars allows the specification of additional environment variables. See [values.yaml](values.yaml) how to specify See documentation which variables are supported. |
| k8up.globalResources | object | empty values | Specify the resource requests and limits that the Pods should have when they are scheduled by K8up. You are still able to override those via K8up resources, but this gives cluster administrators custom defaults. |
| k8up.globalResources.limits.cpu | string | `""` | Global CPU resource limit applied to jobs. See [supported units][resource-units]. |
Expand All @@ -66,7 +62,6 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
| metrics.prometheusRule.createDefaultRules | bool | `true` | Whether the default rules should be installed |
| metrics.prometheusRule.enabled | bool | `false` | Whether to enable PrometheusRule manifest for [Prometheus Operator][prometheus-operator] |
| metrics.prometheusRule.jobFailedRulesFor | list | `["archive","backup","check","prune","restore"]` | Create default rules for the given job types. Valid values are "archive", "backup", "check", "prune", and "restore". |
| metrics.prometheusRule.legacyRules | bool | `false` | Create default rules for kube-state-metrics < v1.5.0 Needed for OpenShift 3.x |
| metrics.prometheusRule.namespace | string | `""` | If the object should be installed in a different namespace than operator |
| metrics.service.nodePort | int | `0` | Service node port of the metrics endpoint, requires `metrics.service.type=NodePort` |
| metrics.service.port | int | `8080` | |
Expand Down Expand Up @@ -96,10 +91,17 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
* Note: Deployment strategy type has changed from `Recreate` to `RollingUpdate`.
* CRDs need to be installed separately, they are no longer included in this chart.

## Upgrading from Charts 1.x to 2.x

* Note: `image.repository` changed from `vshn/k8up` to `k8up-io/k8up`.
* Note: `image.registry` changed from `quay.io` to `ghcr.io`.
* Note: `image.tag` changed from `v1.x` to `v2.x`. Please see the [full changelog](https://github.com/k8up-io/k8up/releases/tag/v2.0.0).
* `metrics.prometheusRule.legacyRules` has been removed (no support for OpenShift 3.11 anymore).
* Note: `k8up.backupImage.repository` changed from `quay.io/vshn/wrestic` to `ghcr.io/k8up-io/k8up` (`wrestic` is not needed anymore in K8up v2).

## Source Code

* <https://github.com/vshn/k8up>
* <https://github.com/vshn/wrestic>
* <https://github.com/k8up-io/k8up>

<!---
Common/Useful Link references from values.yaml
Expand Down
2 changes: 1 addition & 1 deletion appuio/k8up/rbac-kustomize/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- github.com/vshn/k8up/config/rbac?ref=v1.2.0
- github.com/k8up-io/k8up/config/rbac?ref=v2.0.0

namePrefix: PREFIX-
namespace: "{{ .Release.Namespace }}"
Expand Down
1 change: 1 addition & 0 deletions appuio/k8up/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
- name: k8up-operator
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [ operator ]
env:
{{- with .Values.k8up.backupImage }}
- name: BACKUP_IMAGE
Expand Down
3 changes: 1 addition & 2 deletions appuio/k8up/templates/prometheus/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if and .Values.metrics.prometheusRule.enabled (or .Values.metrics.prometheusRule.createDefaultRules .Values.metrics.prometheusRule.additionalRules) -}}
{{- $jobNameLabel := ternary "job" "job_name" .Values.metrics.prometheusRule.legacyRules -}}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down Expand Up @@ -39,7 +38,7 @@ spec:
summary: "K8up jobs are stuck in {{ "{{ $labels.namespace }}" }} for the last 24 hours."
{{- range .Values.metrics.prometheusRule.jobFailedRulesFor }}
- alert: K8up{{- . | title -}}Failed
expr: (sum(kube_job_status_failed) by({{ $jobNameLabel }}, namespace) * on({{ $jobNameLabel }}, namespace) group_right() kube_job_labels{label_k8up_syn_tools_type="{{- . -}}"}) > 0
expr: (sum(kube_job_status_failed) by(job_name, namespace) * on(job_name, namespace) group_right() kube_job_labels{label_k8up_syn_tools_type="{{- . -}}"}) > 0
for: 1m
labels:
severity: critical
Expand Down
Loading

0 comments on commit 87a8291

Please sign in to comment.