Skip to content

Commit

Permalink
Change of terminology, renamed instances to machines
Browse files Browse the repository at this point in the history
  • Loading branch information
prashanth26 committed Jan 9, 2018
1 parent 7b22f42 commit eb4d4e5
Show file tree
Hide file tree
Showing 185 changed files with 8,586 additions and 8,586 deletions.
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LINT_FOLDERS := $(shell echo $(PACKAGES) | sed "s|$(REPOSITORY)|.|g")
BINARY_PATH := $(REPOSITORY)/cmd/$(PROJECT)

IMAGE_REPOSITORY := kvmprashanth/node-controller-manager
IMAGE_TAG := v1
IMAGE_TAG := v2

TYPES_FILES := $(shell find pkg/apis -name types.go)

Expand Down Expand Up @@ -52,59 +52,59 @@ generate-files: .generate_files
$(BINDIR)/defaulter-gen \
--v 1 --logtostderr \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-dirs "$(REPOSITORY)/pkg/apis/node" \
--input-dirs "$(REPOSITORY)/pkg/apis/node/v1alpha1" \
--extra-peer-dirs "$(REPOSITORY)/pkg/apis/node" \
--extra-peer-dirs "$(REPOSITORY)/pkg/apis/node/v1alpha1" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine/v1alpha1" \
--extra-peer-dirs "$(REPOSITORY)/pkg/apis/machine" \
--extra-peer-dirs "$(REPOSITORY)/pkg/apis/machine/v1alpha1" \
--output-file-base "zz_generated.defaults"
# Generate deep copies
$(BINDIR)/deepcopy-gen \
--v 1 --logtostderr \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-dirs "$(REPOSITORY)/pkg/apis/node" \
--input-dirs "$(REPOSITORY)/pkg/apis/node/v1alpha1" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine/v1alpha1" \
--bounding-dirs "$(REPOSITORY)" \
--output-file-base zz_generated.deepcopy
# Generate conversions
$(BINDIR)/conversion-gen \
--v 1 --logtostderr \
--extra-peer-dirs k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-dirs "$(REPOSITORY)/pkg/apis/node" \
--input-dirs "$(REPOSITORY)/pkg/apis/node/v1alpha1" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine/v1alpha1" \
--output-file-base zz_generated.conversion
# generate openapi
$(BINDIR)/openapi-gen \
--v 1 --logtostderr \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-dirs "$(REPOSITORY)/pkg/apis/node/v1alpha1,k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine/v1alpha1,k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1" \
--output-package "$(REPOSITORY)/pkg/openapi"

# Generate the internal clientset (pkg/client/internalclientset)
${BINDIR}/client-gen "$@" \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-base "$(REPOSITORY)/pkg/apis/" \
--input node \
--input machine \
--clientset-path "$(REPOSITORY)/pkg/client" \
--clientset-name internalclientset \
# Generate the versioned clientset (pkg/client/clientset/clientset)
${BINDIR}/client-gen "$@" \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-base "$(REPOSITORY)/pkg/apis/" \
--input "node/v1alpha1" \
--input "machine/v1alpha1" \
--clientset-path "$(REPOSITORY)/pkg/client" \
--clientset-name "clientset" \
# generate lister
${BINDIR}/lister-gen "$@" \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-dirs="$(REPOSITORY)/pkg/apis/node" \
--input-dirs="$(REPOSITORY)/pkg/apis/node/v1alpha1" \
--input-dirs="$(REPOSITORY)/pkg/apis/machine" \
--input-dirs="$(REPOSITORY)/pkg/apis/machine/v1alpha1" \
--output-package "$(REPOSITORY)/pkg/client/listers" \
# generate informer
${BINDIR}/informer-gen "$@" \
--go-header-file "verify/boilerplate/boilerplate.go.txt" \
--input-dirs "$(REPOSITORY)/pkg/apis/node" \
--input-dirs "$(REPOSITORY)/pkg/apis/node/v1alpha1" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine" \
--input-dirs "$(REPOSITORY)/pkg/apis/machine/v1alpha1" \
--versioned-clientset-package "$(REPOSITORY)/pkg/client/clientset" \
--internal-clientset-package "$(REPOSITORY)/pkg/client/internalclientset" \
--listers-package "$(REPOSITORY)/pkg/client/listers" \
Expand Down
8 changes: 4 additions & 4 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ To the left are the list of copied files -> and to the right the current locatio
cmd/kube-controller-manager/app/options/options.go -> cmd/node-controller-manager/app/options/options.go
cmd/kube-controller-manager/controller_manager.go -> cmd/node-controller-manager/controller_manager.go
pkg/controller/deployment/deployment_controller.go -> pkg/controller/deployment_controller.go
pkg/controller/deployment/util/instanceset_util.go -> pkg/controller/deployment_instanceset_util.go
pkg/controller/deployment/util/replicaset_util.go -> pkg/controller/deployment_machineset_util.go
pkg/controller/deployment/progress.go -> pkg/controller/deployment_progress.go
pkg/controller/deployment/recreate.go -> pkg/controller/deployment_recreate.go
pkg/controller/deployment/rollback.go -> pkg/controller/deployment_rollback.go
pkg/controller/deployment/rolling.go -> pkg/controller/deployment_rolling.go
pkg/controller/deployment/sync.go -> pkg/controller/deployment_sync.go
pkg/controller/deployment/util/deployment_util.go -> pkg/controller/deployment_util.go
pkg/controller/deployment/util/hash_test.go -> pkg/controller/hasttest.go
pkg/controller/deployment/util/pod_util.go -> pkg/controller/instance_util.go
pkg/controller/replicaset/replica_set.go -> pkg/controller/instanceset.go
pkg/controller/deployment/util/replicaset_util.go -> pkg/controller/instanceset_util.go
pkg/controller/deployment/util/pod_util.go -> pkg/controller/machine_util.go
pkg/controller/replicaset/replica_set.go -> pkg/controller/machineset.go
pkg/controller/deployment/util/replicaset_util.go -> pkg/controller/machineset_util.go

## Dependencies

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

Node Controller Manager (NCM) manages VMs as another kubernetes custom resource. It provides a declarative way to manage VMs. The current implementation only supports AWS but can be (and will be) easily extended to support other cloud providers.

Example of managing VM:
Example of managing machine:
```
kubectl create/get/delete instance vm1
kubectl create/get/delete machine vm1
```

### Key terminologies

Nodes/Instances/Machines/VMs are different terminologies used to represent similar things. We use these terms in the following way
Nodes/Machines/VMs are different terminologies used to represent similar things. We use these terms in the following way

1. VM: A virtual machine running on any cloud provider.
1. Node: Native kubernetes node objects. The objects you get to see when you do a *"kubectl get nodes"*. Although nodes can be either physical/virtual machines, for the purposes of our discussions it refers to a VM.
1. Instance: A VM that is provisioned/managed by the Node Controller Manager.
1. Machine: Community's terminology for an Instance. The term instance shall be replaced by machines in the near future.
1. Machine: A VM that is provisioned/managed by the Node Controller Manager.

## Design of Node Controller Manager

Expand Down
16 changes: 8 additions & 8 deletions cmd/node-controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const (
controllerDiscoveryAgentName = "node-controller-discovery"
)

var nodeGVR = schema.GroupVersionResource{Group: "node.sapcloud.io", Version: "v1alpha1", Resource: "awsinstanceclasses"}
var nodeGVR = schema.GroupVersionResource{Group: "machine.sapcloud.io", Version: "v1alpha1", Resource: "awsmachineclasses"}

// Run runs the NCMServer. This should never exit.
func Run(s *options.NCMServer) error {
Expand Down Expand Up @@ -184,18 +184,18 @@ func StartControllers(s *options.NCMServer,
s.MinResyncPeriod.Duration,
)
// All shared informers are v1alpha1 API level
nodeSharedInformers := nodeInformerFactory.Node().V1alpha1()
nodeSharedInformers := nodeInformerFactory.Machine().V1alpha1()

glog.V(5).Infof("Creating controllers...")
nodeController, err := nodecontroller.NewController(
coreClient,
nodeClientBuilder.ClientOrDie(controllerManagerAgentName).NodeV1alpha1(),
nodeClientBuilder.ClientOrDie(controllerManagerAgentName).MachineV1alpha1(),
coreInformerFactory.Core().V1().Secrets(),
coreInformerFactory.Core().V1().Nodes(),
nodeSharedInformers.AWSInstanceClasses(),
nodeSharedInformers.Instances(),
nodeSharedInformers.InstanceSets(),
nodeSharedInformers.InstanceDeployments(),
nodeSharedInformers.AWSMachineClasses(),
nodeSharedInformers.Machines(),
nodeSharedInformers.MachineSets(),
nodeSharedInformers.MachineDeployments(),
recorder,
)
if err != nil {
Expand All @@ -210,7 +210,7 @@ func StartControllers(s *options.NCMServer,
go nodeController.Run(int(s.ConcurrentNodeSyncs), stop)

} else {
return fmt.Errorf("unable to start instance controller: API GroupVersion %q is not available; found %#v", nodeGVR, availableResources)
return fmt.Errorf("unable to start machine controller: API GroupVersion %q is not available; found %#v", nodeGVR, availableResources)
}

select {}
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
## Usage

* [Setting up your usage environment](usage/prerequisite.md)
* [Creating/Deleting instances (VM)](usage/instance.md)
* [Maintaining instance replicas using instances-sets](usage/instance_set.md)
* [Updating instances using instances-deployments](usage/instance_deployment.md)
* [Creating/Deleting machines (VM)](usage/machine.md)
* [Maintaining machine replicas using machines-sets](usage/machine_set.md)
* [Updating machines using machines-deployments](usage/machine_deployment.md)

## Deployment

Expand Down
20 changes: 10 additions & 10 deletions docs/design/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ It's designed to run in the master plane of a Kubernetes cluster. It follows the
## Objects of Node Controller Manager

Node Controller Manager makes use of 4 CRD objects and 1 Kubernetes secret object to manage machines. They are as follows,
1. Instance-class: A template that contains cloud provider specific details used to create instances.
1. Instance: Node Controller Manager's object that actually represents a VM.
1. Instance-set: A group of instances managed by the Node Controller Manager.
1. Instance-deploy: A group of instance-sets managed by the Node Controller Manager to allow updating instances.
1. Secret: A kubernetes secret that stores cloudconfig (initialization scripts used to create VMs) and cloud specific credentials
1. Machine-class: Represents a template that contains cloud provider specific details used to create machines.
1. Machine: Represents an VM object that is backed by the cloud provider.
1. Machine-set: Represents a group of machines managed by the Node Controller Manager.
1. Machine-deployment: Represents a group of machine-sets managed by the Node Controller Manager to allow updating machines.
1. Secret: Represents a kubernetes secret that stores cloudconfig (initialization scripts used to create VMs) and cloud specific credentials

## Components of Node Controller Manager

Node Controller Manager is made up of 3 sub-controllers as of now. They are -
1. Instance Controller: Used to create/update/delete instances. It is the only controller which actually talks to the cloud providers.
1. Instance Set Controller: Used to manage instance-sets. This controller makes sure that desired number of instances are always up and running healthy.
1. Instance Deployment Controller: Used to update instances from one version to another by manipulating the instance-set objects.
1. Machine Controller: Used to create/update/delete machines. It is the only controller which actually talks to the cloud providers.
1. Machine Set Controller: Used to manage machine-sets. This controller makes sure that desired number of machines are always up and running healthy.
1. Machine Deployment Controller: Used to update machines from one version to another by manipulating the machine-set objects.

All these controllers work in an co-operative manner. They form a parent-child relationship with Instance Deployment Controller being the grandparent, Instance Set Controller being the parent, and Instance Controller being the child.
All these controllers work in an co-operative manner. They form a parent-child relationship with Machine Deployment Controller being the grandparent, Machine Set Controller being the parent, and Machine Controller being the child.

## Future Plans
The following is a short list of future plans,
1. **Integrate the cluster-autoscaler** to act upon instance-deployment objects, used to manage the required number of instances based on the load of the cluster.
1. **Integrate the cluster-autoscaler** to act upon machine-deployment objects, used to manage the required number of machines based on the load of the cluster.
2. **Support other cloud providers** like Azure, GCP, OpenStack to name a few.
3. Integrate a garbage collector to terminate any orphan VMs.
4. Build a comprehensive testing framework.
Expand Down
107 changes: 0 additions & 107 deletions docs/usage/instance_set.md

This file was deleted.

Loading

0 comments on commit eb4d4e5

Please sign in to comment.