Sitelet https://github.com/kubernetes/kops/pull/18601/files
Skip to content
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
195 changes: 0 additions & 195 deletions cmd/kops-controller/controllers/hosts_controller.go

This file was deleted.

28 changes: 0 additions & 28 deletions cmd/kops-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
coordinationv1 "k8s.io/api/coordination/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/klog/v2"
"k8s.io/klog/v2/klogr"
Expand Down Expand Up @@ -260,11 +259,6 @@ func main() {
os.Exit(1)
}

if err := addGossipController(mgr, &opt); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "GossipController")
os.Exit(1)
}

// +kubebuilder:scaffold:builder

if opt.CAPI.IsEnabled() {
Expand Down Expand Up @@ -390,28 +384,6 @@ func addNodeController(ctx context.Context, mgr manager.Manager, opt *config.Opt
return nil
}

func addGossipController(mgr manager.Manager, opt *config.Options) error {
if opt.Discovery == nil || !opt.Discovery.Enabled {
return nil
}

configMapID := types.NamespacedName{
Namespace: "kube-system",
Name: "coredns",
}

controller, err := controllers.NewHostsReconciler(mgr, opt, configMapID)
if err != nil {
return err
}

if err := controller.SetupWithManager(mgr); err != nil {
return err
}

return nil
}

// Reconciler is the interface for a standard Reconciler.
type Reconciler interface {
SetupWithManager(mgr manager.Manager) error
Expand Down
9 changes: 0 additions & 9 deletions cmd/kops-controller/pkg/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ type Options struct {
// EnableCloudIPAM enables the cloud IPAM controller.
EnableCloudIPAM bool `json:"enableCloudIPAM,omitempty"`

// Discovery configures options relating to discovery, particularly for gossip mode.
Discovery *DiscoveryOptions `json:"discovery,omitempty"`

// CAPI configures Cluster API (CAPI) support.
CAPI *CAPIOptions `json:"capi,omitempty"`
}
Expand Down Expand Up @@ -95,9 +92,3 @@ type ServerProviderOptions struct {
Azure *azure.AzureVerifierOptions `json:"azure,omitempty"`
Linode *linode.LinodeVerifierOptions `json:"linode,omitempty"`
}

// DiscoveryOptions configures our support for discovery, particularly gossip DNS (i.e. k8s.local)
type DiscoveryOptions struct {
// Enabled specifies whether support for discovery population is enabled.
Enabled bool `json:"enabled"`
}
21 changes: 0 additions & 21 deletions cmd/kops/create_cluster_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,6 @@ import (

var MagicTimestamp = metav1.Time{Time: time.Date(2017, 1, 1, 0, 0, 0, 0, time.UTC)}

// TestCreateClusterGossipAWS creates a minimal AWS gossip cluster
func TestCreateClusterGossipAWS(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/gossip-aws", "v1alpha2")
}

// TestCreateClusterGossipAzure creates a minimal Azure gossip cluster
func TestCreateClusterGossipAzure(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/gossip-azure", "v1alpha2")
}

// TestCreateClusterGossipGCE creates a cminimal GCE gossip cluster
func TestCreateClusterGossipGCE(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/gossip-gce", "v1alpha2")
}

// TestCreateClusterGossipHetzner creates a minimal Hetzner gossip cluster
func TestCreateClusterGossipHetzner(t *testing.T) {
t.Setenv("HCLOUD_TOKEN", "REDACTED")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/gossip-hetzner", "v1alpha2")
}

// TestCreateClusterMinimal runs kops create cluster minimal.example.com --zones us-test-1a
func TestCreateClusterMinimal(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.32", "v1alpha2")
Expand Down
64 changes: 1 addition & 63 deletions cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,42 +246,6 @@ const (
nodeProblemDetectorAddon = "node-problem-detector.addons.k8s.io-k8s-1.17"
)

// TestMinimalGossipAWS runs the test on a minimum gossip configuration on AWS
func TestMinimalGossipAWS(t *testing.T) {
newIntegrationTest("gossip.k8s.local", "gossip-aws").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
awsCCMAddon,
).
runTestTerraformAWS(t)
}

// TestMinimalGossipAzure runs the test on a minimum gossip configuration on Azure
func TestMinimalGossipAzure(t *testing.T) {
newIntegrationTest("gossip.k8s.local", "gossip-azure").
runTestTerraformAzure(t)
}

// TestMinimalGossipGCE runs the test on a minimum gossip configuration on GCE
func TestMinimalGossipGCE(t *testing.T) {
newIntegrationTest("gossip.k8s.local", "gossip-gce").
withAddons(
dnsControllerAddon,
gcpCCMAddon,
gcpPDCSIAddon,
).
runTestTerraformGCE(t)
}

// TestMinimalGossipHetzner runs the test on a minimum gossip configuration on Hetzner
func TestMinimalGossipHetzner(t *testing.T) {
t.Setenv("HCLOUD_TOKEN", "REDACTED")
newIntegrationTest("gossip.k8s.local", "gossip-hetzner").
withAddons(dnsControllerAddon).
runTestTerraformHetzner(t)
}

// TestMinimalAWS runs the test on a minimum configuration, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestMinimalAWS(t *testing.T) {
newIntegrationTest("minimal-aws.example.com", "minimal-aws").
Expand Down Expand Up @@ -385,32 +349,6 @@ func TestNvidia(t *testing.T) {
runTestTerraformAWS(t)
}

// TestMinimal runs the test on a minimum gossip configuration
func TestMinimalGossip(t *testing.T) {
newIntegrationTest("minimal.k8s.local", "minimal_gossip").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
awsCCMAddon,
).
runTestTerraformAWS(t)
}

// TestMinimal runs the test on a minimum gossip configuration with irsa enabled
func TestMinimalGossipIRSA(t *testing.T) {
newIntegrationTest("minimal.k8s.local", "minimal_gossip_irsa").
withOIDCDiscovery().
withServiceAccountRole("aws-cloud-controller-manager.kube-system", true).
withServiceAccountRole("ebs-csi-controller-sa.kube-system", true).
withServiceAccountRole("aws-node-termination-handler.kube-system", true).
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
awsCCMAddon,
).
runTestTerraformAWS(t)
}

// TestMinimalGCE runs tests on a minimal GCE configuration
func TestMinimalGCE(t *testing.T) {
newIntegrationTest("minimal-gce.example.com", "minimal_gce").
Expand Down Expand Up @@ -517,7 +455,7 @@ func TestMinimalGCEDNSNone(t *testing.T) {
runTestTerraformGCE(t)
}

// TestMinimalScaleway runs tests on a minimal Scaleway cluster with gossip DNS
// TestMinimalScaleway runs tests on a minimal Scaleway cluster
func TestMinimalScaleway(t *testing.T) {
t.Setenv("SCW_PROFILE", "REDACTED")
newIntegrationTest("scw-minimal.k8s.local", "minimal_scaleway").
Expand Down
Loading
Loading