diff --git a/.charts.yml b/.charts.yml index aad8ba6d..a66fbfad 100644 --- a/.charts.yml +++ b/.charts.yml @@ -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 diff --git a/charts/pxc-operator/Chart.yaml b/charts/pxc-operator/Chart.yaml index cfe1b034..c4c72d93 100644 --- a/charts/pxc-operator/Chart.yaml +++ b/charts/pxc-operator/Chart.yaml @@ -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 diff --git a/charts/pxc-operator/README.md b/charts/pxc-operator/README.md index e0111297..67754bc7 100644 --- a/charts/pxc-operator/README.md +++ b/charts/pxc-operator/README.md @@ -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` diff --git a/charts/pxc-operator/crds/crd.yaml b/charts/pxc-operator/crds/crd.yaml index e31d525e..4c1e8c16 100644 --- a/charts/pxc-operator/crds/crd.yaml +++ b/charts/pxc-operator/crds/crd.yaml @@ -2,12 +2,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.19.0 labels: app.kubernetes.io/component: crd app.kubernetes.io/name: percona-xtradb-cluster app.kubernetes.io/part-of: percona-xtradb-cluster-operator - app.kubernetes.io/version: v1.18.0 + app.kubernetes.io/version: v1.19.1 name: perconaxtradbclusterbackups.pxc.percona.com spec: group: pxc.percona.com @@ -113,6 +113,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -150,6 +167,9 @@ spec: type: object pxcCluster: type: string + runningDeadlineSeconds: + format: int64 + type: integer startingDeadlineSeconds: format: int64 type: integer @@ -228,10 +248,111 @@ spec: latestRestorableTime: format: date-time type: string + pvc: + properties: + accessModes: + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object s3: properties: bucket: type: string + caBundle: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic credentialsSecret: type: string endpointUrl: @@ -264,12 +385,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.19.0 labels: app.kubernetes.io/component: crd app.kubernetes.io/name: percona-xtradb-cluster app.kubernetes.io/part-of: percona-xtradb-cluster-operator - app.kubernetes.io/version: v1.18.0 + app.kubernetes.io/version: v1.19.1 name: perconaxtradbclusterrestores.pxc.percona.com spec: group: pxc.percona.com @@ -382,10 +503,111 @@ spec: latestRestorableTime: format: date-time type: string + pvc: + properties: + accessModes: + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object s3: properties: bucket: type: string + caBundle: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic credentialsSecret: type: string endpointUrl: @@ -457,6 +679,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -563,10 +802,111 @@ spec: latestRestorableTime: format: date-time type: string + pvc: + properties: + accessModes: + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object s3: properties: bucket: type: string + caBundle: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic credentialsSecret: type: string endpointUrl: @@ -675,12 +1015,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.19.0 labels: app.kubernetes.io/component: crd app.kubernetes.io/name: percona-xtradb-cluster app.kubernetes.io/part-of: percona-xtradb-cluster-operator - app.kubernetes.io/version: v1.18.0 + app.kubernetes.io/version: v1.19.1 name: perconaxtradbclusters.pxc.percona.com spec: group: pxc.percona.com @@ -1091,6 +1431,10 @@ spec: timeoutSeconds: type: number type: object + runningDeadlineSeconds: + default: 1200 + format: int64 + type: integer schedule: items: properties: @@ -1640,6 +1984,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1875,6 +2236,19 @@ spec: properties: bucket: type: string + caBundle: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic credentialsSecret: type: string endpointUrl: @@ -2074,6 +2448,9 @@ spec: suspendedDeadlineSeconds: format: int64 type: integer + ttlSecondsAfterFinished: + format: int32 + type: integer type: object crVersion: type: string @@ -2679,9 +3056,46 @@ spec: rule: '!(has(self.loadBalancerClass)) || self.type == ''LoadBalancer''' externalTrafficPolicy: type: string + extraPVCs: + items: + properties: + claimName: + minLength: 1 + type: string + mountPath: + minLength: 1 + type: string + name: + minLength: 1 + type: string + readOnly: + type: boolean + subPath: + type: string + required: + - claimName + - mountPath + - name + type: object + type: array gracePeriod: format: int64 type: integer + healthCheck: + properties: + fall: + format: int32 + minimum: 1 + type: integer + interval: + format: int32 + minimum: 1000 + type: integer + rise: + format: int32 + minimum: 1 + type: integer + type: object hookScript: type: string image: @@ -3171,6 +3585,23 @@ spec: kind: type: string metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string type: object spec: properties: @@ -3565,6 +3996,23 @@ spec: volumeClaimTemplate: properties: metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string type: object spec: properties: @@ -3956,6 +4404,29 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + userAnnotations: + additionalProperties: + type: string + type: object + required: + - keyType + - signerName + type: object secret: properties: items: @@ -4188,6 +4659,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -4616,6 +5104,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -5258,6 +5769,29 @@ spec: runtimeClassName: type: string type: object + passwordGenerationOptions: + properties: + maxLength: + default: 20 + maximum: 32 + minimum: 8 + type: integer + minLength: + default: 16 + maximum: 32 + minimum: 8 + type: integer + symbols: + default: '!#$%&()*+,-.<=>?@[]^_{}~' + maxLength: 32 + type: string + required: + - maxLength + - minLength + - symbols + type: object + x-kubernetes-validations: + - rule: self.maxLength >= self.minLength pause: type: boolean platform: @@ -6113,6 +6647,28 @@ spec: rule: '!(has(self.loadBalancerClass)) || self.type == ''LoadBalancer''' externalTrafficPolicy: type: string + extraPVCs: + items: + properties: + claimName: + minLength: 1 + type: string + mountPath: + minLength: 1 + type: string + name: + minLength: 1 + type: string + readOnly: + type: boolean + subPath: + type: string + required: + - claimName + - mountPath + - name + type: object + type: array gracePeriod: format: int64 type: integer @@ -6577,6 +7133,38 @@ spec: type: object runtimeClassName: type: string + scheduler: + properties: + checkTimeoutMilliseconds: + default: 2000 + format: int32 + type: integer + enabled: + type: boolean + failureThreshold: + default: 3 + format: int32 + type: integer + maxConnections: + default: 1000 + format: int32 + type: integer + nodeCheckIntervalMilliseconds: + default: 2000 + format: int32 + type: integer + pingTimeoutMilliseconds: + default: 1000 + format: int32 + type: integer + successThreshold: + default: 1 + format: int32 + type: integer + writerIsAlsoReader: + default: true + type: boolean + type: object schedulerName: type: string serviceAccountName: @@ -6599,6 +7187,23 @@ spec: kind: type: string metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string type: object spec: properties: @@ -6993,6 +7598,23 @@ spec: volumeClaimTemplate: properties: metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string type: object spec: properties: @@ -7384,6 +8006,29 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + userAnnotations: + additionalProperties: + type: string + type: object + required: + - keyType + - signerName + type: object secret: properties: items: @@ -7616,6 +8261,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -8044,6 +8706,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -9009,6 +9694,28 @@ spec: rule: '!(has(self.loadBalancerClass)) || self.type == ''LoadBalancer''' externalTrafficPolicy: type: string + extraPVCs: + items: + properties: + claimName: + minLength: 1 + type: string + mountPath: + minLength: 1 + type: string + name: + minLength: 1 + type: string + readOnly: + type: boolean + subPath: + type: string + required: + - claimName + - mountPath + - name + type: object + type: array gracePeriod: format: int64 type: integer @@ -9244,6 +9951,11 @@ spec: items: type: string type: array + mysqlAllocator: + enum: + - jemalloc + - tcmalloc + type: string nodeSelector: additionalProperties: type: string @@ -9528,6 +10240,23 @@ spec: kind: type: string metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string type: object spec: properties: @@ -9922,6 +10651,23 @@ spec: volumeClaimTemplate: properties: metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string type: object spec: properties: @@ -10313,6 +11059,29 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + userAnnotations: + additionalProperties: + type: string + type: object + required: + - keyType + - signerName + type: object secret: properties: items: @@ -10545,6 +11314,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -10973,6 +11759,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -11385,6 +12194,10 @@ spec: items: type: string type: array + caValidityDuration: + type: string + certValidityDuration: + type: string enabled: type: boolean issuerConf: diff --git a/charts/pxc-operator/templates/_helpers.tpl b/charts/pxc-operator/templates/_helpers.tpl index 2c3d5154..7089f171 100644 --- a/charts/pxc-operator/templates/_helpers.tpl +++ b/charts/pxc-operator/templates/_helpers.tpl @@ -53,4 +53,15 @@ Functions returns image URI according to parameters set {{- else }} {{- printf "%s:%s" .Values.operatorImageRepository .Chart.AppVersion }} {{- end }} -{{- end -}} \ No newline at end of file +{{- 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 }} diff --git a/charts/pxc-operator/templates/deployment.yaml b/charts/pxc-operator/templates/deployment.yaml index 5cb8530d..385e854c 100644 --- a/charts/pxc-operator/templates/deployment.yaml +++ b/charts/pxc-operator/templates/deployment.yaml @@ -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 }} diff --git a/charts/pxc-operator/values.yaml b/charts/pxc-operator/values.yaml index 719d77c5..35a7b95c 100644 --- a/charts/pxc-operator/values.yaml +++ b/charts/pxc-operator/values.yaml @@ -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 diff --git a/releasenotes/notes/pxc-operator-1.19-81cf91e820a2d33e.yaml b/releasenotes/notes/pxc-operator-1.19-81cf91e820a2d33e.yaml new file mode 100644 index 00000000..ff1820c6 --- /dev/null +++ b/releasenotes/notes/pxc-operator-1.19-81cf91e820a2d33e.yaml @@ -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. diff --git a/roles/defaults/vars/main.yml b/roles/defaults/vars/main.yml index 34135204..f349d18a 100644 --- a/roles/defaults/vars/main.yml +++ b/roles/defaults/vars/main.yml @@ -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" diff --git a/roles/percona_xtradb_cluster/vars/main.yml b/roles/percona_xtradb_cluster/vars/main.yml index 20f07618..3d6e31a8 100644 --- a/roles/percona_xtradb_cluster/vars/main.yml +++ b/roles/percona_xtradb_cluster/vars/main.yml @@ -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 diff --git a/roles/percona_xtradb_cluster/vars_test.go b/roles/percona_xtradb_cluster/vars_test.go index 42254a59..01ce7869 100644 --- a/roles/percona_xtradb_cluster/vars_test.go +++ b/roles/percona_xtradb_cluster/vars_test.go @@ -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)^ ") diff --git a/roles/percona_xtradb_cluster_operator/tasks/main.yml b/roles/percona_xtradb_cluster_operator/tasks/main.yml index 1cb62637..bcae9601 100644 --- a/roles/percona_xtradb_cluster_operator/tasks/main.yml +++ b/roles/percona_xtradb_cluster_operator/tasks/main.yml @@ -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