* Add Virtual Kubelet provider for VIC Initial virtual kubelet provider for VMware VIC. This provider currently handles creating and starting of a pod VM via the VIC portlayer and persona server. Image store handling via the VIC persona server. This provider currently requires the feature/wolfpack branch of VIC. * Added pod stop and delete. Also added node capacity. Added the ability to stop and delete pod VMs via VIC. Also retrieve node capacity information from the VCH. * Cleanup and readme file Some file clean up and added a Readme.md markdown file for the VIC provider. * Cleaned up errors, added function comments, moved operation code 1. Cleaned up error handling. Set standard for creating errors. 2. Added method prototype comments for all interface functions. 3. Moved PodCreator, PodStarter, PodStopper, and PodDeleter to a new folder. * Add mocking code and unit tests for podcache, podcreator, and podstarter Used the unit test framework used in VIC to handle assertions in the provider's unit test. Mocking code generated using OSS project mockery, which is compatible with the testify assertion framework. * Vendored packages for the VIC provider Requires feature/wolfpack branch of VIC and a few specific commit sha of projects used within VIC. * Implementation of POD Stopper and Deleter unit tests (#4) * Updated files for initial PR
4.1 KiB
This is the design document for implementing “docker rename” on vSphere Integrated Containers Engine (VIC Engine).
Design
The problem:
Rename involves the containerVM’s display name and the name of the datastore folder (and the files in the folder) of the containerVM on the vsphere UI, the container cache of the VIC Engine and the container network configuration (e.g., network alias). Currently both the containerVM's display name and the folder name are created during VM creation using containerName-containerID, which is done for matching the container information obtained from docker ps to the VM displayed on the vSphere UI. Renaming the VM display name on the UI can be achieved by using govc, which however does not update the datastore folder name. In this case, the vi admin would observe inconsistent VM display name and datastore folder name, and it becomes difficult the admin to reference the datastore folder based on the new VM display name.
Solution:
-
We use
containerName-containerShortIDto assemble the VM display name. We do not use containerName-containerID in order to avoid the scenario wherein the containerName gets truncated to satisfy the maximum length of a VM display name in vSphere. In addition, we use thecontainerIDto set the name of the datastore folder, thus there is no need to worry about the VM display name and datastore folder name being inconsistent. -
VM configuration during creation:
- vSAN: Since vSAN requires the VM display name to be the same as the datastore folder name during VM creation, we set both the VM display name and the datastore folder name to
containerName-containerShortIDduring VM creation. - Non-vSAN: We set the VM display name to
containerName-containerShortIDand set the datastore folder name tocontaineriD. - VM guestinfo: We replace
guestinfo.vice./common/namewithcommon/namein theExtraConfigof a containerVM and set the scope ofcommon/nametohidden. Then whendocker renameis called after the VM is created, we can update thecommon/namewith the new name. By doing this, we can persist the new name for a running containerVM.
- vSAN: Since vSAN requires the VM display name to be the same as the datastore folder name during VM creation, we set both the VM display name and the datastore folder name to
-
Docker support for rename: When a customer calls
docker rename, we update the VM display name to the new name in both the docker persona and the portlayer.-
Network:
- Network alias should be updated.
- If
--linkis used when creating the container, HostConfig of relevant containers should be automatically updated based on the backend data. /etc/hosts: it will not have the containerName, sinceguestinfo.vice/common/namedoes not exist.
-
Storage: Nothing needs to be updated if we set the datastore folder name to containerID.
-
Backward compatibility for containers created by a VCH of an older version that does not support
docker rename: During VCH upgrade, if an existing containerVM hasguestinfo.vice./common/nameinstead ofcommon/name, a data migration plugin will addcommon/nameto theExtraConfigof this containerVM and update the value accordingly, so that the docker operations that are supported by the old VCH still work. However, since we won't be able to update the binaries of the existing containerVMs, we disabledocker renameon these containerVMs.
-
Testing and Acceptance Criteria
Robot scripts will be written to test the following:
- VM configuration:
- After a containerVM is created, use govc to check the display name (containerName-containerShortID) and datastore folder name (containerID if on a non-vSAN setup).
- Docker support for rename:
- The basic functionality of
docker rename - Check validity of network alias and HostConfig
docker-compose upwhen there are existing containers for the same service but the configuration or image has been changeddocker-compose up –force-recreatewhen there are existing containers for the same service even if the configuration or image has not been changed
- Backward compatibility
- Add a test case in the upgrade test. Create a container using a VCH that does not support
docker rename. After upgrading the VCH, the basic docker operations that are supported by the old VCH should work.