A virtual provider for the Gardener Machine Controller Manager thar provides a Driver implementation that creates virtual k8s Nodes
in a virtual shoot cluster. It can mimic AWS/GCP/Azure Nodes
depending on the MachineClass
. At the moment only AWS is supported. A helper CLI tool dev
is also provided to setup and then start services: KVCL (virtual cluster: api-server
, etcd
, kube-scheduler
), MCM (machine-controller-manager
), CA (cluster-autoscaler
) as well as MC (this virtual machine-controller
)
- To enable dev-testing and debugging of the MCM and the CA on your local box with low resource usage and very simple setup. No Docker Desktop, no Kind, no complexity - just plain OS processes who write their logs to the
/tmp
directory. - To enable integration tests to execute and validate PR submissions on the core
machine-controller-manager
repository.
Note
Make sure you are signed into the SAP network before executing setup!
- KVCL (kubernetes virtual cluster). Checkout https://github.com/unmarshall/kvcl/ into your GOPATH. Ex: into
$GOPATH/src/github.com/unmarshall/kvcl
- Autoscaler (gardener autoscaler). Checkout https://github.com/gardener/autoscaler/ into
$GOPATH/src/k8s.io/autoscaler
. - MCM (machine-controller-manager). Checkout https://github.com/gardener/machine-controller-manager/ into
$GOPATH/src/github.com/elankath/machine-controller-manager
- Change to the project base directory
- Execute:
go build -v -o bin/dev cmd/dev/main.go
- (optional) Clear the
gen
directory if you want a fresh setup:rm -rf gen/
- Execute:
./bin/dev setup -h
to view command help - Execute:
./bin/dev setup -project <gardenerProjName> -shoot <gardenerShootName>
➤ ./bin/dev setup -h git:main*
Usage of setup:
-ca-dir string
CA Project Dir - fallback to env CA_DIR (default "/Users/I034796/go/src/k8s.io/autoscaler/cluster-autoscaler")
-kvcl-dir string
KVCL Project Dir - fallback to env KVCL_DIR (default "/Users/I034796/go/src/github.com/unmarshall/kvcl")
-landscape string
SAP Gardener Landscape - fallback to env LANDSCAPE (default "sap-landscape-dev")
-mcm-dir string
MCM Project Dir - fallback to env MCM_DIR (default "/Users/I034796/go/src/github.com/gardener/machine-controller-manager")
-project string
Gardener Project - fallback to env PROJECT
-shoot string
Gardener Shoot Name - fallback to env SHOOT
-skip-build
Skips building binaries if already present
- Will download/build the binaries for the virtual cluster, MCM, MC, CA etc
- It also downloads
MachineClass
,MachineDeployment
,Secrets
of the machine class and other resources from a real world Gardener cluster specified by the-lanscape
,-project
and-shoot
options. - The idea is to set up things in such a way that the MCM, MC and CA components can use the configuration of a remote gardener cluster replicated on a local virtual cluster.
- NOTE: GENERATES
StartConfig
insidegen/start-config.json
.- KINDLY EDIT this file to customize local startup options of gardener MCM (machine-controller-manager), MC (virtual machine-controller) and CA (cluster-autoscaler)
- Execute:
./bin/dev start -h
to view command help
Usage of start:
-all
Starts ALL services
-ca
Start CA (gardener cluster-autoscaler)
-mc
Start MC (virtual machine-controller)
-mcm
Start MCM (gardener machine-controller-manager)
NOTE: "start" with no specified option starts ONLY KVCL (virtual-cluster)
- Execute:
./bin/dev start -all
#launches KVCL, MCM, MC and CA
- Execute:
./bin/dev start
- Execute:
./bin/dev start -mcm
- Execute:
./bin/dev start -mcm -mc
- Execute:
./bin/dev start -mcm -mc -ca
- Execute:
./bin/dev status -h
to view command help
Usage of status:
-all
check status of ALL services
-ca
check status CA (gardener cluster-autoscaler)
-mc
check status MC (virtual machine-controller)
-mcm
check status MCM (gardener machine-controller-manager)
NOTE: "status" with no option specified checks status of only kvcl (virtual-cluster)
- source
gen/env
# Sources generated env variables such asKUBECONFIG
andSHOOT_NAMESPACE
- Listing control plane objects
kubectl config set-context --current --namespace=<SHOOT_NAMESPACE>
kubectl get mcc,mcd,mc
NAME AGE
machineclass.machine.sapcloud.io/shoot--i034796--aw-a-z1-ccb6a 11m
machineclass.machine.sapcloud.io/shoot--i034796--aw-b-z1-44b8a 11m
machineclass.machine.sapcloud.io/shoot--i034796--aw-c-z1-c7d6c 11m
NAME READY DESIRED UP-TO-DATE AVAILABLE AGE
machinedeployment.machine.sapcloud.io/shoot--i034796--aw-a-z1 1 1 1 1 11m
machinedeployment.machine.sapcloud.io/shoot--i034796--aw-b-z1 11m
machinedeployment.machine.sapcloud.io/shoot--i034796--aw-c-z1 11m
NAME STATUS AGE NODE
machine.machine.sapcloud.io/shoot--i034796--aw-a-z1-c9478-99wwq Running 11m shoot--i034796--aw-a-z1-c9478-99wwq
- Listing data plane objects
kubectl get no
TODO