Operator Upgrade in old Kubernetes Version 1.18 - cniackz/public GitHub Wiki
In old kubernetes version, we are going to test Operator Upgrade
- Initial Operator: v4.5.3
- Final Operator: v5.0.3
- K8s version is 1.18
- Deploy old cluster in
kind
by following steps from https://github.com/kubernetes-sigs/kind/issues/2315
$ kind create cluster --image kindest/node:v1.18.19@sha256:7af1492e19b3192a79f606e43c35fb741e520d195f96399284515f077b3b622c --config kind-config.yaml
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.18.19) 🖼
✓ Preparing nodes 📦 📦 📦 📦 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
✓ Installing CNI 🔌
✓ Installing StorageClass 💾
✓ Joining worker nodes 🚜
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂
$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-08T19:58:30Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.19", GitCommit:"ac0cc736d0018d817c763083945e4db863168d12", GitTreeState:"clean", BuildDate:"2021-05-28T00:06:59Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.26) and server (1.18) exceeds the supported minor version skew of +/-1
- Install initial operator version:
$ kubectl apply -k github.com/minio/operator/resources/\?ref\=v4.5.3
-
Put a tenant and it is healthy and put some objects.
-
Upgrade:
$ kubectl apply -k github.com/minio/operator/resources/\?ref\=v5.0.3
Result:
$ kubectl apply -k github.com/minio/operator/resources/\?ref\=v5.0.3
namespace/minio-operator unchanged
customresourcedefinition.apiextensions.k8s.io/policybindings.sts.min.io created
customresourcedefinition.apiextensions.k8s.io/tenants.minio.min.io configured
serviceaccount/console-sa unchanged
serviceaccount/minio-operator unchanged
clusterrole.rbac.authorization.k8s.io/console-sa-role configured
clusterrole.rbac.authorization.k8s.io/minio-operator-role configured
clusterrolebinding.rbac.authorization.k8s.io/console-sa-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/minio-operator-binding unchanged
configmap/console-env unchanged
secret/console-sa-secret unchanged
service/console configured
service/operator configured
service/sts created
deployment.apps/console configured
deployment.apps/minio-operator configured
- Check is still functional after upgrade:
$ mc admin info myminio --insecure
● cesar-pool-0-0.cesar-hl.default.svc.cluster.local:9000
Uptime: 3 minutes
Version: 2023-04-07T05:28:58Z
Network: 4/4 OK
Drives: 4/4 OK
Pool: 1
● cesar-pool-0-1.cesar-hl.default.svc.cluster.local:9000
Uptime: 3 minutes
Version: 2023-04-07T05:28:58Z
Network: 4/4 OK
Drives: 4/4 OK
Pool: 1
● cesar-pool-0-2.cesar-hl.default.svc.cluster.local:9000
Uptime: 3 minutes
Version: 2023-04-07T05:28:58Z
Network: 4/4 OK
Drives: 4/4 OK
Pool: 1
● cesar-pool-0-3.cesar-hl.default.svc.cluster.local:9000
Uptime: 3 minutes
Version: 2023-04-07T05:28:58Z
Network: 4/4 OK
Drives: 4/4 OK
Pool: 1
Pools:
1st, Erasure sets: 1, Drives per erasure set: 16
2 B Used, 1 Bucket, 1 Object
16 drives online, 0 drives offline
Pods:
$ k get pods -n default -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
cesar-pool-0-0 2/2 Running 0 3m57s 10.244.2.10 kind-worker2 <none> <none>
cesar-pool-0-1 2/2 Running 0 4m7s 10.244.3.9 kind-worker <none> <none>
cesar-pool-0-2 2/2 Running 0 4m17s 10.244.4.9 kind-worker4 <none> <none>
cesar-pool-0-3 2/2 Running 0 4m26s 10.244.1.8 kind-worker3 <none> <none>
Now two containers in MinIO Pods,
sidecar
got introduced in version5.0.X
:
$ k get pod cesar-pool-0-0 -n default -o yaml | yq '.spec.containers[0].name'
minio
$ k get pod cesar-pool-0-0 -n default -o yaml | yq '.spec.containers[1].name'
sidecar
- Upgrade was successful: