Skip to content

Commit 81bda03

Browse files
committed
Doc updates and install usability improvements
This makes some documentation updates to the top level README.md along with slightly expanded usage instructions and minor changes to the install script - mostly to correctly handle multiple networks and partial handling for DPGs.
1 parent 60854f7 commit 81bda03

File tree

3 files changed

+105
-28
lines changed

3 files changed

+105
-28
lines changed

README.md

+24-10
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,29 @@
33

44
# vSphere Integrated Containers
55

6-
VIC is a container runtime for vSphere, allowing developers familiar with Docker to develop in containers and deploy them alongside traditional VM-based workloads on vSphere clusters, and allowing for these workloads to be managed through the vSphere UI in a way familiar to existing vSphere admins.
6+
vSphere Integrated Containers (VIC) is a container runtime for vSphere, allowing developers familiar with Docker to develop in containers and deploy them alongside traditional VM-based workloads on vSphere clusters, and allowing for these workloads to be managed through the vSphere UI in a way familiar to existing vSphere admins.
77

88
See [VIC Containers Architecture](arch.md) for a high level overview.
99

10+
## Project Status
11+
12+
VIC can currently pull images, create and start containers in a very limited fashion - most significantly you cannot attach to a container to see its output or interact with it. Interaction is only via the network - containers will be exposed directly on the VCH external network rather than via port forwarding.
13+
14+
We are working hard to add functionality while building out our [foundation](arch.md#port-layer-abstractions) so continue to watch the repo for new features. Initial focus is on the production end of the CI pipeline, building backwards towards developer laptop scenarios.
15+
16+
This extremely limited set of current capabilities may come as a surprise to people who are familiar with [Project Bonneville](http://blogs.vmware.com/cloudnative/introducing-project-bonneville/) that was [reasonably fully featured](https://www.youtube.com/watch?v=XkFQw8ueT1w) when demonstrated at VMworld in 2015.
17+
Project Bonneville was research aimed at determining best approaches to enabling container workflows in a vSphere environment and therefore enabled a broad set of features, but not in a manner that made it a viable product for large scale consumption. Building on top of research code is a great shortcut for fast time-to-market, but does not provide a good foundation for an enterprise quality product. vSphere Integrated Containers is a full re-architecture and re-write, building off the knowledge gained during Project Bonneville while keeping almost zero code.
18+
19+
20+
## Installing
21+
22+
Once built, the result can be installed with the following command. This is just an example - see the install help output for all options, and a slightly more indepth example [here](usage.md):
23+
```
24+
install.sh -g -t '<user>:<password>@<target-host>' -i <datastore-name> <vch-name>
25+
```
26+
27+
Starting a container currently requires the container metadata be specified on the command line (environment, working directory, and absolute path to the command) as the image metadata parsing is still in progress (#195, #411). Container output is found in a log file on the datastore ([datastore]/containerid/containerid.log).
28+
1029
## Contributing
1130

1231
See [CONTRIBUTING](CONTRIBUTING.md) for details on submitting changes and the contribution workflow.
@@ -31,16 +50,10 @@ make all
3150
```
3251

3352
There are three primary components generated by a full build, found in `$BIN` (the ./bin directory by default). The make targets used are the following:
34-
1. install.sh - make install
35-
2. appliance.iso - make appliance
36-
3. bootstrap.iso - make bootstrap
37-
38-
## Installing
53+
1. install.sh - `make install`
54+
2. appliance.iso - `make appliance`
55+
3. bootstrap.iso - `make bootstrap`
3956

40-
Once built, the result can be installed with the following command. This is just an example - see the install help output for all options:
41-
```
42-
install.sh -t 'user:password@my-esx-fqdn' -g target-cert-name -i datastore1 -p /ha-datacenter/host/my-esx-fqdn vch-name
43-
```
4457

4558
## Building binaries for development
4659

@@ -68,6 +81,7 @@ $ make gvt vendor
6881

6982
This will install the [gvt](https://github.com/FiloSottile/gvt) utility and retrieve the build dependencies via `gvt restore`
7083

84+
7185
## Building the ISOs
7286

7387
The component binaries above are packaged into ISO files, appliance.iso and bootstrap.iso, that are used by the installer. The generation of the ISOs is split into the following targets:

install/install.sh

+27-18
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ datastore=${GOVC_DATASTORE}
4343
externalNet="VM Network"
4444
managementNet="VM Network"
4545
clientNet="VM Network"
46+
compute="/ha-datacenter/host/*"
4647

4748
applianceIso="${DIR}/appliance.iso"
4849
bootstrapIso="${DIR}/bootstrap.iso"
4950

5051

51-
while getopts "fvt:g:p:i:d:e:m:b:a:c:x:y:" flag
52+
while getopts "fvt:gp:i:d:e:m:b:a:c:x:y:" flag
5253
do
5354
case $flag in
5455
v)
@@ -66,9 +67,9 @@ do
6667
# Required. Compute resource path
6768
# This should fully specify the path to the compute resource, e.g.
6869
# /ha-datacenter/host/myCluster/Resources/myRP
70+
# /ha-datacenter/host/myCluster/host-fqdn
6971
compute=${OPTARG}
70-
# primarily internal convenience for constructing other paths
71-
datacenter=$(echo $compute | cut -d '/' -f 2)
72+
export GOVC_HOST=${OPTARG}
7273
;;
7374

7475
d)
@@ -80,11 +81,16 @@ do
8081
# Required. Image datastore path - sets cdatastore too for default
8182
idatastore=${OPTARG}
8283
cdatastore=${OPTARG}
84+
export GOVC_DATASTORE=${idatastore}
8385
;;
8486

8587
e)
8688
# Optional. The external network (can see hub.docker.com)
8789
externalNet=${OPTARG}
90+
if [ "$clientNet" == "VM Network" ]; then
91+
echo "Setting client network to specified external network"
92+
clientNet=${externalNet}
93+
fi
8894
: ${GOVC_NETWORK:=$externalNet}
8995
;;
9096

@@ -116,16 +122,7 @@ do
116122
;;
117123

118124
g)
119-
# Optional. Generate the cert and key and store them in $OPTARG-{cert,key}.pem
120-
keyf="${OPTARG}-key.pem"
121-
certf="${OPTARG}-cert.pem"
122-
# generate
123-
echo "# Generating certificate/key pair - private key in ${keyf}"
124-
openssl req -batch -nodes -new -x509 -keyout "${keyf}" -out "${certf}" > /dev/null 2>&1
125-
126-
# load the bits
127-
key=$(cat "$keyf")
128-
certificate=$(cat "$certf")
125+
tlsGenerate="true"
129126
;;
130127

131128
x)
@@ -158,10 +155,26 @@ if [ -z "$1" -o -z "$GOVC_URL" -o -z "$vchName" -o -z "$compute" -o -z "$idatast
158155
usage
159156
fi
160157

158+
if [ -n "$tlsGenerate" ]; then
159+
# Optional. Generate the cert and key and store them in $OPTARG-{cert,key}.pem
160+
keyf="${vchName}-key.pem"
161+
certf="${vchName}-cert.pem"
162+
# generate
163+
echo "# Generating certificate/key pair - private key in ${keyf}"
164+
openssl req -batch -nodes -new -x509 -keyout "${keyf}" -out "${certf}" > /dev/null 2>&1
165+
166+
# load the bits
167+
key=$(cat "$keyf")
168+
certificate=$(cat "$certf")
169+
fi
170+
171+
# primarily internal convenience for constructing other paths
172+
datacenter=$(echo $compute | cut -d '/' -f 2)
161173

162174
# if not set explicitly, bridge network has vch name
163175
: ${bridgeNet:=$vchName}
164176

177+
165178
# for now it's all insecure
166179
export GOVC_INSECURE=true
167180
export GOVC_PERSIST_SESSION=true
@@ -225,10 +238,6 @@ for net in "${!networks[@]}"; do
225238
done
226239

227240

228-
# ensure we have defaults for datastore and compute if needed
229-
if [ -z "${datastore}" ]; then
230-
datastore=$(govc datastore.info | grep -e "^Name:" | awk '{print$2}')
231-
fi
232241
if [ -z "${compute}" ]; then
233242
compute=$(govc pool.info */Resources| grep -e "^\\s*Path:" | awk '{print$2}')
234243
fi
@@ -269,7 +278,7 @@ govc vm.power -on=true -vm.uuid="${uuid}" > ${powerstatus} 2>&1 || {
269278
echo "# Setting network identities"
270279
# Generate the network interface identiy map - MACs aren't generated until power on
271280
for net in "${!networks[@]}"; do
272-
mac=$(govc device.ls -vm.uuid $uuid | grep "${net}" | grep ethernet | awk '{print $1}' | xargs govc device.info -vm.uuid $uuid | grep MAC | awk '{print$3}')
281+
mac=$(govc device.info -vm.uuid $uuid -net "${net}" | grep MAC | awk '{print$3}')
273282
govc vm.change -e guestinfo.vch/networks/${networks[$net]}=$mac -vm.uuid="${uuid}"
274283
done
275284
# jump through some hoops to deal with quote behaviour for arrays

usage.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
## Installing Virtual Integrated Containers
2+
3+
The intent is that vSphere Integrated Containers (VIC) should not _require_ an installation step - deploying a [Virtual Container Host](doc/arch/vic-container-abstraction.md#virtual-container-host) (VHC) directly without any prior steps should always be possible. At the current time this is the only approach available.
4+
5+
Installation will be required for capabilities such as [self-provisioning](doc/design/validating-proxy.md) and management network isolation via [vmomi proxy](doc/design/vmomi-authenticating-agent.md).
6+
7+
## Deploying a Virtual Container Host
8+
9+
### Requirements
10+
11+
The first three requirements derive from a placeholder install script. These will be addressed in #121.
12+
13+
1. bash - deploying a Virtual Container Host is currently done with an install script written in `bash`
14+
2. govc - [These directions](https://github.com/vmware/govmomi/tree/master/govc#govc) instruct how to install `govc` - release 0.5.0
15+
3. ESX - while this can and will function against vCenter, the placeholder installation script doesn't handle distributed port groups at this time
16+
4. DHCP - the VCH currently requires there be DHCP on the external network (-e flag if not "VM Network")
17+
18+
19+
Replace the `<fields>` in the example with values specific to your environment - this will install to the top level resource pool of the host (specify -g to generate certificates and configure TLS). Add -f to remove an existing folder or VM with the same name:
20+
```
21+
bin/install.sh -g -t '<user>:<password>@<target-host>' -i <datastore-name> <vch-name>
22+
```
23+
This will, if successful, produce output similar to the following:
24+
```
25+
# Generating certificate/key pair - private key in vch-name-key.pem
26+
# Logging into the target
27+
# Uploading ISOs
28+
[02-04-16 23:16:55] Uploading... OK
29+
[02-04-16 23:16:58] Uploading... OK
30+
# Creating vSwitch
31+
# Creating Portgroup
32+
# Creating the Virtual Container Host appliance
33+
# Adding network interfaces
34+
# Setting component configuration
35+
# Configuring TLS server
36+
# Powering on the Virtual Container Host
37+
# Setting network identities
38+
# Waiting for IP information
39+
#
40+
# SSH to appliance (default=root:password)
41+
42+
#
43+
# Log server:
44+
# https://x.x.x.x:2378
45+
#
46+
# Connect to docker:
47+
# docker -H x.x.x.x:2376 --tls --tlscert='vch-name-cert.pem' --tlskey='vch-name-key.pem'
48+
DOCKER_OPTS="--tls --tlscert='vch-name-cert.pem' --tlskey='vch-name-key.pem'"
49+
DOCKER_HOST=x.x.x.x:2376
50+
```
51+
52+
53+
54+
[Issues relating to Virtual Container Host deployment](https://github.com/vmware/vic/labels/component%2Fvic-machine)

0 commit comments

Comments
 (0)