Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

chore: disable CrossClusterDiscovery feature by default #1298

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ higher-level APIs:

- **Status** collects the status of resources distributed by KubeFed across all federated clusters
- **Policy** determines which subset of clusters a resource is allowed to be distributed to
- **Scheduling** refers to a decision-making capability that can decide how
- **Scheduling** refers to a decision-making capability that can decide how
workloads should be spread across different clusters similar to how a human
operator would

Expand All @@ -57,7 +57,7 @@ higher-level APIs:
| [Push propagation of arbitrary types to remote clusters](https://github.com/kubernetes-sigs/kubefed/blob/master/docs/userguide.md#verify-your-deployment-is-working) | Alpha | PushReconciler | true |
| [CLI utility (`kubefedctl`)](https://github.com/kubernetes-sigs/kubefed/blob/master/docs/userguide.md#kubefedctl-cli) | Alpha | | |
| [Generate KubeFed APIs without writing code](https://github.com/kubernetes-sigs/kubefed/blob/master/docs/userguide.md#enabling-federation-of-an-api-type) | Alpha | | |
| [Multicluster Service DNS via `external-dns`](https://github.com/kubernetes-sigs/kubefed/blob/master/docs/servicedns-with-externaldns.md) | Alpha | CrossClusterServiceDiscovery | true |
| [Multicluster Service DNS via `external-dns`](https://github.com/kubernetes-sigs/kubefed/blob/master/docs/servicedns-with-externaldns.md) | Alpha | CrossClusterServiceDiscovery | false |
| [Multicluster Ingress DNS via `external-dns`](https://github.com/kubernetes-sigs/kubefed/blob/master/docs/ingressdns-with-externaldns.md) | Alpha | FederatedIngress | true |
| [Replica Scheduling Preferences](https://github.com/kubernetes-sigs/kubefed/blob/master/docs/userguide.md#replicaschedulingpreference) | Alpha | SchedulerPreferences | true |

Expand Down
2 changes: 1 addition & 1 deletion charts/kubefed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ chart and their default values.
| controllermanager.imagePullPolicy | Image pull policy. | IfNotPresent |
| controllermanager.featureGates.PushReconciler | Push reconciler feature. | true |
| controllermanager.featureGates.SchedulerPreferences | Scheduler preferences feature. | true |
| controllermanager.featureGates.CrossClusterServiceDiscovery | Cross cluster service discovery feature. | true |
| controllermanager.featureGates.CrossClusterServiceDiscovery | Cross cluster service discovery feature. | false |
| controllermanager.featureGates.FederatedIngress | Federated ingress feature. | true |
| controllermanager.clusterAvailableDelay | Time to wait before reconciling on a healthy cluster. | 20s |
| controllermanager.clusterUnavailableDelay | Time to wait before giving up on an unhealthy cluster. | 60s |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- name: SchedulerPreferences
configuration: {{ .Values.featureGates.SchedulerPreferences | default "Enabled" | quote }}
- name: CrossClusterServiceDiscovery
configuration: {{ .Values.featureGates.CrossClusterServiceDiscovery | default "Enabled" | quote }}
configuration: {{ .Values.featureGates.CrossClusterServiceDiscovery | default "Disabled" | quote }}
- name: FederatedIngress
configuration: {{ .Values.featureGates.FederatedIngress | default "Enabled" | quote }}
{{- end }}
2 changes: 2 additions & 0 deletions cmd/controller-manager/app/controller-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ func startControllers(opts *options.Options, stopChan <-chan struct{}) {
}

if utilfeature.DefaultFeatureGate.Enabled(features.CrossClusterServiceDiscovery) {
klog.Warningf("The feature '%s' is deprecated and will be removed in a future release.", features.CrossClusterServiceDiscovery)

if err := servicedns.StartController(opts.Config, stopChan); err != nil {
klog.Fatalf("Error starting dns controller: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ func init() {
var DefaultKubeFedFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
SchedulerPreferences: {Default: true, PreRelease: featuregate.Alpha},
PushReconciler: {Default: true, PreRelease: featuregate.Beta},
CrossClusterServiceDiscovery: {Default: true, PreRelease: featuregate.Alpha},
CrossClusterServiceDiscovery: {Default: false, PreRelease: featuregate.Alpha},
FederatedIngress: {Default: true, PreRelease: featuregate.Alpha},
}
1 change: 1 addition & 0 deletions scripts/deploy-kubefed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function helm-deploy-cmd {
--set controllermanager.webhook.repository=${repo} \
--set controllermanager.webhook.image=${image} \
--set controllermanager.webhook.tag=${tag} \
--set controllermanager.featureGates.CrossClusterServiceDiscovery=Enabled \
${force_redeploy_values:-} \
--create-namespace \
--wait"
Expand Down
1 change: 1 addition & 0 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
}

if framework.TestContext.InMemoryControllers {
framework.SetUpFeatureGates()
// Start the cluster controller to ensure clusters will be
// reported as healthy when running the control plane
// in-memory.
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/framework/unmanaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
utilfeature "k8s.io/apiserver/pkg/util/feature"
kubeclientset "k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
Expand All @@ -36,6 +37,7 @@ import (
fedv1b1 "sigs.k8s.io/kubefed/pkg/apis/core/v1beta1"
genericclient "sigs.k8s.io/kubefed/pkg/client/generic"
"sigs.k8s.io/kubefed/pkg/controller/util"
"sigs.k8s.io/kubefed/pkg/features"
"sigs.k8s.io/kubefed/test/common"

. "github.com/onsi/ginkgo" //nolint:stylecheck
Expand All @@ -59,6 +61,19 @@ var (
deletedNamespaces []string
)

func SetUpFeatureGates() {
// Enable all the feature gates when running the control plane
// in-memory.
resetDefaultFeatureGates := map[string]bool{
string(features.SchedulerPreferences): true,
string(features.PushReconciler): true,
string(features.CrossClusterServiceDiscovery): true,
string(features.FederatedIngress): true,
}
err := utilfeature.DefaultMutableFeatureGate.SetFromMap(resetDefaultFeatureGates)
Expect(err).NotTo(HaveOccurred())
}

func SetUpControlPlane() {
if clusterControllerFixture != nil {
return
Expand Down