@@ -393,7 +393,161 @@ will indicate a problem with the feature.
393
393
394
394
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
395
395
396
- Upgrade and rollback will be tested when the feature gate will change to beta.
396
+ Rollout-rollback-rollout testing was performed, feature behaves as expected and no issues were observed.
397
+
398
+ ** Perform pre-upgrade tests**
399
+
400
+ Set default storage class:
401
+ ``` bash
402
+ $ kc patch sc/csi-hostpath-sc -p ' {"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
403
+ storageclass.storage.k8s.io/csi-hostpath-sc patched
404
+ ```
405
+
406
+ PVC does not get updated and remains pending:
407
+ ``` bash
408
+ $ kc get pvc
409
+ NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
410
+ csi-pvc Pending
411
+ ```
412
+
413
+ ** Upgrade cluster**
414
+
415
+ Check available 1.25 versions:
416
+ ``` bash
417
+ $ yum search kubeadm --showduplicates --quiet | grep 1.25
418
+ kubeadm-1.25.0-0.x86_64 : Command-line utility for administering a Kubernetes cluster.
419
+ kubeadm-1.25.1-0.x86_64 : Command-line utility for administering a Kubernetes cluster.
420
+ kubeadm-1.25.2-0.x86_64 : Command-line utility for administering a Kubernetes cluster.
421
+ ```
422
+
423
+ Install/update kubeadm:
424
+ ``` bash
425
+ $ sudo yum install -y kubeadm-1.25.2-0
426
+ ```
427
+
428
+ Prepare kubeadm config file that enables FeatureGate:
429
+
430
+ ``` bash
431
+ $ cat /mnt/clusterconf-examples/featuregate.yaml
432
+ # # Example kubeadm configuration for enabling a feature gate.
433
+ ---
434
+ apiVersion: kubeadm.k8s.io/v1beta3
435
+ kind: ClusterConfiguration
436
+ apiServer:
437
+ extraArgs:
438
+ feature-gates: RetroactiveDefaultStorageClass=true
439
+ controllerManager:
440
+ extraArgs:
441
+ cluster-cidr: 10.244.0.0/16
442
+ feature-gates: RetroactiveDefaultStorageClass=true
443
+ ```
444
+
445
+ Perform kubeadm upgrade:
446
+ ``` bash
447
+ $ sudo kubeadm upgrade plan --config /mnt/clusterconf-examples/featuregate.yaml
448
+ $ sudo kubeadm upgrade apply --config /mnt/clusterconf-examples/featuregate.yaml v1.25.2
449
+ ```
450
+
451
+ Perform kubelet upgrade:
452
+ ``` bash
453
+ $ sudo yum install -y kubelet-1.25.2-0
454
+ $ sudo systemctl daemon-reload
455
+ $ sudo systemctl restart kubelet
456
+ ```
457
+
458
+ ** Perform post-upgrade tests**
459
+
460
+ Verify that PVC got SC assigned right after upgrade and PV was provisioned and bound:
461
+ ``` bash
462
+ $ kc get pvc
463
+ NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
464
+ csi-pvc Bound pvc-06a964ca-f997-4780-8627-b5c3bf5a87d8 1Gi RWO csi-hostpath-sc 87m
465
+
466
+ ```
467
+
468
+ ** Downgrade cluster**
469
+
470
+ ``` bash
471
+ $ yum history | grep -E " kubeadm|kubelet"
472
+ 10 | install -y kubelet-1.25.2-0 | 2022-10-12 11:06 | Upgrade | 1
473
+ 8 | install -y kubeadm-1.25.2-0 | 2022-10-12 09:45 | Upgrade | 1
474
+ 7 | install -y kubelet-1.24.5-0 kubeadm-1.24.5-0 kubectl
475
+
476
+ $ sudo yum -y history undo 8 && sudo yum -y history undo 10
477
+ ```
478
+
479
+ ** Perform post-rollback tests**
480
+
481
+ Remove default SC:
482
+ ``` bash
483
+ $ kc patch sc/csi-hostpath-sc -p ' {"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
484
+ storageclass.storage.k8s.io/csi-hostpath-sc patched
485
+ ```
486
+
487
+ Create new PVC without SC:
488
+ ``` yaml
489
+ apiVersion : v1
490
+ kind : PersistentVolumeClaim
491
+ metadata :
492
+ name : csi-pvc-2
493
+ spec :
494
+ accessModes :
495
+ - ReadWriteOnce
496
+ resources :
497
+ requests :
498
+ storage : 1Gi
499
+ ` ` `
500
+
501
+ ` ` ` bash
502
+ $ kc get pvc
503
+ NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
504
+ csi-pvc Bound pvc-06a964ca-f997-4780-8627-b5c3bf5a87d8 1Gi RWO csi-hostpath-sc 96m
505
+ csi-pvc-2 Pending
506
+ ```
507
+
508
+ Add default SC again:
509
+ ``` bash
510
+ $ kc patch sc/csi-hostpath-sc -p ' {"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
511
+ storageclass.storage.k8s.io/csi-hostpath-sc patched
512
+ ```
513
+
514
+ Verify that the new PVC did not get updated with SC this time:
515
+ ``` bash
516
+ $ kc get pvc/csi-pvc-2
517
+ NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
518
+ csi-pvc-2 Pending
519
+ ```
520
+
521
+ ** Upgrade cluster again**
522
+
523
+ Install/update kubeadm:
524
+ ``` bash
525
+ $ sudo yum install -y kubeadm-1.25.2-0
526
+ ```
527
+
528
+ Perform kubeadm upgrade:
529
+ ``` bash
530
+ $ sudo kubeadm upgrade plan --config /mnt/clusterconf-examples/featuregate.yaml
531
+ $ sudo kubeadm upgrade apply --config /mnt/clusterconf-examples/featuregate.yaml v1.25.2
532
+ ```
533
+
534
+ Perform kubelet upgrade:
535
+ ``` bash
536
+ $ sudo yum install -y kubelet-1.25.2-0
537
+ $ sudo systemctl daemon-reload
538
+ $ sudo systemctl restart kubelet
539
+ ```
540
+
541
+ ** Perform post-upgrade tests again**
542
+
543
+ Verify that PVC got SC assigned right after upgrade and PV was provisioned and bound:
544
+ ``` bash
545
+ $ kc get pvc
546
+ NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
547
+ csi-pvc Bound pvc-06a964ca-f997-4780-8627-b5c3bf5a87d8 1Gi RWO csi-hostpath-sc 117m
548
+ csi-pvc-2 Bound pvc-2e765394-f32c-42fb-b3db-ffe203612bac 1Gi RWO csi-hostpath-sc 24m
549
+ ```
550
+
397
551
398
552
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
399
553
403
557
404
558
###### How can an operator determine if the feature is in use by workloads?
405
559
406
- A counter metric will be present in KCM metric endpoint, it will show total
407
- count of successful and failed retroactive StorageClass assignments.
560
+ A counter metric called ` retroactive_storageclass_total ` will be present in KCM metric endpoint, it will show total
561
+ count of retroactive StorageClass assignment attempts. Second metric called ` retroactive_storageclass_errors_total `
562
+ will show total count of failed attempts. This means that a total number of successful assignments can be calculated as
563
+ a difference of the two metrics.
408
564
409
565
###### How can someone using this feature know that it is working for their instance?
410
566
@@ -581,6 +737,7 @@ Major milestones might include:
581
737
-->
582
738
- 1.25: initial version
583
739
- 1.26: beta
740
+ - 1.28: GA
584
741
585
742
## Drawbacks
586
743
0 commit comments