Skip to content

Commit

Permalink
Change vm-resource CRD kind and add short names
Browse files Browse the repository at this point in the history
Signed-off-by: Lukianov Artyom <[email protected]>
  • Loading branch information
Lukianov Artyom committed Sep 19, 2017
1 parent 2626738 commit 6b1b6ef
Show file tree
Hide file tree
Showing 73 changed files with 376 additions and 387 deletions.
2 changes: 1 addition & 1 deletion cluster/vm-atomic.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
metadata:
name: atomic-ephemeral
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
2 changes: 1 addition & 1 deletion cluster/vm-ephemeral.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
metadata:
name: testvm-ephemeral
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
2 changes: 1 addition & 1 deletion cluster/vm-iscsi-auth.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
metadata:
name: testvm
spec:
Expand Down
2 changes: 1 addition & 1 deletion cluster/vm-nocloud.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
metadata:
name: testvm-nocloud
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
2 changes: 1 addition & 1 deletion cluster/vm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "testvm"
},
"apiVersion": "kubevirt.io/v1alpha1",
"kind": "VM",
"kind": "VirtualMachine",
"spec": {
"domain": {
"devices": {
Expand Down
2 changes: 1 addition & 1 deletion cluster/vm.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
metadata:
name: testvm
spec:
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry-disk-v1alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cat << END > vm.yaml
metadata:
name: testvm-ephemeral
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
4 changes: 2 additions & 2 deletions cmd/virt-api/virt-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ func newVirtAPIApp(host *string, port *int, swaggerUI *string) *virtAPIApp {

func (app *virtAPIApp) Run() {
ctx := context.Background()
vmGVR := schema.GroupVersionResource{Group: v1.GroupVersion.Group, Version: v1.GroupVersion.Version, Resource: "vms"}
vmGVR := schema.GroupVersionResource{Group: v1.GroupVersion.Group, Version: v1.GroupVersion.Version, Resource: "virtualmachines"}
migrationGVR := schema.GroupVersionResource{Group: v1.GroupVersion.Group, Version: v1.GroupVersion.Version, Resource: "migrations"}

ws, err := rest.GroupVersionProxyBase(ctx, v1.GroupVersion)
if err != nil {
log.Fatal(err)
}

ws, err = rest.GenericResourceProxy(ws, ctx, vmGVR, &v1.VM{}, v1.VMGroupVersionKind.Kind, &v1.VMList{})
ws, err = rest.GenericResourceProxy(ws, ctx, vmGVR, &v1.VirtualMachine{}, v1.VirtualMachineGroupVersionKind.Kind, &v1.VirtualMachineList{})
if err != nil {
log.Fatal(err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/virt-handler/virt-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (app *virtHandlerApp) Run() {
configDiskClient := configdisk.NewConfigDiskClient(virtCli)

// Wire VM controller
vmListWatcher := kubecli.NewListWatchFromClient(virtCli.RestClient(), "vms", k8sv1.NamespaceAll, fields.Everything(), l)
vmListWatcher := kubecli.NewListWatchFromClient(virtCli.RestClient(), "virtualmachines", k8sv1.NamespaceAll, fields.Everything(), l)
vmStore, vmQueue, vmController := virthandler.NewVMController(vmListWatcher, domainManager, recorder, *virtCli.RestClient(), virtCli, app.HostOverride, configDiskClient)

// Wire Domain controller
Expand Down Expand Up @@ -173,8 +173,8 @@ func (app *virtHandlerApp) Run() {
console := rest.NewConsoleResource(domainConn)
migrationHostInfo := rest.NewMigrationHostInfo(isolation.NewSocketBasedIsolationDetector(app.SocketDir))
ws := new(restful.WebService)
ws.Route(ws.GET("/api/v1/namespaces/{namespace}/vms/{name}/console").To(console.Console))
ws.Route(ws.GET("/api/v1/namespaces/{namespace}/vms/{name}/migrationHostInfo").To(migrationHostInfo.MigrationHostInfo))
ws.Route(ws.GET("/api/v1/namespaces/{namespace}/virtualmachines/{name}/console").To(console.Console))
ws.Route(ws.GET("/api/v1/namespaces/{namespace}/virtualmachines/{name}/migrationHostInfo").To(migrationHostInfo.MigrationHostInfo))
restful.DefaultContainer.Add(ws)
server := &http.Server{Addr: app.Service.Address(), Handler: restful.DefaultContainer}
server.ListenAndServe()
Expand Down
4 changes: 2 additions & 2 deletions docs/cloud-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Example
metadata:
name: testvm-nocloud
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down Expand Up @@ -95,7 +95,7 @@ Then reference the secret in the userDataSecretRef field.
metadata:
name: testvm-nocloud
apiVersion: kubevirt.io/v1alpha1
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
50 changes: 25 additions & 25 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ choreography, where all components act by themselves to realize the state
provided by the `VM` objects.

```
Client K8s API VM TPR Virt Controller VM Handler
-------------- ----------- ------- ---------------- ----------
listen <----------- WATCH /vms
listen <---------------------------- WATCH /vms
| |
POST /vms ---> validate | |
create ---> VM ---> observe -------> observe
| | v v
validate <--------- POST /pods defineVM
create | | |
| | | |
schedPod ---------> observe |
| | v |
validate <--------- PUT /vms |
update ---> VM --------------------> observe
| | | launchVM
| | | |
: : : :
| | | |
DELETE /vms -> validate | | |
delete ----> * --------------------> observe
| | shutdownVM
| | |
: : :
Client K8s API VM TPR Virt Controller VM Handler
-------------------------- ----------- ------- ----------------------- ----------
listen <----------- WATCH /virtualmachines
listen <----------------------------------- WATCH /virtualmachines
| |
POST /virtualmachines ---> validate | |
create ---> VM ---> observe --------------> observe
| | v v
validate <--------- POST /pods defineVM
create | | |
| | | |
schedPod ---------> observe |
| | v |
validate <--------- PUT /virtualmachines |
update ---> VM ---------------------------> observe
| | | launchVM
| | | |
: : : :
| | | |
DELETE /virtualmachines -> validate | | |
delete ----> * ---------------------------> observe
| | shutdownVM
| | |
: : :
```

**Disclaimer:** The diagram above is not completely accurate, because
Expand Down
2 changes: 1 addition & 1 deletion docs/container-register-disks.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ anywhere in the cluster referencing the same image.

Example:
```
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
2 changes: 1 addition & 1 deletion docs/direct-pv-disks.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ release: "stable"
this is used by the VM in the following way:
```yaml
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ $ ./cluster/kubectl.sh get vms -o json
"items": [
{
"apiVersion": "kubevirt.io/v1alpha1",
"kind": "VM",
"kind": "VirtualMachine",
"metadata": {
"creationTimestamp": "2016-12-09T17:54:52Z",
"labels": {
Expand All @@ -249,7 +249,7 @@ $ ./cluster/kubectl.sh get vms -o json
"name": "testvm",
"namespace": "default",
"resourceVersion": "102534",
"selfLink": "/apis/kubevirt.io/v1alpha1/namespaces/default/vms/testvm",
"selfLink": "/apis/kubevirt.io/v1alpha1/namespaces/default/virtualmachines/testvm",
"uid": "7e89280a-be62-11e6-a69f-525400efd09f"
},
"spec": {
Expand Down Expand Up @@ -281,7 +281,7 @@ cluster/kubectl.sh spice testvm --details
To directly query the config, do
```bash
curl 192.168.200.2:8184/apis/kubevirt.io/v1alpha1/namespaces/default/vms/testvm/spice -H"Accept:text/plain"
curl 192.168.200.2:8184/apis/kubevirt.io/v1alpha1/namespaces/default/virtualmachines/testvm/spice -H"Accept:text/plain"
```
### Accessing the Domain via the SPICE primary resource
Expand Down
2 changes: 1 addition & 1 deletion docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Below is an example of a VM definition. A user can post this definition to the
cluster and expect the KubeVirt runtime to fulfill creating a VM matching the
posted definition.
```
kind: VM
kind: VirtualMachine
metadata:
name: testvm
spec:
Expand Down
2 changes: 1 addition & 1 deletion docs/iscsi-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ END
2. create a vm that references the **name** given to the k8s secret in the iscsi usage field
```
cat << END > my-vm.yaml
kind: VM
kind: VirtualMachine
metadata:
name: testvm
namespace: default
Expand Down
2 changes: 1 addition & 1 deletion docs/libvirt-pod-networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ All other fields, concerning the properties of the interface, can be used as
usual.

```yaml
kind: VM
kind: VirtualMachine
spec:
domain:
devices:
Expand Down
Loading

0 comments on commit 6b1b6ef

Please sign in to comment.