Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete vsphere-deployer, tf-deployer. Mark gcp-deployer deprecated. #284

Merged
merged 1 commit into from
Jun 6, 2018
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ You can find an example implementation for GCE [here](https://github.com/kuberne

##### GCE Implementation

For GCE, a [yaml file](https://github.com/kubernetes-sigs/cluster-api/blob/master/gcp-deployer/machine_setup_configs.yaml) holds the list of valid machine setup configs,
For GCE, a [config map](https://github.com/kubernetes-sigs/cluster-api/blob/6aecf9c80a1ca29b45cb43ebfd50ac0d57eb7132/clusterctl/examples/google/provider-components.yaml.template#L118) holds the list of valid machine setup configs,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional to lock to a specific revision instead of using master?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The template is changing a lot and line numbers move around quite a bit.

and the yaml file is volume mounted into the machine controller using a ConfigMap named `machine-setup`.

A [config type](https://github.com/kubernetes-sigs/cluster-api/blob/master/cloud/google/machinesetup/config_types.go#L45) defines a set of parameters that can be taken from the machine object being created, and maps those parameters to startup scripts and other relevant information.
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ To learn more, see the [Cluster API KEP][cluster-api-kep].
## Getting Started
### Prerequisites
* `kubectl` is required, see [here](http://kubernetes.io/docs/user-guide/prereqs/).

### Prototype implementations
* [gcp](gcp-deployer/README.md)

* `clusterctl` is a SIG-cluster-lifecycle sponsored tool to manage Cluster API clusters. See [here](clusterctl)

## How to use the API

To see how to build tooling on top of the Cluster API, please check out a few examples below:
Expand Down
73 changes: 0 additions & 73 deletions cloud/vsphere/machineactuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ import (

"github.com/golang/glog"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"

"encoding/base64"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/cluster-api/cloud/vsphere/namedmachines"
vsphereconfig "sigs.k8s.io/cluster-api/cloud/vsphere/vsphereproviderconfig"
vsphereconfigv1 "sigs.k8s.io/cluster-api/cloud/vsphere/vsphereproviderconfig/v1alpha1"
Expand Down Expand Up @@ -98,40 +95,6 @@ func NewMachineActuator(kubeadmToken string, machineClient client.MachineInterfa
}, nil
}

// DEPRECATED: Remove when vsphere-deployer is deleted.
func (vc *VsphereClient) CreateMachineController(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine, clientSet kubernetes.Clientset) error {
if err := CreateExtApiServerRoleBinding(); err != nil {
return err
}

// Create the named machines ConfigMap.
// After pivot-based bootstrap is done, the named machine should be a ConfigMap and this logic will be removed.
namedMachines, err := vc.namedMachineWatch.NamedMachines()

if err != nil {
return err
}
yaml, err := namedMachines.GetYaml()
if err != nil {
return err
}
nmConfigMap := corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{Name: "named-machines"},
Data: map[string]string{
NamedMachinesFilename: yaml,
},
}
configMaps := clientSet.CoreV1().ConfigMaps(corev1.NamespaceDefault)
if _, err := configMaps.Create(&nmConfigMap); err != nil {
return err
}

if err := CreateApiServerAndController(vc.kubeadmToken); err != nil {
return err
}
return nil
}

func saveFile(contents, path string, perm os.FileMode) error {
return ioutil.WriteFile(path, []byte(contents), perm)
}
Expand Down Expand Up @@ -635,42 +598,6 @@ func (vc *VsphereClient) GetTfState(machine *clusterv1.Machine) (string, error)
return "", errors.New("could not get tfstate")
}

// DEPRECATED. Remove after vsphere-deployer is deleted.
// This method exists because during bootstrap some artifacts need to be transferred to the
// remote master. These include the IP address for the master, terraform state file.
// In GCE, we set this kind of data as GCE metadata. Unfortunately, vSphere does not have
// a comparable API.
func (vc *VsphereClient) SetupRemoteMaster(master *clusterv1.Machine) error {
machineName := master.ObjectMeta.Name
glog.Infof("Setting up the remote master[%s] with terraform config.", machineName)

ip, err := vc.DeploymentClient.GetIP(master)
if err != nil {
return err
}

glog.Infof("Copying the staging directory to master.")
machinePath := fmt.Sprintf(MachinePathStageFormat, machineName)
_, err = vc.remoteSshCommand(master, fmt.Sprintf("mkdir -p %s", machinePath), "~/.ssh/vsphere_tmp", "ubuntu")
if err != nil {
glog.Infof("remoteSshCommand failed while creating remote machine stage: %+v", err)
return err
}

cmd := exec.Command(
"scp", "-i", "~/.ssh/vsphere_tmp",
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null",
"-r",
machinePath,
fmt.Sprintf("ubuntu@%s:%s", ip, StageDir))
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()

return nil
}

// We are storing these as annotations and not in Machine Status because that's intended for
// "Provider-specific status" that will usually be used to detect updates. Additionally,
// Status requires yet another version API resource which is too heavy to store IP and TF state.
Expand Down
2 changes: 1 addition & 1 deletion clusterctl/main_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func setupPrerequisites() error {
}
err = cleanAndBuildClusterctl()
if err != nil {
return fmt.Errorf("unable to build gcp-deployer: %v", err)
return fmt.Errorf("unable to build clusterctl: %v", err)
}
return nil
}
Expand Down
4 changes: 4 additions & 0 deletions gcp-deployer/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## gcp-deployer is deprecated in favor of clusterctl. It will be deleted soon*.

*\*after we change the integration test to use clusterctl, and cluster delete is implemented in clusterctl.*

# Cluster API GCP Prototype

The Cluster API GCP prototype implements the [Cluster API](../README.md) for GCP.
Expand Down
2 changes: 0 additions & 2 deletions tf-deployer/.gitignore

This file was deleted.

136 changes: 0 additions & 136 deletions tf-deployer/CONTRIBUTING.md

This file was deleted.

82 changes: 0 additions & 82 deletions tf-deployer/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions tf-deployer/cluster.yaml

This file was deleted.

Loading