From 5181f962bab14a5a234ea1ff7d49429b742ee52f Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 14 Aug 2026 14:57:10 +0200 Subject: [PATCH 1/6] Update db-operator to 2.45.1 Signed-off-by: Nikolai Rodionov --- .github/workflows/integration-tests.yaml | 1 - charts/db-instances/Chart.yaml | 2 +- charts/db-instances/README.md | 2 +- charts/db-instances/ci/ci-2-values.yaml | 19 + charts/db-instances/templates/dbinstance.yaml | 103 ++-- charts/db-operator/Chart.yaml | 8 +- charts/db-operator/README.md | 4 +- .../crd/kinda.rocks_dbinstances.yaml | 562 +++++++++++++++++- charts/db-operator/templates/crds.yaml | 1 - .../templates/mysql-test.yaml | 24 +- .../templates/psql-test.yaml | 44 +- 11 files changed, 674 insertions(+), 96 deletions(-) create mode 100644 charts/db-instances/ci/ci-2-values.yaml diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 2347042..16b4a37 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -16,7 +16,6 @@ jobs: - v1.36.1 - v1.35.5 - v1.34.8 - - v1.33.12 chart: - db-operator - db-instances diff --git a/charts/db-instances/Chart.yaml b/charts/db-instances/Chart.yaml index f6fb8ac..e10a7e1 100644 --- a/charts/db-instances/Chart.yaml +++ b/charts/db-instances/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "1.0" description: Database Instances for db operator name: db-instances -version: 2.7.1 +version: 3.0.0 diff --git a/charts/db-instances/README.md b/charts/db-instances/README.md index e752316..39e4956 100644 --- a/charts/db-instances/README.md +++ b/charts/db-instances/README.md @@ -1,6 +1,6 @@ # db-instances -![Version: 2.7.1](https://img.shields.io/badge/Version-2.7.1-informational?style=flat-square) ![AppVersion: 1.0](https://img.shields.io/badge/AppVersion-1.0-informational?style=flat-square) +![Version: 3.0.0](https://img.shields.io/badge/Version-3.0.0-informational?style=flat-square) ![AppVersion: 1.0](https://img.shields.io/badge/AppVersion-1.0-informational?style=flat-square) Database Instances for db operator diff --git a/charts/db-instances/ci/ci-2-values.yaml b/charts/db-instances/ci/ci-2-values.yaml new file mode 100644 index 0000000..4d5999b --- /dev/null +++ b/charts/db-instances/ci/ci-2-values.yaml @@ -0,0 +1,19 @@ +dbinstances: + instance1: + serviceMonitor: + enabled: true + podMonitor: + enabled: true + engine: postgres + monitoring: + enabled: true + secrets: + adminUser: admin + adminPassword: IamAdmin + instanceVars: + TEST: TEST + allowedPrivileges: + - test + - test2 + namespaceFilters: + - "test-*" diff --git a/charts/db-instances/templates/dbinstance.yaml b/charts/db-instances/templates/dbinstance.yaml index b8b8dfb..0b1909e 100644 --- a/charts/db-instances/templates/dbinstance.yaml +++ b/charts/db-instances/templates/dbinstance.yaml @@ -3,7 +3,7 @@ {{- if .Values.dbinstances }} {{- range $name, $value := .Values.dbinstances }} --- -apiVersion: "kinda.rocks/v1beta1" +apiVersion: "kinda.rocks/v1" kind: "DbInstance" metadata: name: {{ $name }} @@ -23,63 +23,56 @@ spec: {{- end }} engine: {{ $value.engine }} {{- if $value.existingAdminSecret }} - adminSecretRef: - Namespace: {{ $value.existingAdminSecret.namespace }} - Name: {{ $value.existingAdminSecret.name }} + auth: + username: + valueFrom: + secret: + namespace: {{ $value.existingAdminSecret.namespace }} + name: {{ $value.existingAdminSecret.name }} + key: user + password: + valueFrom: + secret: + namespace: {{ $value.existingAdminSecret.namespace }} + name: {{ $value.existingAdminSecret.name }} + key: password {{- else }} - adminSecretRef: - Namespace: {{ $operatorNs }} - Name: {{ $name }}-admin-secret + auth: + username: + valueFrom: + secret: + namespace: {{ $operatorNs }} + name: {{ $name }}-admin-secret + key: user + password: + valueFrom: + secret: + namespace: {{ $operatorNs }} + name: {{ $name }}-admin-secret + key: password {{- end }} - {{- if $value.backup }} - backup: - {{ toYaml $value.backup | nindent 4 }} - {{- end }} - monitoring: - enabled: {{ $value.monitoring.enabled }} - {{- if $value.sslConnection }} - sslConnection: - enabled: {{ $value.sslConnection.enabled }} - skip-verify: {{ $value.sslConnection.skipVerify }} - {{- end }} - {{- with $value.allowExtraGrants }} - allowExtraGrants: {{ . }} - {{- end }} - {{- if $value.google }} - google: - instance: {{ $value.google.instanceName }} - configmapRef: - Namespace: {{ $operatorNs }} - Name: {{ $name }}-config - {{- if $value.google.clientSecret }} - clientSecretRef: - Namespace: {{ $operatorNs }} - Name: {{ $name }}-client-secret - {{- end }} - {{- end }} - {{- if $value.generic }} - generic: - hostFrom: - kind: ConfigMap - name: {{ $name }}-config - namespace: {{ $.Release.Namespace }} - key: host - portFrom: - kind: ConfigMap - name: {{ $name }}-config - namespace: {{ $.Release.Namespace }} - key: port - {{- if $value.generic.publicIp }} - publicIpFrom: - kind: ConfigMap - name: {{ $name }}-config - namespace: {{ $.Release.Namespace }} - key: publicIp - {{- end }} - - {{- if $value.generic.backupHost }} - backupHost: {{ $value.generic.backupHost }} + endpoint: + host: + valueFrom: + configMap: + name: {{ $name }}-config + namespace: {{ $operatorNs }} + key: host + port: + valueFrom: + configMap: + name: {{ $name }}-config + namespace: {{ $operatorNs }} + key: port + {{- with $value.namespaceFilters }} + namespaceFilters: + {{- . | toYaml | nindent 4 }} {{- end }} + {{- with $value.allowedPrivileges }} + allowedPrivileges: + - namespace: '*' + roles: + {{- . | toYaml | nindent 8 }} {{- end }} {{- if not $value.existingAdminSecret }} --- diff --git a/charts/db-operator/Chart.yaml b/charts/db-operator/Chart.yaml index a5306a9..00efaea 100644 --- a/charts/db-operator/Chart.yaml +++ b/charts/db-operator/Chart.yaml @@ -2,12 +2,12 @@ apiVersion: v2 type: application name: db-operator -version: 3.17.0 +version: 4.0.0 description: This operator lets you manage databases in a Kubernetes native way, even if they are not deployed to Kubernetes # All supported k8s versions are in the test: -# https://github.com/db-operator/charts/blob/main/.github/workflows/integration-test.yaml -kubeVersion: ">= 1.32-prerelease" -appVersion: "2.44.0" +# https://github.com/db-operator/charts/blob/main/.github/workflows/integration-tests.yaml +kubeVersion: ">= 1.34-prerelease" +appVersion: "2.45.1" home: https://github.com/db-operator maintainers: - name: Nikolai Rodionov diff --git a/charts/db-operator/README.md b/charts/db-operator/README.md index f3468e8..bd36c75 100644 --- a/charts/db-operator/README.md +++ b/charts/db-operator/README.md @@ -1,6 +1,6 @@ # db-operator -![Version: 3.17.0](https://img.shields.io/badge/Version-3.17.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.44.0](https://img.shields.io/badge/AppVersion-2.44.0-informational?style=flat-square) +![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.45.1](https://img.shields.io/badge/AppVersion-2.45.1-informational?style=flat-square) This operator lets you manage databases in a Kubernetes native way, even if they are not deployed to Kubernetes @@ -18,7 +18,7 @@ This operator lets you manage databases in a Kubernetes native way, even if they ## Requirements -Kubernetes: `>= 1.32-prerelease` +Kubernetes: `>= 1.34-prerelease` ## Values diff --git a/charts/db-operator/crd/kinda.rocks_dbinstances.yaml b/charts/db-operator/crd/kinda.rocks_dbinstances.yaml index 33b7a09..4698abc 100644 --- a/charts/db-operator/crd/kinda.rocks_dbinstances.yaml +++ b/charts/db-operator/crd/kinda.rocks_dbinstances.yaml @@ -16,6 +16,566 @@ spec: singular: dbinstance scope: Cluster versions: + - additionalPrinterColumns: + - description: Which engine is used as a backend for this instance + jsonPath: .status.engine + name: Engine + type: string + - description: Which version of the engine is used as a backend for this instance + jsonPath: .status.version + name: Version + type: string + - description: How many databases on this instance are managed by the operator + jsonPath: .status.serverStatus.managedDatabasesCount + name: Managed Databases Count + type: string + - description: Which version of the db-operator is used to manage this instance + jsonPath: .status.operatorVersion + name: Operator Version + type: string + - description: "\t// When ready, an instance can be used by other controllers" + jsonPath: .status.ready + name: Ready + type: string + name: v1 + schema: + openAPIV3Schema: + description: DbInstance is the Schema for the dbinstances API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec defines the desired state of DbInstance + properties: + allowedPrivileges: + description: |- + If set, the operator will create backup jobs for database that are deployed to the namespaces + that will match the namespace regex + BackupRules []*DbInstanceBackupRule `json:"backupRules,omitempty"` + A list of privileges that are allowed to be set as Dbuser's extra privileges + items: + properties: + namespace: + type: string + roles: + items: + type: string + type: array + required: + - namespace + - roles + type: object + type: array + auth: + description: How the operator should authenticate to the database + instance. + properties: + password: + description: ValueSource is a helper struct to let users either + provide a value directly or fetch a value from Secret/ConfigMap. + properties: + value: + type: string + valueFrom: + description: ValueFrom is a helper struct to let users fetch + data from Secret/ConfigMap. + properties: + configMap: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + secret: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + type: object + type: object + username: + description: ValueSource is a helper struct to let users either + provide a value directly or fetch a value from Secret/ConfigMap. + properties: + value: + type: string + valueFrom: + description: ValueFrom is a helper struct to let users fetch + data from Secret/ConfigMap. + properties: + configMap: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + secret: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + type: object + type: object + type: object + endpoint: + description: The endpoint of the database instance. + properties: + host: + description: ValueSource is a helper struct to let users either + provide a value directly or fetch a value from Secret/ConfigMap. + properties: + value: + type: string + valueFrom: + description: ValueFrom is a helper struct to let users fetch + data from Secret/ConfigMap. + properties: + configMap: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + secret: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + type: object + type: object + port: + description: ValueSource is a helper struct to let users either + provide a value directly or fetch a value from Secret/ConfigMap. + properties: + value: + type: string + valueFrom: + description: ValueFrom is a helper struct to let users fetch + data from Secret/ConfigMap. + properties: + configMap: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + secret: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + type: object + type: object + sslConnection: + description: DbInstanceSSLConnection defines whether connection + from db-operator to instance has to be ssl or not + properties: + enabled: + type: boolean + skip-verify: + description: SkipVerify use SSL connection, but don't check + against a CA + type: boolean + required: + - enabled + - skip-verify + type: object + type: object + engine: + description: When not set, db-operator will try to determine the engine + itself. + enum: + - postgres + - mysql + type: string + grantRules: + items: + description: DbInstanceGrantRule defines a rule for granting access + to a database. + properties: + accessLevel: + enum: + - readOnly + - readWrite + type: string + namespace: + type: string + role: + type: string + required: + - accessLevel + - namespace + - role + type: object + type: array + instanceVars: + additionalProperties: + type: string + description: |- + InstanceVars can be used by any database/dbuser that are deployed + to this instance to build templated credentials with some generic values. + Can be used for example to provide a read only postgres replica url + type: object + namespaceFilters: + description: If set, only databases from allowed namespaces will be + created on the instance. + items: + type: string + type: array + readOnlyEndpoint: + description: ReadOnlyEndpoint is an optional endpoint that should + point to a read only replica of a database server. + properties: + host: + description: ValueSource is a helper struct to let users either + provide a value directly or fetch a value from Secret/ConfigMap. + properties: + value: + type: string + valueFrom: + description: ValueFrom is a helper struct to let users fetch + data from Secret/ConfigMap. + properties: + configMap: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + secret: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + type: object + type: object + port: + description: ValueSource is a helper struct to let users either + provide a value directly or fetch a value from Secret/ConfigMap. + properties: + value: + type: string + valueFrom: + description: ValueFrom is a helper struct to let users fetch + data from Secret/ConfigMap. + properties: + configMap: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + secret: + description: SecretOrCMRef is a helper struct to let users + fetch a value from Secret/ConfigMap. + properties: + key: + type: string + name: + type: string + namespace: + type: string + type: object + type: object + type: object + sslConnection: + description: DbInstanceSSLConnection defines whether connection + from db-operator to instance has to be ssl or not + properties: + enabled: + type: boolean + skip-verify: + description: SkipVerify use SSL connection, but don't check + against a CA + type: boolean + required: + - enabled + - skip-verify + type: object + type: object + required: + - auth + - endpoint + - engine + type: object + status: + description: status defines the observed state of DbInstance + properties: + conditions: + description: |- + conditions represent the current state of the DbInstance resource. + Each condition has a unique type and reflects the status of a specific aspect of the resource. + + Standard condition types include: + - "Available": the resource is fully functional + - "Progressing": the resource is being created or updated + - "Degraded": the resource failed to reach or maintain its desired state + + The status of each condition is one of True, False, or Unknown. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + engine: + description: Which engine is used as a backend for this instance + enum: + - postgres + - mysql + type: string + grantRules: + items: + description: DbInstanceGrantRule defines a rule for granting access + to a database. + properties: + accessLevel: + enum: + - readOnly + - readWrite + type: string + namespace: + type: string + role: + type: string + required: + - accessLevel + - namespace + - role + type: object + type: array + mainEndpoint: + description: MainEndpoint contains information about the host and + port of this instance. + properties: + host: + type: string + port: + type: integer + sslConnection: + description: DbInstanceSSLConnection defines whether connection + from db-operator to instance has to be ssl or not + properties: + enabled: + type: boolean + skip-verify: + description: SkipVerify use SSL connection, but don't check + against a CA + type: boolean + required: + - enabled + - skip-verify + type: object + type: object + namespaceFilters: + items: + type: string + type: array + operatorVersion: + description: Which version of the db-operator is used to manage this + instance + type: string + readOnlyEndpoint: + description: ReadOnlyEndpoint contains information about the host + and port of a read only replica of this instance. + properties: + host: + type: string + port: + type: integer + sslConnection: + description: DbInstanceSSLConnection defines whether connection + from db-operator to instance has to be ssl or not + properties: + enabled: + type: boolean + skip-verify: + description: SkipVerify use SSL connection, but don't check + against a CA + type: boolean + required: + - enabled + - skip-verify + type: object + type: object + ready: + type: boolean + serverStatus: + description: ServerStatus contains information about the databases + and users on this instance. + properties: + databases: + description: A list of databases on this instance. + items: + type: string + type: array + databasesCount: + description: Total number of databases created on this instance. + type: integer + managedDatabasesCount: + description: Total number of databases created on this instance + by the db-operator. + type: integer + users: + description: A list of users on this instance. + items: + type: string + type: array + required: + - managedDatabasesCount + type: object + version: + description: Which version of the engine is used as a backend for + this instance + type: string + versionTTL: + description: VersionTTL is the time when the version of the backend + will be checked again + format: int64 + type: integer + watchedResources: + description: WatchedResources is a list of resources that are being + watched by the db-operator for this instance. + items: + type: string + type: array + required: + - serverStatus + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} - additionalPrinterColumns: - description: current phase jsonPath: .status.phase @@ -271,6 +831,6 @@ spec: type: object type: object served: true - storage: true + storage: false subresources: status: {} diff --git a/charts/db-operator/templates/crds.yaml b/charts/db-operator/templates/crds.yaml index aeb5fe1..161c81b 100644 --- a/charts/db-operator/templates/crds.yaml +++ b/charts/db-operator/templates/crds.yaml @@ -31,7 +31,6 @@ metadata: spec: {{- if (or (eq $manifest.metadata.name "databases.kinda.rocks") - (eq $manifest.metadata.name "dbinstances.kinda.rocks") ) }} {{- if $.Values.webhook.enabled }} diff --git a/ci/charts/db-operator-mysql-test/templates/mysql-test.yaml b/ci/charts/db-operator-mysql-test/templates/mysql-test.yaml index c7b6f2f..854ec3c 100644 --- a/ci/charts/db-operator-mysql-test/templates/mysql-test.yaml +++ b/ci/charts/db-operator-mysql-test/templates/mysql-test.yaml @@ -17,7 +17,7 @@ data: user: {{ .Values.mysql.admin.user | b64enc }} --- -apiVersion: kinda.rocks/v1beta1 +apiVersion: kinda.rocks/v1 kind: DbInstance metadata: name: {{ template "db-operator-mysql-test.name" . }}-mysql @@ -30,15 +30,21 @@ metadata: {{- end }} "helm.sh/hook-weight": "1" spec: - adminSecretRef: - Namespace: {{ .Release.Namespace }} - Name: {{ template "db-operator-mysql-test.name" . }}-mysql-admin-password + auth: + username: + value: root + password: + valueFrom: + secret: + namespace: {{ .Release.Namespace }} + name: {{ template "db-operator-mysql-test.name" . }}-mysql-admin-password + key: password engine: mysql - generic: - host: {{ .Values.mysql.service.name }}.{{ .Values.mysql.service.namespace }}.svc.cluster.local - port: 3306 - publicIp: "1.2.3.4" - backupHost: {{ .Values.mysql.service.name }}.{{ .Values.mysql.service.namespace }}.svc.cluster.local + endpoint: + host: + value: {{ .Values.mysql.service.name }}.{{ .Values.mysql.service.namespace }}.svc.cluster.local + port: + value: '3306' {{- if .Values.features.existingUser.enabled }} --- diff --git a/ci/charts/db-operator-psql-test/templates/psql-test.yaml b/ci/charts/db-operator-psql-test/templates/psql-test.yaml index a77ed84..0e7277c 100644 --- a/ci/charts/db-operator-psql-test/templates/psql-test.yaml +++ b/ci/charts/db-operator-psql-test/templates/psql-test.yaml @@ -33,7 +33,7 @@ data: port: "5432" publicIp: "1.2.3.4" --- -apiVersion: kinda.rocks/v1beta1 +apiVersion: kinda.rocks/v1 kind: DbInstance metadata: name: {{ template "db-operator-psql-test.name" . }}-postgresql @@ -46,27 +46,29 @@ metadata: {{- end }} "helm.sh/hook-weight": "1" spec: - adminSecretRef: - Namespace: {{ .Release.Namespace }} - Name: {{ template "db-operator-psql-test.name" . }}-postgresql-admin-password + auth: + username: + value: db-operator + password: + valueFrom: + secret: + namespace: {{ .Release.Namespace }} + name: {{ template "db-operator-psql-test.name" . }}-postgresql-admin-password + key: password engine: postgres - generic: - hostFrom: - kind: ConfigMap - name: {{ template "db-operator-psql-test.name" . }}-postgresql-config - namespace: {{ .Release.Namespace }} - key: host - portFrom: - kind: ConfigMap - name: {{ template "db-operator-psql-test.name" . }}-postgresql-config - namespace: {{ .Release.Namespace }} - key: port - publicIpFrom: - kind: ConfigMap - name: {{ template "db-operator-psql-test.name" . }}-postgresql-config - namespace: {{ .Release.Namespace }} - key: publicIp - backupHost: {{ .Values.postgresql.service.name }}.{{ .Values.postgresql.service.namespace }}.svc.cluster.local + endpoint: + host: + valueFrom: + configMap: + name: {{ template "db-operator-psql-test.name" . }}-postgresql-config + namespace: {{ .Release.Namespace }} + key: host + port: + valueFrom: + configMap: + name: {{ template "db-operator-psql-test.name" . }}-postgresql-config + namespace: {{ .Release.Namespace }} + key: port {{- if .Values.features.existingUser.enabled }} --- From 749bf54e6549a5b549f1dfdbaf3d051cae4c6b88 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Wed, 4 Nov 2026 20:03:03 +0100 Subject: [PATCH 2/6] Try testing again Signed-off-by: Nikolai Rodionov --- charts/db-operator/Chart.yaml | 4 ++-- charts/db-operator/README.md | 2 +- ci/helmfile.yaml.gotmpl | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/charts/db-operator/Chart.yaml b/charts/db-operator/Chart.yaml index 00efaea..0e8728e 100644 --- a/charts/db-operator/Chart.yaml +++ b/charts/db-operator/Chart.yaml @@ -7,12 +7,12 @@ description: This operator lets you manage databases in a Kubernetes native way, # All supported k8s versions are in the test: # https://github.com/db-operator/charts/blob/main/.github/workflows/integration-tests.yaml kubeVersion: ">= 1.34-prerelease" -appVersion: "2.45.1" +appVersion: "40794d2f9ac898e8eb24c31a05fe0188f7420cc4" home: https://github.com/db-operator maintainers: - name: Nikolai Rodionov email: allanger@posteo.com - url: https://badhouseplants.net + url: https://allanger.xyz sources: - https://github.com/db-operator/db-operator keywords: diff --git a/charts/db-operator/README.md b/charts/db-operator/README.md index bd36c75..db6fbcd 100644 --- a/charts/db-operator/README.md +++ b/charts/db-operator/README.md @@ -1,6 +1,6 @@ # db-operator -![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.45.1](https://img.shields.io/badge/AppVersion-2.45.1-informational?style=flat-square) +![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 40794d2f9ac898e8eb24c31a05fe0188f7420cc4](https://img.shields.io/badge/AppVersion-40794d2f9ac898e8eb24c31a05fe0188f7420cc4-informational?style=flat-square) This operator lets you manage databases in a Kubernetes native way, even if they are not deployed to Kubernetes diff --git a/ci/helmfile.yaml.gotmpl b/ci/helmfile.yaml.gotmpl index 3a62688..412283a 100644 --- a/ci/helmfile.yaml.gotmpl +++ b/ci/helmfile.yaml.gotmpl @@ -115,6 +115,9 @@ releases: needs: - monitoring/prometheus-stack - cert-manager/cert-manager + values: + - image: + repository: db-operator/db-operator-dev {{- if (eq .Environment.Name "local-dev") }} values: From b49ec1e9d67a094903e006bd227e0b2777afaaa7 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 12 Nov 2026 13:05:56 +0100 Subject: [PATCH 3/6] Try the 2.45.2 version Signed-off-by: Nikolai Rodionov --- charts/db-operator/Chart.yaml | 2 +- charts/db-operator/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/db-operator/Chart.yaml b/charts/db-operator/Chart.yaml index 0e8728e..af7e265 100644 --- a/charts/db-operator/Chart.yaml +++ b/charts/db-operator/Chart.yaml @@ -7,7 +7,7 @@ description: This operator lets you manage databases in a Kubernetes native way, # All supported k8s versions are in the test: # https://github.com/db-operator/charts/blob/main/.github/workflows/integration-tests.yaml kubeVersion: ">= 1.34-prerelease" -appVersion: "40794d2f9ac898e8eb24c31a05fe0188f7420cc4" +appVersion: "2.45.2" home: https://github.com/db-operator maintainers: - name: Nikolai Rodionov diff --git a/charts/db-operator/README.md b/charts/db-operator/README.md index db6fbcd..7501910 100644 --- a/charts/db-operator/README.md +++ b/charts/db-operator/README.md @@ -1,6 +1,6 @@ # db-operator -![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 40794d2f9ac898e8eb24c31a05fe0188f7420cc4](https://img.shields.io/badge/AppVersion-40794d2f9ac898e8eb24c31a05fe0188f7420cc4-informational?style=flat-square) +![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.45.2](https://img.shields.io/badge/AppVersion-2.45.2-informational?style=flat-square) This operator lets you manage databases in a Kubernetes native way, even if they are not deployed to Kubernetes @@ -10,7 +10,7 @@ This operator lets you manage databases in a Kubernetes native way, even if they | Name | Email | Url | | ---- | ------ | --- | -| Nikolai Rodionov | | | +| Nikolai Rodionov | | | ## Source Code From 63993a69c83c05ffc46516eaad31d2b2aa177386 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 13 Nov 2026 21:09:30 +0100 Subject: [PATCH 4/6] Fix webhooks Signed-off-by: Nikolai Rodionov --- charts/db-instances/ci/ci-1-values.yaml | 6 ++++ .../webhook/configs/mutating_webhook.yaml | 24 +++++++++++++-- .../webhook/configs/validating_webhook.yaml | 30 +++++++++++++++---- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/charts/db-instances/ci/ci-1-values.yaml b/charts/db-instances/ci/ci-1-values.yaml index 923d671..a6efad1 100644 --- a/charts/db-instances/ci/ci-1-values.yaml +++ b/charts/db-instances/ci/ci-1-values.yaml @@ -12,6 +12,9 @@ dbinstances: adminPassword: IamAdmin instanceVars: TEST: TEST + generic: + host: postgres-instance.databases.svc.cluster.local + port: 5432 instance2: engine: mysql monitoring: @@ -19,3 +22,6 @@ dbinstances: secrets: adminUser: adminUser adminPassword: adminAdmin + generic: + host: mariadb-instance.databases.svc.cluster.local + port: 3306 diff --git a/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml b/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml index 49fa1b0..5d109d8 100644 --- a/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml +++ b/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml @@ -21,7 +21,7 @@ webhooks: namespace: {{ .Release.Namespace }} path: /mutate-kinda-rocks-v1beta1-database failurePolicy: Fail - name: mdatabase.kb.io + name: mdatabase-v1beta1.kb.io rules: - apiGroups: - kinda.rocks @@ -33,6 +33,26 @@ webhooks: resources: - databases sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: {{ include "db-operator.webhook.name" . }} + namespace: {{ .Release.Namespace }} + path: /mutate-kinda-rocks-v1-dbinstance + failurePolicy: Fail + name: mdbinstance-v1.kb.io + rules: + - apiGroups: + - kinda.rocks + apiVersions: + - v1 + operations: + - CREATE + - UPDATE + resources: + - dbinstances + sideEffects: None - admissionReviewVersions: - v1 clientConfig: @@ -41,7 +61,7 @@ webhooks: namespace: {{ .Release.Namespace }} path: /mutate-kinda-rocks-v1beta1-dbinstance failurePolicy: Fail - name: mdbinstance.kb.io + name: mdbinstance-v1beta1.kb.io rules: - apiGroups: - kinda.rocks diff --git a/charts/db-operator/templates/webhook/configs/validating_webhook.yaml b/charts/db-operator/templates/webhook/configs/validating_webhook.yaml index 8df60be..b11444b 100644 --- a/charts/db-operator/templates/webhook/configs/validating_webhook.yaml +++ b/charts/db-operator/templates/webhook/configs/validating_webhook.yaml @@ -21,7 +21,7 @@ webhooks: namespace: {{ .Release.Namespace }} path: /validate-kinda-rocks-v1beta1-database failurePolicy: Fail - name: vdatabase.kb.io + name: vdatabase-v1beta1.kb.io rules: - apiGroups: - kinda.rocks @@ -39,14 +39,14 @@ webhooks: service: name: {{ include "db-operator.webhook.name" . }} namespace: {{ .Release.Namespace }} - path: /validate-kinda-rocks-v1beta1-dbinstance + path: /validate-kinda-rocks-v1-dbinstance failurePolicy: Fail - name: vdbinstance.kb.io + name: vdbinstance-v1.kb.io rules: - apiGroups: - kinda.rocks apiVersions: - - v1beta1 + - v1 operations: - CREATE - UPDATE @@ -59,9 +59,29 @@ webhooks: service: name: {{ include "db-operator.webhook.name" . }} namespace: {{ .Release.Namespace }} + path: /validate-kinda-rocks-v1beta1-dbinstance + failurePolicy: Fail + name: vdbinstance-v1beta1.kb.io + rules: + - apiGroups: + - kinda.rocks + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - dbinstances + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: webhook-service + namespace: system path: /validate-kinda-rocks-v1beta1-dbuser failurePolicy: Fail - name: vdbuser.kb.io + name: vdbuser-v1beta1.kb.io rules: - apiGroups: - kinda.rocks From 9e01c6126860c43c86ed9dc3d6c0f54ab617e375 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 13 Nov 2026 21:44:12 +0100 Subject: [PATCH 5/6] Remove webhooks for the dbin v1beta1 Signed-off-by: Nikolai Rodionov --- .../webhook/configs/mutating_webhook.yaml | 20 ------------------- .../webhook/configs/validating_webhook.yaml | 20 ------------------- ci/helmfile.yaml.gotmpl | 3 --- 3 files changed, 43 deletions(-) diff --git a/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml b/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml index 5d109d8..94ea3a8 100644 --- a/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml +++ b/charts/db-operator/templates/webhook/configs/mutating_webhook.yaml @@ -53,24 +53,4 @@ webhooks: resources: - dbinstances sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ include "db-operator.webhook.name" . }} - namespace: {{ .Release.Namespace }} - path: /mutate-kinda-rocks-v1beta1-dbinstance - failurePolicy: Fail - name: mdbinstance-v1beta1.kb.io - rules: - - apiGroups: - - kinda.rocks - apiVersions: - - v1beta1 - operations: - - CREATE - - UPDATE - resources: - - dbinstances - sideEffects: None {{- end }} diff --git a/charts/db-operator/templates/webhook/configs/validating_webhook.yaml b/charts/db-operator/templates/webhook/configs/validating_webhook.yaml index b11444b..3ef37e1 100644 --- a/charts/db-operator/templates/webhook/configs/validating_webhook.yaml +++ b/charts/db-operator/templates/webhook/configs/validating_webhook.yaml @@ -53,26 +53,6 @@ webhooks: resources: - dbinstances sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ include "db-operator.webhook.name" . }} - namespace: {{ .Release.Namespace }} - path: /validate-kinda-rocks-v1beta1-dbinstance - failurePolicy: Fail - name: vdbinstance-v1beta1.kb.io - rules: - - apiGroups: - - kinda.rocks - apiVersions: - - v1beta1 - operations: - - CREATE - - UPDATE - resources: - - dbinstances - sideEffects: None - admissionReviewVersions: - v1 clientConfig: diff --git a/ci/helmfile.yaml.gotmpl b/ci/helmfile.yaml.gotmpl index 412283a..3a62688 100644 --- a/ci/helmfile.yaml.gotmpl +++ b/ci/helmfile.yaml.gotmpl @@ -115,9 +115,6 @@ releases: needs: - monitoring/prometheus-stack - cert-manager/cert-manager - values: - - image: - repository: db-operator/db-operator-dev {{- if (eq .Environment.Name "local-dev") }} values: From d1b706bd3eaba12c18dbcf13150bb97588d2bfe9 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sat, 14 Nov 2026 18:49:07 +0100 Subject: [PATCH 6/6] Update notes Signed-off-by: Nikolai Rodionov --- charts/db-operator/templates/NOTES.txt | 11 +++++------ .../templates/webhook/configs/validating_webhook.yaml | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/charts/db-operator/templates/NOTES.txt b/charts/db-operator/templates/NOTES.txt index 9b1d329..c6f0680 100644 --- a/charts/db-operator/templates/NOTES.txt +++ b/charts/db-operator/templates/NOTES.txt @@ -6,13 +6,12 @@ The Release name {{ .Release.Name }}. ----------------------------------------------------------------------- Breaking changes and migration paths: -Version `3.0.0` contains breaking changes for ones using the google cloudsql instances. It doesn't mean that the operator will not work with them anymore, but users will have to use **generic** DbInsances and prepare the infrasturture using other tools. +Version `4.0.0` brings a new DbInstance API. Old API (v1beta1) is not reconciled by the operator anymore. +It's is not remobed from the CRD yet, but there will be no conversion webhook, so older version will not +be migrated automacially. -Other changes that might require migration: - -- Pod names were changed, now instead of `db-operator-` and `db-operator-webhook`, we have `db-opetator-controller` and `db-operator-webhook` -- RBAC separation: the controller and webhook now use different ClusterRoles. The configuration has been moved to .controller.rbac and .webhook.rbac accordingly. -- Pre-defined DB Operator flags are now set under `controller.args` +Users of the `db-instances` helm chart should update the chart version to `3.0.0` with the same config, +new features, that are now supported by the instances will be delivered to the chart later. {{- if not .Values.crds.install }} ----------------------------------------------------------------------- diff --git a/charts/db-operator/templates/webhook/configs/validating_webhook.yaml b/charts/db-operator/templates/webhook/configs/validating_webhook.yaml index 3ef37e1..f52a94a 100644 --- a/charts/db-operator/templates/webhook/configs/validating_webhook.yaml +++ b/charts/db-operator/templates/webhook/configs/validating_webhook.yaml @@ -57,8 +57,8 @@ webhooks: - v1 clientConfig: service: - name: webhook-service - namespace: system + name: {{ include "db-operator.webhook.name" . }} + namespace: {{ .Release.Namespace }} path: /validate-kinda-rocks-v1beta1-dbuser failurePolicy: Fail name: vdbuser-v1beta1.kb.io