1. Percona Operator for MySQL is deployed.
  See if the operator Pod is running:

    kubectl get pods -l app.kubernetes.io/name=ps-operator --namespace {{ .Release.Namespace }}

  Check the operator logs if the Pod is not starting:

    export POD=$(kubectl get pods -l app.kubernetes.io/name=ps-operator --namespace {{ .Release.Namespace }} --output name)
    kubectl logs $POD --namespace={{ .Release.Namespace }}

2. Deploy the database cluster from ps-db chart:

    helm install my-db percona/ps-db --namespace={{ .Release.Namespace }}

{{- if .Release.IsUpgrade }}
  {{- $ctx := dict "upgradeCrd" false }}
  {{- $crdNames := list "perconaservermysqlbackups.ps.percona.com" "perconaservermysqlrestores.ps.percona.com" "perconaservermysqls.ps.percona.com" }}
  {{- range $name := $crdNames }}
    {{- $crd := lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" $name }}
    {{- if $crd }}
      {{- $crdLabels := (($crd).metadata).labels | default dict }}
      {{- $crdVersion := index $crdLabels "app.kubernetes.io/version" }}
      {{- if or (not $crdVersion) (semverCompare (printf "< %s" $.Chart.AppVersion) (trimPrefix "v" $crdVersion)) }}
        {{- $_ := set $ctx "upgradeCrd" true }}
      {{- end }}
    {{- end }}
  {{- end }}
  {{- if $ctx.upgradeCrd }}

** WARNING ** During Helm upgrade CRDs are not automatically upgraded.

Consider upgrading to the latest version of the CRDs using the command below:

    kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/percona/percona-server-mysql-operator/v{{ .Chart.AppVersion }}/deploy/crd.yaml

Ensure all deprecated fields are reviewed as part of the upgrade process, especially when running multiple PS Operator versions in the same cluster. Deprecated fields may be removed or unsupported in newer CRD versions.
  {{- end }}
{{- end }}

Read more in our documentation: https://docs.percona.com/percona-operator-for-mysql/ps/
