-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added allocations to dispatchers #288
Added allocations to dispatchers #288
Conversation
NicName string `json:"nic_name"` | ||
ClusterNames []string `json:"cluster_names"` | ||
ClusterNamespaces []string `json:"cluster_namespaces"` | ||
Image string `json:"image"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image, SecurityGroupId, NicName and ClusterInstances are not resource.
Resource is defined as cpu, memeory, storage, and eip. Other modules implemented by the definition. This definition change may affect other modules including scheduling framework and scheduler, etc..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In allocation spec, resources are defined as pod to create openstack vm. Therefore I add Image, security group id, nic name at the resource/pod level. Image is a kind of resource. Security Group, Nic Name are for clusters, also, ClusterInstances are for cluster as well. There are three level of allocation objects. Allocation, resource group, and resources. It looks like we can only put those attributes in resources which can map to clusters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally, allocation resource includes only "cpu, memeory, storage, and eip" which is defined site resource. If data structure is different, it will be better to use different name to avoid confusion. This new data structure breaks consistency. Image, security group id, nic name are site info instead of site resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be true for all the resources. However, the vm resource are for openstack clusters. Therefore, we need image, security group id, nic names, and instance information at resource level. I have created a VirtualMachine struct under resource level for openstack resources. Please let me know if you have any other concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
some minor comments
Added allocations to dispatchers
Run "hack/globalscheduler/globalscheduler-up.sh"
Run "cluster/kubectl.sh apply -f globalscheduler/test/yaml/sample_2_schedulers.yaml"
Run "cluster/kubectl.sh apply -f globalscheduler/test/yaml/sample_4_clusters.yaml"
Run "cluster/kubectl.sh apply -f globalscheduler/test/yaml/sample_2_distributors.yaml"
Run "cluster/kubectl.sh apply -f globalscheduler/test/yaml/sample_2_dispatchers.yaml"
Run "cluster/kubectl.sh apply -f globalscheduler/test/yaml/sample_2_allocations.yaml"
Run "cluster/kubectl.sh get allocations" and found the 2 allocations status phases have changed to "Scheduled"
Go to "http://18.236.217.191/dashboard/project/instances/" and found 5 instances have been created.
Run "cluster/kubectl.sh delete -f globalscheduler/test/yaml/sample_2_allocations.yaml"
Run "cluster/kubectl.sh get allocations" and found the 2 allocations have been deleted.
Go to "http://18.236.217.191/dashboard/project/instances/" and found 5 instances have been deleted.