Skip to content

Commit b8b96fd

Browse files
authored
db-operator 2.35.0 (#126)
--- Signed-off-by: Nikolai Rodionov <allanger@posteo.com>
1 parent 5fbbbca commit b8b96fd

14 files changed

Lines changed: 379 additions & 162 deletions

File tree

charts/db-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
apiVersion: v2
33
type: application
44
name: db-operator
5-
version: 3.11.0
5+
version: 3.12.0
66
description: This operator lets you manage databases in a Kubernetes native way, even if they are not deployed to Kubernetes
77
# All supported k8s versions are in the test:
88
# https://github.com/db-operator/charts/blob/main/.github/workflows/integration-test.yaml
99
kubeVersion: ">= 1.32-prerelease"
10-
appVersion: "2.34.0"
10+
appVersion: "2.35.0"
1111
home: https://github.com/db-operator
1212
maintainers:
1313
- name: Nikolai Rodionov

charts/db-operator/README.md

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# db-operator
22

3-
![Version: 3.11.0](https://img.shields.io/badge/Version-3.11.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.34.0](https://img.shields.io/badge/AppVersion-2.34.0-informational?style=flat-square)
3+
![Version: 3.12.0](https://img.shields.io/badge/Version-3.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.35.0](https://img.shields.io/badge/AppVersion-2.35.0-informational?style=flat-square)
44

55
This operator lets you manage databases in a Kubernetes native way, even if they are not deployed to Kubernetes
66

@@ -43,44 +43,17 @@ Kubernetes: `>= 1.32-prerelease`
4343
| controller.serviceAccount.name | string | `""` | |
4444
| controller.serviceAccount.create | bool | `true` | |
4545
| controller.rbac.create | bool | `true` | |
46-
| controller.args.reconcileInterval | string | `"60"` | |
47-
| controller.args.watchNamespace | string | `""` | |
48-
| controller.args.checkForChanges | bool | `false` | |
49-
| controller.serviceMonitor.enabled | bool | `false` | |
50-
| controller.config.instance.google.proxy.nodeSelector | object | `{}` | |
51-
| controller.config.instance.google.proxy.image | string | `"ghcr.io/db-operator/db-auth-gateway:v0.1.10"` | |
52-
| controller.config.instance.google.proxy.metricsPort | int | `9090` | |
53-
| controller.config.instance.generic | object | `{}` | |
54-
| controller.config.instance.percona.proxy.image | string | `"severalnines/proxysql:2.0"` | |
55-
| controller.config.instance.percona.proxy.metricsPort | int | `9090` | |
5646
| controller.config.backup.activeDeadlineSeconds | int | `600` | |
5747
| controller.config.backup.nodeSelector | object | `{}` | |
58-
| controller.config.backup.postgres.image | string | `"kloeckneri/pgdump-gcs:latest"` | |
59-
| controller.config.backup.mysql.image | string | `"kloeckneri/mydump-gcs:latest"` | |
48+
| controller.config.backup.postgres.image | string | `"ghcr.io/db-operator/pgdump-rclone:0.1.1"` | |
49+
| controller.config.backup.mysql.image | string | `"ghcr.io/db-operator/mydump-rclone:0.1.1"` | |
6050
| controller.config.backup.resources.requests.memory | string | `"64Mi"` | |
6151
| controller.config.backup.resources.requests.cpu | float | `0.2` | |
6252
| controller.config.monitoring.promPushGateway | string | `""` | |
63-
| controller.config.monitoring.nodeSelector | object | `{}` | |
64-
| controller.config.monitoring.postgres.image | string | `"wrouesnel/postgres_exporter:latest"` | |
65-
| controller.config.monitoring.postgres.queries.pg_stat_statements.query | string | `"SELECT userid, pgss.dbid, pgdb.datname, queryid, query, calls, total_time, mean_time, rows FROM pg_stat_statements pgss LEFT JOIN (select oid as dbid, datname from pg_database) as pgdb on pgdb.dbid = pgss.dbid WHERE not queryid isnull ORDER BY mean_time desc limit 20"` | |
66-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[0].userid.usage | string | `"LABEL"` | |
67-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[0].userid.description | string | `"User ID"` | |
68-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[1].dbid.usage | string | `"LABEL"` | |
69-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[1].dbid.description | string | `"database ID"` | |
70-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[2].datname.usage | string | `"LABEL"` | |
71-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[2].datname.description | string | `"database NAME"` | |
72-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[3].queryid.usage | string | `"LABEL"` | |
73-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[3].queryid.description | string | `"Query unique Hash Code"` | |
74-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[4].query.usage | string | `"LABEL"` | |
75-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[4].query.description | string | `"Query class"` | |
76-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[5].calls.usage | string | `"COUNTER"` | |
77-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[5].calls.description | string | `"Number of times executed"` | |
78-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[6].total_time.usage | string | `"COUNTER"` | |
79-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[6].total_time.description | string | `"Total time spent in the statement, in milliseconds"` | |
80-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[7].mean_time.usage | string | `"GAUGE"` | |
81-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[7].mean_time.description | string | `"Mean time spent in the statement, in milliseconds"` | |
82-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[8].rows.usage | string | `"COUNTER"` | |
83-
| controller.config.monitoring.postgres.queries.pg_stat_statements.metrics[8].rows.description | string | `"Total number of rows retrieved or affected by the statement"` | |
53+
| controller.args.reconcileInterval | string | `"60"` | |
54+
| controller.args.watchNamespace | string | `""` | |
55+
| controller.args.checkForChanges | bool | `false` | |
56+
| controller.serviceMonitor.enabled | bool | `false` | |
8457
| webhook.enabled | bool | `true` | |
8558
| webhook.logLevel | string | `"info"` | |
8659
| webhook.extraArgs | list | `[]` | |
@@ -106,4 +79,6 @@ Kubernetes: `>= 1.32-prerelease`
10679
| podLabels | object | `{}` | |
10780
| affinity | object | `{}` | |
10881
| tolerations | list | `[]` | |
82+
| secrets.gsql | object | `{}` | |
83+
| serviceMonitor.enabled | bool | `false` | |
10984

charts/db-operator/crd/kinda.rocks_databases.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ spec:
376376
type: string
377377
enable:
378378
type: boolean
379+
envFromSecret:
380+
type: string
379381
required:
380382
- cron
381383
- enable

charts/db-operator/templates/controller/config.yaml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,4 @@ metadata:
66
{{- include "db-operator.controller.labels" . | nindent 4 }}
77
data:
88
config.yaml: |
9-
instance:
10-
google:
11-
clientSecretName: "cloudsql-readonly-serviceaccount"
12-
proxy:
13-
nodeSelector:
14-
{{- toYaml .Values.controller.config.instance.google.proxy.nodeSelector | nindent 12 }}
15-
image: {{ .Values.controller.config.instance.google.proxy.image }}
16-
metricsPort: {{ .Values.controller.config.instance.google.proxy.metricsPort }}
17-
generic: {}
18-
percona:
19-
proxy:
20-
image: {{ .Values.controller.config.instance.percona.proxy.image }}
21-
backup:
22-
activeDeadlineSeconds: {{ .Values.controller.config.backup.activeDeadlineSeconds }}
23-
nodeSelector:
24-
{{- toYaml .Values.controller.config.backup.nodeSelector | nindent 8 }}
25-
postgres:
26-
image: {{ .Values.controller.config.backup.postgres.image }}
27-
mysql:
28-
image: {{ .Values.controller.config.backup.mysql.image }}
29-
resources:
30-
{{- toYaml .Values.controller.config.backup.resources | nindent 8 }}
31-
monitoring:
32-
{{- if .Values.controller.config.monitoring.promPushGateway }}
33-
promPushGateway: {{ .Values.controller.config.monitoring.promPushGateway }}
34-
{{- end }}
35-
nodeSelector:
36-
{{- toYaml .Values.controller.config.monitoring.nodeSelector | nindent 8 }}
37-
postgres:
38-
image: {{ .Values.controller.config.monitoring.postgres.image }}
39-
queries: |-
40-
{{- toYaml .Values.controller.config.monitoring.postgres.queries | nindent 10 }}
41-
mysql: {}
9+
{{- .Values.controller.config | toYaml | nindent 4 }}

charts/db-operator/values.yaml

Lines changed: 14 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -30,72 +30,27 @@ controller:
3030
create: true
3131
rbac:
3232
create: true
33-
args:
34-
reconcileInterval: "60"
35-
# watchNamespace value is comma-separated list of namespace names. It's necessary to set "" to watch cluster wide.
36-
watchNamespace: ""
37-
checkForChanges: false
38-
serviceMonitor:
39-
enabled: false
4033
config:
41-
instance:
42-
google:
43-
proxy:
44-
nodeSelector: {}
45-
image: ghcr.io/db-operator/db-auth-gateway:v0.1.10
46-
metricsPort: 9090
47-
generic: {}
48-
percona:
49-
proxy:
50-
image: severalnines/proxysql:2.0
51-
metricsPort: 9090
5234
backup:
53-
activeDeadlineSeconds: 600 # 10m
35+
activeDeadlineSeconds: 600
5436
nodeSelector: {}
5537
postgres:
56-
image: "kloeckneri/pgdump-gcs:latest"
38+
image: "ghcr.io/db-operator/pgdump-rclone:0.1.1"
5739
mysql:
58-
image: "kloeckneri/mydump-gcs:latest"
40+
image: "ghcr.io/db-operator/mydump-rclone:0.1.1"
5941
resources:
6042
requests:
6143
memory: 64Mi
6244
cpu: 0.2
6345
monitoring:
6446
promPushGateway: ""
65-
nodeSelector: {}
66-
postgres:
67-
image: wrouesnel/postgres_exporter:latest
68-
queries:
69-
pg_stat_statements:
70-
query: "SELECT userid, pgss.dbid, pgdb.datname, queryid, query, calls, total_time, mean_time, rows FROM pg_stat_statements pgss LEFT JOIN (select oid as dbid, datname from pg_database) as pgdb on pgdb.dbid = pgss.dbid WHERE not queryid isnull ORDER BY mean_time desc limit 20"
71-
metrics:
72-
- userid:
73-
usage: "LABEL"
74-
description: "User ID"
75-
- dbid:
76-
usage: "LABEL"
77-
description: "database ID"
78-
- datname:
79-
usage: "LABEL"
80-
description: "database NAME"
81-
- queryid:
82-
usage: "LABEL"
83-
description: "Query unique Hash Code"
84-
- query:
85-
usage: "LABEL"
86-
description: "Query class"
87-
- calls:
88-
usage: "COUNTER"
89-
description: "Number of times executed"
90-
- total_time:
91-
usage: "COUNTER"
92-
description: "Total time spent in the statement, in milliseconds"
93-
- mean_time:
94-
usage: "GAUGE"
95-
description: "Mean time spent in the statement, in milliseconds"
96-
- rows:
97-
usage: "COUNTER"
98-
description: "Total number of rows retrieved or affected by the statement"
47+
args:
48+
reconcileInterval: "60"
49+
# watchNamespace value is comma-separated list of namespace names. It's necessary to set "" to watch cluster wide.
50+
watchNamespace: ""
51+
checkForChanges: false
52+
serviceMonitor:
53+
enabled: false
9954

10055
webhook:
10156
enabled: true
@@ -159,25 +114,7 @@ annotations: {}
159114
podLabels: {}
160115
affinity: {}
161116
tolerations: []
162-
# interval: 10s
163-
# scrapeTimeout: 10s
164-
# jobLabel: db-operator
165-
# selector:
166-
# prometheus: my-prometheus
167-
# ## metric relabel configs to apply to samples before ingestion.
168-
# ##
169-
# metricRelabelings:
170-
# - sourceLabels: [__meta_kubernetes_service_label_cluster]
171-
# targetLabel: cluster
172-
# regex: (.*)
173-
# replacement: ${1}
174-
# action: replace
175-
# ## relabel configs to apply to samples after ingestion.
176-
# ##
177-
# relabelings:
178-
# - sourceLabels: [__meta_kubernetes_pod_node_name]
179-
# separator: ;
180-
# regex: ^(.*)$
181-
# targetLabel: nodename
182-
# replacement: $1
183-
# action: replace
117+
secrets:
118+
gsql: {}
119+
serviceMonitor:
120+
enabled: false

ci/helmfile.yaml.gotmpl

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ repositories:
1515
- name: cloudpirates
1616
url: registry-1.docker.io/cloudpirates
1717
oci: true
18+
- name: minio-standalone
19+
url: https://charts.min.io/
1820

1921
releases:
2022
- name: cert-manager
@@ -55,6 +57,53 @@ releases:
5557
serviceMonitorSelector: {}
5658
serviceMonitorSelectorNilUsesHelmValues: false
5759

60+
- name: minio
61+
namespace: minio
62+
chart: minio-standalone/minio
63+
version: 5.4.0
64+
createNamespace: true
65+
installed: {{ eq .Environment.Name "local-dev" }}
66+
values:
67+
- rootUser: 'root'
68+
rootPassword: 123123!!
69+
replicas: 1
70+
mode: standalone
71+
resources:
72+
requests:
73+
memory: 512Mi
74+
environment:
75+
MINIO_SERVER_URL: "http://minio.minio.svc.cluster.local:9000"
76+
tls:
77+
enabled: false
78+
persistence:
79+
enabled: true
80+
accessMode: ReadWriteOnce
81+
size: 1Gi
82+
service:
83+
type: ClusterIP
84+
clusterIP: ~
85+
port: '9000'
86+
consoleService:
87+
type: ClusterIP
88+
clusterIP: ~
89+
port: '9001'
90+
buckets:
91+
- name: backups
92+
policy: download
93+
purge: false
94+
policies:
95+
- name: backups
96+
statements:
97+
- resources:
98+
- 'arn:aws:s3:::backups'
99+
- 'arn:aws:s3:::backups/*'
100+
actions:
101+
- 's3:*'
102+
users:
103+
- accessKey: backups
104+
secretKey: qwertyu9
105+
policy: backups
106+
58107
- name: db-operator
59108
namespace: db-operator
60109
wait: true
@@ -70,7 +119,8 @@ releases:
70119
71120
values:
72121
- image:
73-
repository: localhost/my-db-operator
122+
registry: localhost
123+
repository: my-db-operator
74124
tag: v1.0.0-dev
75125
pullPolicy: Never
76126
{{- end }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
resources:
22
- ./mysql.yaml
33
- ./postgres.yaml
4+
- ./secret.yaml

ci/kustomize/databases/mysql.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ metadata:
44
name: mysql
55
spec:
66
backup:
7-
enable: false
7+
enable: true
8+
cron: '*/40 * * * *'
9+
bucket: backups
10+
envFromSecret: s3-creds
811
deletionProtected: false
912
instance: mariadb
1013
secretName: mysql-creds

ci/kustomize/databases/postgres.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,12 @@ metadata:
44
name: postgres
55
spec:
66
backup:
7-
enable: false
7+
enable: true
8+
cron: '*/40 * * * *'
9+
bucket: backups
10+
envFromSecret: s3-creds
811
deletionProtected: false
912
instance: postgres
1013
postgres: {}
1114
secretName: postgres-creds
1215
cleanup: true
13-
---
14-
apiVersion: kinda.rocks/v1beta1
15-
kind: Database
16-
metadata:
17-
name: postgres-2
18-
spec:
19-
backup:
20-
enable: false
21-
deletionProtected: false
22-
instance: postgres
23-
postgres: {}
24-
secretName: postgres-2-creds
25-
cleanup: true

ci/kustomize/databases/secret.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: s3-creds
6+
stringData:
7+
RCLONE_CONFIG_STORAGE_TYPE: s3
8+
RCLONE_CONFIG_STORAGE_PROVIDER: Minio
9+
RCLONE_CONFIG_STORAGE_ACCESS_KEY_ID: backups
10+
RCLONE_CONFIG_STORAGE_SECRET_ACCESS_KEY: qwertyu9
11+
RCLONE_CONFIG_STORAGE_ENDPOINT: http://minio.minio.svc.cluster.local:9000

0 commit comments

Comments
 (0)