Skip to content

Commit

Permalink
chore(cnpg): add retentionPolicy option for backups
Browse files Browse the repository at this point in the history
  • Loading branch information
SmaineTF1 committed Dec 5, 2024
1 parent d935234 commit b6baf9b
Show file tree
Hide file tree
Showing 40 changed files with 209 additions and 12,661 deletions.
12,507 changes: 0 additions & 12,507 deletions clusters/mycluster-0/flux-system/gotk-components.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions clusters/mycluster-0/flux-system/gotk-sync.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions clusters/mycluster-0/flux-system/kustomization.yaml

This file was deleted.

63 changes: 32 additions & 31 deletions clusters/mycluster-0/observability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,6 @@ spec:
name: victoria-metrics-k8s-stack
namespace: observability
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: observability-grafana-oncall
namespace: flux-system
spec:
interval: 3m0s
timeout: 10m0s
path: ./observability/mycluster-0/grafana-oncall
prune: true
sourceRef:
kind: GitRepository
name: flux-system
postBuild:
substitute:
domain_name: "cloud.ogenki.io"
substituteFrom:
- kind: ConfigMap
name: eks-mycluster-0-vars
dependsOn:
- name: observability-victoria-metrics-k8s-stack
healthChecks:
- apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
name: oncall
namespace: observability
- apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
name: oncall-valkey
namespace: observability
---
# The Grafana folders must be deployed first to avoid errors when dashboards are created
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
Expand Down Expand Up @@ -124,3 +93,35 @@ spec:
# kind: HelmRelease
# name: vector-agent
# namespace: observability
# Don't want to deploy OnCall every time, it's a bit heavy
# ---
# apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
# kind: Kustomization
# metadata:
# name: observability-grafana-oncall
# namespace: flux-system
# spec:
# interval: 3m0s
# timeout: 10m0s
# path: ./observability/base/grafana-oncall
# prune: true
# sourceRef:
# kind: GitRepository
# name: flux-system
# postBuild:
# substitute:
# domain_name: "cloud.ogenki.io"
# substituteFrom:
# - kind: ConfigMap
# name: eks-mycluster-0-vars
# dependsOn:
# - name: observability-victoria-metrics-k8s-stack
# healthChecks:
# - apiVersion: helm.toolkit.fluxcd.io/v2
# kind: HelmRelease
# name: oncall
# namespace: observability
# - apiVersion: helm.toolkit.fluxcd.io/v2
# kind: HelmRelease
# name: oncall-valkey
# namespace: observability
14 changes: 0 additions & 14 deletions crds/base/kustomization-rabbitmq-cluster-operator.yaml

This file was deleted.

1 change: 0 additions & 1 deletion crds/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ resources:
- kustomization-grafana-operator.yaml
- kustomization-kyverno.yaml
- kustomization-cloudnative-pg.yaml
- kustomization-rabbitmq-cluster-operator.yaml
- kustomization-victoria-metrics-operator.yaml
12 changes: 6 additions & 6 deletions dagger/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.32.0
go.opentelemetry.io/otel/trace v1.32.0
go.opentelemetry.io/proto/otlp v1.4.0
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
golang.org/x/net v0.31.0 // indirect
golang.org/x/sync v0.9.0
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d
golang.org/x/net v0.32.0 // indirect
golang.org/x/sync v0.10.0
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/grpc v1.68.0
google.golang.org/grpc v1.68.1
google.golang.org/protobuf v1.35.2 // indirect
)

Expand Down
24 changes: 12 additions & 12 deletions dagger/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1
go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d h1:0olWaB5pg3+oychR51GUVCEsGkeCU/2JxjBgIo4f3M0=
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
3 changes: 2 additions & 1 deletion flux/sources/helmrepo-bitnami.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ metadata:
name: bitnami
namespace: flux-system
spec:
type: "oci"
interval: 5m
url: https://charts.bitnami.com/bitnami
url: oci://registry-1.docker.io/bitnamicharts
3 changes: 2 additions & 1 deletion infrastructure/base/cloudnative-pg/grafana-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ kind: GrafanaDashboard
metadata:
name: databases-cloudnative-pg
spec:
allowCrossNamespaceImport: true
folderRef: "databases"
datasources:
- inputName: "DS_PROMETHEUS"
datasourceName: "VictoriaMetrics"
instanceSelector:
matchLabels:
dashboards: "grafana"
url: "https://grafana.com/api/dashboards/20417/revisions/1/download"
url: "https://grafana.com/api/dashboards/20417/revisions/3/download"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[package]
name = "cnpginstance"
edition = "v0.10.7"
version = "0.0.28"
version = "0.0.29"
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ if oxr.spec.cnpg:
s3Credentials = {
inheritFromIAMRole = True
}
wal = {
compression = "bzip2"
}
data = {
compression = "bzip2"
}
}
retentionPolicy = oxr.spec.cnpg.backup.retentionPolicy
}
if oxr.spec.cnpg?.createSuperuser:
superuserSecret = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ kcl_options:
backup:
schedule: "0 0 * * *"
bucketName: "myname-rds-instance-backups"
retentionPolicy: "10d"
initSQL: |
CREATE EXTENSION pg_stat_statements;
CREATE EXTENSION pg_trgm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
kind: KCLRun
spec:
target: Resources
source: oci://ttl.sh/ogenki-cnref/cnpginstance:v0.0.28-24h
source: oci://ttl.sh/ogenki-cnref/cnpginstance:v0.0.29-24h

- step: ready
functionRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ spec:
description: The name of the S3 bucket to store backups.
type: string
nullable: true
retentionPolicy:
description: The retention policy for backups.
type: string
default: "15d"
initSQL:
description: SQL to run on the primary instance after creation.
type: string
Expand Down
33 changes: 0 additions & 33 deletions infrastructure/base/rabbitmq-cluster-operator/helmrelease.yaml

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion infrastructure/mycluster-0/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ resources:
- ../base/cloudnative-pg
- ../base/external-dns
- ../base/gapi
- ../base/rabbitmq-cluster-operator
4 changes: 2 additions & 2 deletions observability/base/grafana-oncall/helmrelease-oncall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
kind: HelmRepository
name: grafana
namespace: observability
version: "1.13.5"
version: "1.13.6"
interval: 5m0s
timeout: 15m
install:
Expand Down Expand Up @@ -87,7 +87,7 @@ spec:
enabled: false

externalRedis:
host: oncall-valkey-master
host: oncall-valkey-primary
port: 6379
username: default
existingSecret: "oncall-valkey"
Expand Down
3 changes: 2 additions & 1 deletion observability/base/grafana-oncall/helmrelease-rabbitmq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
kind: HelmRepository
name: bitnami
namespace: flux-system
version: "15.0.6"
version: "15.1.0"
interval: 5m0s
timeout: 15m
install:
Expand Down Expand Up @@ -55,6 +55,7 @@ spec:
perObject:
enabled: true
detailed:
family: ["queue_coarse_metrics", "queue_consumer_count"]
enabled: true

prometheusRule:
Expand Down
4 changes: 2 additions & 2 deletions observability/base/grafana-oncall/helmrelease-valkey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
kind: HelmRepository
name: bitnami
namespace: flux-system
version: "1.0.2"
version: "2.1.1"
interval: 10m0s
install:
remediation:
Expand All @@ -23,7 +23,7 @@ spec:
existingSecret: "oncall-valkey"
existingSecretPasswordKey: "password"

master:
primary:
## Valkey master resource requests and limits
## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
## @param master.resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if master.resources is set (master.resources is recommended for production).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: kubernetes-karpenter
namespace: infrastructure
spec:
allowCrossNamespaceImport: true
folderRef: "kubernetes"
datasources:
- inputName: "DS_PROMETHEUS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: kubernetes-logs
namespace: infrastructure
spec:
allowCrossNamespaceImport: true
folderRef: "kubernetes"
datasources:
- inputName: "DS_LOKI"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: kubernetes-node-exporter-full
namespace: infrastructure
spec:
allowCrossNamespaceImport: true
folderRef: "kubernetes"
datasources:
- inputName: "DS_PROMETHEUS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: kubernetes-quick-search-logs
namespace: infrastructure
spec:
allowCrossNamespaceImport: true
folderRef: "kubernetes"
datasources:
- inputName: "DS_LOKI"
Expand Down
Loading

0 comments on commit b6baf9b

Please sign in to comment.