Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

✨ Control Plane Upgrades #290

Merged
merged 13 commits into from
Jul 20, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var defaultClusterVersion = &v1alpha1.ClusterVersionSpec{
},
},
UpdateStrategy: appsv1.StatefulSetUpdateStrategy{
Type: appsv1.OnDeleteStatefulSetStrategyType,
Type: appsv1.RollingUpdateStatefulSetStrategyType,
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -247,7 +247,7 @@ var defaultClusterVersion = &v1alpha1.ClusterVersionSpec{
},
},
UpdateStrategy: appsv1.StatefulSetUpdateStrategy{
Type: appsv1.OnDeleteStatefulSetStrategyType,
Type: appsv1.RollingUpdateStatefulSetStrategyType,
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -302,6 +302,7 @@ var defaultClusterVersion = &v1alpha1.ClusterVersionSpec{
{
ContainerPort: 6443,
Name: "api",
Protocol: corev1.ProtocolTCP, // Must be explicit in 1.19
},
},
LivenessProbe: &corev1.Probe{
Expand Down Expand Up @@ -453,7 +454,7 @@ var defaultClusterVersion = &v1alpha1.ClusterVersionSpec{
},
},
UpdateStrategy: appsv1.StatefulSetUpdateStrategy{
Type: appsv1.OnDeleteStatefulSetStrategyType,
Type: appsv1.RollingUpdateStatefulSetStrategyType,
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand Down
23 changes: 23 additions & 0 deletions virtualcluster/pkg/controller/controllers/metrics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package controllers

import (
"github.com/prometheus/client_golang/prometheus"
)

var (
clustersUpdatedCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "clusters_updated",
Help: "Amount of clusters upgraded by reconciler in featuregate.ClusterVersionApplyCurrentState",
},
[]string{"cluster_version", "resource_version"},
)
clustersUpdateSeconds = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "clusters_update_seconds",
Help: "Duration of cluster upgrade by reconciler in featuregate.ClusterVersionApplyCurrentState",
Buckets: []float64{.1, .5, 1, 5, 10, 20, 30, 60, 90, 120, 300, 600, 900},
},
[]string{"cluster_version", "resource_version"},
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ type Provisioner interface {
CreateVirtualCluster(ctx context.Context, vc *tenancyv1alpha1.VirtualCluster) error
DeleteVirtualCluster(ctx context.Context, vc *tenancyv1alpha1.VirtualCluster) error
GetProvisioner() string
// UpgradeVirtualCluster is used to apply current clusterversion if featuregate.VirtualClusterApplyUpdate enabled
UpgradeVirtualCluster(ctx context.Context, vc *tenancyv1alpha1.VirtualCluster) error
}
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,7 @@ OuterLoop:
func (mpa *Aliyun) GetProvisioner() string {
return "aliyun"
}

func (mpa *Aliyun) UpgradeVirtualCluster(ctx context.Context, vc *tenancyv1alpha1.VirtualCluster) error {
return fmt.Errorf("not implemented")
}
Loading