Upgrade Operator from 4.2.X to 4.5.3 - cniackz/public GitHub Wiki

Upgrade Of Operator

From: 4.2.10

To: 4.5.3

Method: helm

Install Operator old operator from 2 year ago:

  1. MAKE IT ON DEV ENVIRONMENT FIRST!!!!!

  2. Uninstall all but keep PV

  3. Install Newer Version

helm install \
     --namespace minio-operator \
     --create-namespace minio-operator \
     minio-operator-4.2.10
$ helm install \
>      --namespace minio-operator \
>      --create-namespace minio-operator \
>      minio-operator-4.2.10
NAME: minio-operator
LAST DEPLOYED: Wed May  3 11:14:17 2023
NAMESPACE: minio-operator
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the JWT for logging in to the console:
  kubectl get secret $(kubectl get serviceaccount console-sa --namespace minio-operator -o jsonpath="{.secrets[0].name}") --namespace minio-operator -o jsonpath="{.data.token}" | base64 --decode 
2. Get the Operator Console URL by running these commands:
  kubectl --namespace minio-operator port-forward svc/console 9090:9090
  echo "Visit the Operator Console at http://127.0.0.1:9090"
function JWTOperator() {
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: console-sa-secret
  namespace: minio-operator
  annotations:
    kubernetes.io/service-account.name: console-sa
type: kubernetes.io/service-account-token
EOF
SA_TOKEN=$(kubectl -n minio-operator  get secret console-sa-secret -o jsonpath="{.data.token}" | base64 --decode)
echo ""
echo ""
echo ""
echo $SA_TOKEN
echo ""
echo ""
echo ""
}
  • name: minio1 minio1 minio1-ss-0-0 <- POD data0-minio1-ss-0-0 <- PVC data0-minio1-pool-0-0
$ helm list -n minio-operator
NAME          	NAMESPACE     	REVISION	UPDATED                             	STATUS  	CHART                	APP VERSION
minio-operator	minio-operator	1       	2023-05-03 11:14:17.126583 -0400 EDT	deployed	minio-operator-4.2.10	v4.2.10
  • I would uninstall ALL

    • Tenant got saved but uninstall deleted.
    • Uninstall operator
$ helm list -n minio-operator
NAME          	NAMESPACE     	REVISION	UPDATED                             	STATUS  	CHART                	APP VERSION
minio-operator	minio-operator	1       	2023-05-03 11:14:17.126583 -0400 EDT	deployed	minio-operator-4.2.10	v4.2.10   
* Also manually removed old crd as uninstall didn't
$ k delete crd tenants.minio.min.io
customresourcedefinition.apiextensions.k8s.io "tenants.minio.min.io" deleted
  • Install newer version:
helm install \
     --namespace minio-operator \
     --create-namespace minio-operator \
     operator-4.5.3

Expected if no old CRD is present:

$ helm install \
>      --namespace minio-operator \
>      --create-namespace minio-operator \
>      operator-4.5.3
NAME: minio-operator
LAST DEPLOYED: Wed May  3 11:35:16 2023
NAMESPACE: minio-operator
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the JWT for logging in to the console:
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: console-sa-secret
  namespace: minio-operator
  annotations:
    kubernetes.io/service-account.name: console-sa
type: kubernetes.io/service-account-token
EOF
kubectl -n minio-operator  get secret console-sa-secret -o jsonpath="{.data.token}" | base64 --decode

2. Get the Operator Console URL by running these commands:
  kubectl --namespace minio-operator port-forward svc/console 9090:9090
  echo "Visit the Operator Console at http://127.0.0.1:9090"
  • I believe the trick is the pool name:

## MinIO Tenant Definition
tenant:
  # Tenant name
  name: minio1

  ...

  pools:
    ## Servers specifies the number of MinIO Tenant Pods / Servers in this pool.
    ## For standalone mode, supply 1. For distributed mode, supply 4 or more.
    ## Note that the operator does not support upgrading from standalone to distributed mode.
    - servers: 4
      ## custom name for the pool
      name: ss-0
helm install \
  --namespace default \
  --create-namespace default \
  tenant-4.5.3
$ helm install \
>   --namespace default \
>   --create-namespace default \
>   tenant-4.5.3
NAME: default
LAST DEPLOYED: Wed May  3 11:42:17 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
To connect to the minio1 tenant if it doesn't have a service exposed, you can port-forward to it by running:

  kubectl --namespace default port-forward svc/minio1-console 9443:9443

  Then visit the MinIO Console at https://127.0.0.1:9443
  • removed logs
Cesars-MacBook-Pro:Downloads cniackz$ k edit tenant -n default
tenant.minio.min.io/minio1 edited

Conclusion:

The trick is to have old pool name to re-use old PVCs.

Screenshot 2023-05-03 at 11 51 21 AM

Screenshot 2023-05-03 at 11 51 36 AM