Out of tree (controller based) implementation for Azure as a new provider.
The Azure Out Of Tree provider implements the interface defined at MCM OOT driver.
Following are the basic development principles for this external plugin:
- Communication between this Machine Controller (MC) and Machine Controller Manager (MCM) is achieved using the Kubernetes native declarative approach.
- Machine Controller (MC) behaves as the controller used to interact with the cloud provider Microsoft Azure and manage the VMs corresponding to the machine objects.
- Machine Controller Manager (MCM) deals with higher level objects such as
MachineSetandMachineDeploymentobjects.
-
Open terminal pointing to
$GOPATH/src/github.com/gardener. Clone this repository. -
Navigate to
$GOPATH/src/github.com/gardener/machine-controller-manager-provider-azure.-
In the
MAKEFILEmake sure that$TARGET_KUBECONFIGpoints to the kubeconfig file of the cluster where you wish to manage machines. This points to the shoot cluster in the context of Gardener.$CONTROL_KUBECONFIGpoints to the kubeconfig file of the cluster which holds these machine CRs. This points to the seed cluster in the context of Gardener.$CONTROL_NAMESPACErepresents the namespaces where MCM is looking for machine CR objects.
-
Run the machine controller (driver) using the command below.
make start
-
-
On the second terminal pointing to
$GOPATH/src/github.com/gardener,- Clone the latest MCM code
git clone [email protected]:gardener/machine-controller-manager.git
- Navigate to the newly created directory.
cd machine-controller-manager - Deploy the required CRDs from the machine-controller-manager repo,
kubectl apply -f kubernetes/crds.yaml
- Run the machine-controller-manager
make start
- Clone the latest MCM code
-
On the third terminal pointing to
$GOPATH/src/github.com/gardener/machine-controller-manager-provider-azureFill in the object files given below and deploy them as described below:
-
Deploy
kubernetes secretfor Azure.kubectl apply -f kubernetes/secret.yaml
-
Deploy
MachineClasskubectl apply -f kubernetes/machine-class.yaml
-
Deploy
Machineobject and make sure it joins the cluster successfully.kubectl apply -f kubernetes/machine.yaml
-
Once machine joins, you can test by deploying a machine-deployment.
-
Deploy the
MachineDeploymentobject and make sure it joins the cluster successfully.kubectl apply -f kubernetes/machine-deployment.yaml
-
Make sure to delete both the
MachineandMachineDeploymentobject after use.kubectl delete -f kubernetes/machine.yaml kubectl delete -f kubernetes/machine-deployment.yaml
-
- Steps to be followed while implementing/testing a new provider are mentioned here