feat(percona-xtradb-cluster): upgrade the operator to 1.19.1 (#4559)
Signed-off-by: Mohammed Naser <mnaser@vexxhost.com>
This commit is contained in:
1 parent
dfac303fd2
commit
fba208b813
12 files changed
+922
-28
No files matched your search
+1
-1
@@ -216,7 +216,7 @@ charts:
|
||||
repository:
|
||||
url: https://prometheus-community.github.io/helm-charts
|
||||
- name: pxc-operator
|
||||
version: 1.18.0
|
||||
version: 1.19.1
|
||||
repository:
|
||||
url: https://percona.github.io/percona-helm-charts
|
||||
- name: rabbitmq-cluster-operator
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apiVersion: v2
|
||||
appVersion: 1.18.0
|
||||
appVersion: 1.19.1
|
||||
description: A Helm chart for deploying the Percona Operator for MySQL (based on Percona
|
||||
XtraDB Cluster)
|
||||
home: https://docs.percona.com/percona-operator-for-mysql/pxc/
|
||||
@@ -11,5 +11,7 @@ maintainers:
|
||||
name: eleo007
|
||||
- email: julio.pasinatto@percona.com
|
||||
name: jvpasinatto
|
||||
- email: valmira.nogueira@percona.com
|
||||
name: valmiranogueira
|
||||
name: pxc-operator
|
||||
version: 1.18.0
|
||||
version: 1.19.1
|
||||
@@ -19,14 +19,14 @@ To install the chart with the `pxc` release name using a dedicated namespace (re
|
||||
|
||||
```sh
|
||||
helm repo add percona https://percona.github.io/percona-helm-charts/
|
||||
helm install my-operator percona/pxc-operator --version 1.18.0 --namespace my-namespace
|
||||
helm install my-operator percona/pxc-operator --version 1.19.1 --namespace my-namespace
|
||||
```
|
||||
|
||||
The chart can be customized using the following configurable parameters:
|
||||
|
||||
| Parameter | Description | Default |
|
||||
| ------------------------------- | -----------------------------------------------------------------------------------------------| -------------------------------------------------|
|
||||
| `image` | PXC Operator Container image full path | `percona/percona-xtradb-cluster-operator:1.18.0` |
|
||||
| `image` | PXC Operator Container image full path | `percona/percona-xtradb-cluster-operator:1.19.1` |
|
||||
| `imagePullPolicy` | PXC Operator Container pull policy | `Always` |
|
||||
| `containerSecurityContext` | PXC Operator Container securityContext | `{}` |
|
||||
| `imagePullSecrets` | PXC Operator Pod pull secret | `[]` |
|
||||
@@ -38,12 +38,15 @@ The chart can be customized using the following configurable parameters:
|
||||
| `logStructured` | Force PXC operator to print JSON-wrapped log messages | `false` |
|
||||
| `logLevel` | PXC Operator logging level | `INFO` |
|
||||
| `disableTelemetry` | Disable sending PXC Operator telemetry data to Percona | `false` |
|
||||
| `maxConcurrentReconciles` | Limits the number of parallel cluster reconciles | `1` |
|
||||
| `s3WorkersLimit` | Adjusts the maximum number of parallel workers used for S3 client | `10` |
|
||||
| `watchAllNamespaces` | Watch all namespaces (Install cluster-wide) | `false` |
|
||||
| `watchNamespace` | Comma separated list of namespace(s) to watch when different from release namespace | `""` |
|
||||
| `createNamespace` | Create the watched namespace(s) | `false` |
|
||||
| `rbac.create` | If false RBAC will not be created. RBAC resources will need to be created manually | `true` |
|
||||
| `serviceAccount.create` | If false the ServiceAccounts will not be created. The ServiceAccounts must be created manually | `true` |
|
||||
| `extraEnvVars` | Custom pod environment variables | `[]` |
|
||||
| `featureGates.xtrabackupSidecar`| Enable the Xtrabackup Sidecar feature | `false` |
|
||||
|
||||
Specify parameters using `--set key=value[,key=value]` argument to `helm install`
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -53,4 +53,15 @@ Functions returns image URI according to parameters set
|
||||
{{- else }}
|
||||
{{- printf "%s:%s" .Values.operatorImageRepository .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "pxc-operator.featureGates" }}
|
||||
{{- if .Values.featureGates }}
|
||||
{{- $gates := list }}
|
||||
{{- range $key, $value := .Values.featureGates }}
|
||||
{{- $flagName := $key | title }}
|
||||
{{- $gates = append $gates (printf "%s=%v" $flagName $value) }}
|
||||
{{- end }}
|
||||
{{- join "," $gates }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -69,6 +69,12 @@ spec:
|
||||
value: "{{ .Values.logLevel }}"
|
||||
- name: DISABLE_TELEMETRY
|
||||
value: "{{ .Values.disableTelemetry }}"
|
||||
- name: MAX_CONCURRENT_RECONCILES
|
||||
value: "{{ .Values.maxConcurrentReconciles | default 1 }}"
|
||||
- name: S3_WORKERS_LIMIT
|
||||
value: "{{ .Values.s3WorkersLimit | default 10 }}"
|
||||
- name: PXCO_FEATURE_GATES
|
||||
value: {{ include "pxc-operator.featureGates" . | quote }}
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{- toYaml .Values.extraEnvVars | nindent 12 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -61,9 +61,14 @@ podAnnotations: {}
|
||||
logStructured: false
|
||||
logLevel: "INFO"
|
||||
disableTelemetry: false
|
||||
maxConcurrentReconciles: 1
|
||||
s3WorkersLimit: 10
|
||||
|
||||
extraEnvVars: []
|
||||
# - name: http_proxy
|
||||
# value: "example-proxy-http"
|
||||
# - name: https_proxy
|
||||
# value: "example-proxy-https"
|
||||
|
||||
featureGates:
|
||||
xtrabackupSidecar: false
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The Percona XtraDB Cluster operator is upgraded from 1.18.0 to 1.19.1,
|
||||
with Percona XtraDB Cluster 8.0.44, XtraBackup 8.0.35-34.1 and HAProxy
|
||||
2.8.17. The operator only supports upgrades to the next minor version, so
|
||||
this release must be deployed before upgrading to the next major release.
|
||||
The deployment now stops before upgrading an operator that is more than
|
||||
one minor version behind.
|
||||
@@ -215,10 +215,10 @@ _atmosphere_images:
|
||||
ovn_ovsdb_nb: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/ovn:v24.03.7-3@sha256:deb1966eff94d8da072a3647db63546722094deb3ef34b6b464609bcba61887a"
|
||||
ovn_ovsdb_sb: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/ovn:v24.03.7-3@sha256:deb1966eff94d8da072a3647db63546722094deb3ef34b6b464609bcba61887a"
|
||||
pause: "{{ atmosphere_image_prefix }}registry.k8s.io/pause:3.9"
|
||||
percona_xtradb_cluster_haproxy: "{{ atmosphere_image_prefix }}docker.io/percona/haproxy:2.8.15"
|
||||
percona_xtradb_cluster_operator: "{{ atmosphere_image_prefix }}docker.io/percona/percona-xtradb-cluster-operator:1.18.0"
|
||||
percona_xtradb_cluster: "{{ atmosphere_image_prefix }}docker.io/percona/percona-xtradb-cluster:8.0.42-33.1"
|
||||
percona_xtradb_cluster_backup: "{{ atmosphere_image_prefix }}docker.io/percona/percona-xtrabackup:8.0.35-33.1"
|
||||
percona_xtradb_cluster_haproxy: "{{ atmosphere_image_prefix }}docker.io/percona/haproxy:2.8.17"
|
||||
percona_xtradb_cluster_operator: "{{ atmosphere_image_prefix }}docker.io/percona/percona-xtradb-cluster-operator:1.19.1"
|
||||
percona_xtradb_cluster: "{{ atmosphere_image_prefix }}docker.io/percona/percona-xtradb-cluster:8.0.44-35.1"
|
||||
percona_xtradb_cluster_backup: "{{ atmosphere_image_prefix }}docker.io/percona/percona-xtrabackup:8.0.35-34.1"
|
||||
placement_db_sync: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/placement:2026.1@sha256:c9e052efe63a81e0ffd8f2c5791e306415cf3b6fa6c5cc26f9d776fc78364de6"
|
||||
placement: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/placement:2026.1@sha256:c9e052efe63a81e0ffd8f2c5791e306415cf3b6fa6c5cc26f9d776fc78364de6"
|
||||
pod_tls_sidecar: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/pod-tls-sidecar:v1.0.0@sha256:7a030f8b86c1503006e7d82312a3c8e98769c3b8e3a2e834aee3c60df184161a"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
_percona_xtradb_cluster_spec:
|
||||
crVersion: "1.18.0"
|
||||
crVersion: "1.19.1"
|
||||
secretsName: percona-xtradb
|
||||
enableVolumeExpansion: true
|
||||
backup:
|
||||
@@ -54,7 +54,7 @@ _percona_xtradb_cluster_spec:
|
||||
nodeSelector:
|
||||
openstack-control-plane: enabled
|
||||
# NOTE(fitbeard): The actual default configuration file can be found here:
|
||||
# https://github.com/percona/percona-docker/blob/pxc-operator-1.18.0/haproxy/dockerdir/etc/haproxy/haproxy-global.cfg
|
||||
# https://github.com/percona/percona-docker/blob/pxc-operator-1.19.0/haproxy/dockerdir/etc/haproxy/haproxy-global.cfg
|
||||
# Should be aligned with upstream example when bumping chart version
|
||||
configuration: |
|
||||
global
|
||||
|
||||
@@ -54,7 +54,7 @@ func TestPerconaXtraDBClusterSpec(t *testing.T) {
|
||||
func TestPerconaXtraDBClusterPXCSpec(t *testing.T) {
|
||||
assert.Equal(t, int32(3), vars.PerconaXtraDBClusterSpec.PXC.Size)
|
||||
assert.Equal(t, true, *vars.PerconaXtraDBClusterSpec.PXC.AutoRecovery)
|
||||
defaults.AssertAtmosphereImage(t, "docker.io/percona/percona-xtradb-cluster:8.0.42-33.1", vars.PerconaXtraDBClusterSpec.PXC.Image)
|
||||
defaults.AssertAtmosphereImage(t, "docker.io/percona/percona-xtradb-cluster:8.0.44-35.1", vars.PerconaXtraDBClusterSpec.PXC.Image)
|
||||
|
||||
assert.Equal(t, map[string]string{
|
||||
"openstack-control-plane": "enabled",
|
||||
@@ -116,7 +116,7 @@ func TestPerconaXtraDBClusterHAProxySpec(t *testing.T) {
|
||||
assert.Equal(t, true, vars.PerconaXtraDBClusterSpec.HAProxy.Enabled)
|
||||
assert.Equal(t, int32(3), vars.PerconaXtraDBClusterSpec.HAProxy.Size)
|
||||
|
||||
defaults.AssertAtmosphereImage(t, "docker.io/percona/haproxy:2.8.15", vars.PerconaXtraDBClusterSpec.HAProxy.Image)
|
||||
defaults.AssertAtmosphereImage(t, "docker.io/percona/haproxy:2.8.17", vars.PerconaXtraDBClusterSpec.HAProxy.Image)
|
||||
|
||||
assert.Equal(t, map[string]string{
|
||||
"openstack-control-plane": "enabled",
|
||||
@@ -131,14 +131,27 @@ func TestPerconaXtraDBClusterHAProxyConfiguration(t *testing.T) {
|
||||
// the file from the Docker image, replace the maxconn value and
|
||||
// then compare it.
|
||||
|
||||
// Get the default HAproxy configuration
|
||||
configFileUrl := fmt.Sprintf("https://raw.githubusercontent.com/percona/percona-docker/pxc-operator-%s/haproxy/dockerdir/etc/haproxy/haproxy-global.cfg", vars.PerconaXtraDBClusterSpec.CRVersion)
|
||||
resp, err := http.Get(configFileUrl)
|
||||
require.NoError(t, err)
|
||||
defer resp.Body.Close()
|
||||
haproxyConfigData, err := io.ReadAll(resp.Body)
|
||||
require.NoError(t, err)
|
||||
haproxyConfig := string(haproxyConfigData)
|
||||
// Get the default HAproxy configuration. Patch releases of the operator are
|
||||
// not always tagged in percona-docker, so fall back to the minor release.
|
||||
versions := []string{vars.PerconaXtraDBClusterSpec.CRVersion}
|
||||
if parts := strings.Split(vars.PerconaXtraDBClusterSpec.CRVersion, "."); len(parts) == 3 && parts[2] != "0" {
|
||||
versions = append(versions, fmt.Sprintf("%s.%s.0", parts[0], parts[1]))
|
||||
}
|
||||
|
||||
var haproxyConfig string
|
||||
for _, version := range versions {
|
||||
configFileUrl := fmt.Sprintf("https://raw.githubusercontent.com/percona/percona-docker/pxc-operator-%s/haproxy/dockerdir/etc/haproxy/haproxy-global.cfg", version)
|
||||
resp, err := http.Get(configFileUrl)
|
||||
require.NoError(t, err)
|
||||
haproxyConfigData, err := io.ReadAll(resp.Body)
|
||||
resp.Body.Close()
|
||||
require.NoError(t, err)
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
haproxyConfig = string(haproxyConfigData)
|
||||
break
|
||||
}
|
||||
}
|
||||
require.NotEmpty(t, haproxyConfig, "no HAProxy configuration found for %v", versions)
|
||||
|
||||
// Replace the 4 spaces at the start of each line
|
||||
regex := regexp.MustCompile("(?m)^ ")
|
||||
|
||||
@@ -1,6 +1,38 @@
|
||||
# Copyright (c) 2025 VEXXHOST, Inc.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# NOTE: The operator only supports upgrades to the next minor version, so
|
||||
# stop before changing anything if the running cluster is older.
|
||||
- name: Check that the Percona XtraDB Cluster operator can be upgraded directly
|
||||
run_once: true
|
||||
block:
|
||||
- name: Get the Percona XtraDB cluster
|
||||
kubernetes.core.k8s_info:
|
||||
api_version: pxc.percona.com/v1
|
||||
kind: PerconaXtraDBCluster
|
||||
name: percona-xtradb
|
||||
namespace: openstack
|
||||
register: _pxc_operator_cluster
|
||||
failed_when: false
|
||||
|
||||
- name: Assert that the operator can be upgraded directly
|
||||
when:
|
||||
- _pxc_operator_cluster.resources | default([]) | length > 0
|
||||
- _pxc_operator_current_version is match('^[0-9]+\.[0-9]+\.[0-9]+$')
|
||||
- _pxc_operator_target_version is match('^[0-9]+\.[0-9]+\.[0-9]+$')
|
||||
vars:
|
||||
_pxc_operator_current_version: "{{ _pxc_operator_cluster.resources[0].spec.crVersion | default('') }}"
|
||||
_pxc_operator_target_version: "{{ atmosphere_images['percona_xtradb_cluster_operator'] | vexxhost.kubernetes.docker_image('tag') }}"
|
||||
_pxc_operator_minimum_version: >-
|
||||
{{ _pxc_operator_target_version.split('.')[0] }}.{{ (_pxc_operator_target_version.split('.')[1] | int) - 1 }}.0
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- _pxc_operator_current_version is version(_pxc_operator_minimum_version, '>=')
|
||||
fail_msg: >-
|
||||
The Percona XtraDB cluster uses version {{ _pxc_operator_current_version }} of the operator, which cannot be
|
||||
upgraded directly to {{ _pxc_operator_target_version }}. Upgrade to the previous Atmosphere release first.
|
||||
quiet: true
|
||||
|
||||
- name: Install all CRDs
|
||||
run_once: true
|
||||
changed_when: false
|
||||
|
||||
Reference in new issue
Block a user