VMware vSphere Integrated Containers provider (#206)

* 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
This commit is contained in:
Loc Nguyen
2018-06-04 15:41:32 -07:00
committed by Ria Bhatia
parent 98a111e8b7
commit 513cebe7b7
6296 changed files with 1123685 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
# Copyright 2017 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
# docker build --no-cache -t jakedsouza/group-1-19-docker-verify-volume-files:1.0 -f Dockerfile.1-19-Docker-Verify-Volume-Files .
# docker push jakedsouza/group-1-19-docker-verify-volume-files:1.0
FROM alpine:latest
RUN mkdir -p /etc/example/thisshouldexist
RUN echo "TestFile" >> /etc/example/testfile.txt
VOLUME ["/etc/example"]

View File

@@ -0,0 +1,4 @@
FROM busybox:latest
RUN addgroup newuser && adduser -H -S newuser -G newuser
USER newuser
CMD id

View File

@@ -0,0 +1,3 @@
FROM busybox:latest
USER 2000
CMD id

View File

@@ -0,0 +1,3 @@
from busybox:latest
user 2000:2000
cmd id

View File

@@ -0,0 +1,3 @@
simple:
image: busybox:latest
command: ls

View File

@@ -0,0 +1,4 @@
simple:
image: busybox:latest
container_name: my-web-container
command: ls

View File

@@ -0,0 +1,4 @@
FROM busybox:latest
LABEL com.docker.compose.test_image=true
VOLUME /data
CMD top

View File

@@ -0,0 +1,11 @@
version: '2'
services:
web:
image: busybox
depends_on:
- db
- redis
redis:
image: redis
db:
image: postgres

View File

@@ -0,0 +1,4 @@
web:
image: busybox
command: /bin/true
env_file: ./test.env

View File

@@ -0,0 +1 @@
FOO=1

View File

@@ -0,0 +1,7 @@
service:
image: busybox:latest
command: top
environment:
foo: bar
hello: world

View File

@@ -0,0 +1,12 @@
foo:
image: busybox
bar:
image: busybox
web:
extends:
file: circle-2.yml
service: other
baz:
image: busybox
quux:
image: busybox

View File

@@ -0,0 +1,12 @@
foo:
image: busybox
bar:
image: busybox
other:
extends:
file: circle-1.yml
service: web
baz:
image: busybox
quux:
image: busybox

View File

@@ -0,0 +1,13 @@
web:
extends:
file: common.yml
service: web
environment:
- FOO=2
- BAZ=3
labels: ['label=one']
ulimits:
nproc: 65535
memlock:
soft: 1024
hard: 2048

View File

@@ -0,0 +1,7 @@
web:
image: busybox
command: /bin/true
net: host
environment:
- FOO=1
- BAR=1

View File

@@ -0,0 +1,17 @@
myweb:
extends:
file: common.yml
service: web
command: top
links:
- "mydb:db"
environment:
# leave FOO alone
# override BAR
BAR: "2"
# add BAZ
BAZ: "2"
net: bridge
mydb:
image: busybox
command: top

View File

@@ -0,0 +1,9 @@
version: '2.1'
services:
demo:
image: foobar:latest
healthcheck:
test: ["CMD", "/health.sh"]
interval: 10s
timeout: 5s
retries: 36

View File

@@ -0,0 +1,6 @@
version: '2.1'
services:
demo:
extends:
file: healthcheck-1.yml
service: demo

View File

@@ -0,0 +1,11 @@
mydb:
build: '.'
myweb:
build: '.'
extends:
service: web
command: top
web:
build: '.'
links:
- "mydb:db"

View File

@@ -0,0 +1,12 @@
version: "2"
services:
myweb:
build: '.'
extends:
service: web
command: top
web:
build: '.'
network_mode: "service:net"
net:
build: '.'

View File

@@ -0,0 +1,8 @@
myweb:
build: '.'
extends:
service: web
command: top
web:
build: '.'
net: "container:db"

View File

@@ -0,0 +1,9 @@
myweb:
build: '.'
extends:
service: web
command: top
web:
build: '.'
volumes_from:
- "db"

View File

@@ -0,0 +1,6 @@
webintermediate:
extends:
file: common.yml
service: web
environment:
- "FOO=2"

View File

@@ -0,0 +1,6 @@
myweb:
extends:
file: nested-intermediate.yml
service: webintermediate
environment:
- "BAR=2"

View File

@@ -0,0 +1,9 @@
myweb:
extends:
service: web
environment:
- "BAR=1"
web:
image: busybox
environment:
- "BAZ=3"

View File

@@ -0,0 +1,6 @@
dnebase:
build: nonexistent.path
command: /bin/true
environment:
- FOO=1
- BAR=1

View File

@@ -0,0 +1,8 @@
dnechild:
extends:
file: nonexistent-path-base.yml
service: dnebase
image: busybox
command: /bin/true
environment:
- BAR=2

View File

@@ -0,0 +1,4 @@
web:
image: busybox
extends:
service: foo

View File

@@ -0,0 +1,4 @@
myweb:
extends:
file: valid-composite-extends.yml
service: web

View File

@@ -0,0 +1,5 @@
myweb:
build: '.'
extends:
file: 'valid-composite-extends.yml'
service: web

View File

@@ -0,0 +1,17 @@
myweb:
extends:
file: specify-file-as-self.yml
service: web
environment:
- "BAR=1"
web:
extends:
file: specify-file-as-self.yml
service: otherweb
image: busybox
environment:
- "BAZ=3"
otherweb:
image: busybox
environment:
- "YEP=1"

View File

@@ -0,0 +1,6 @@
myweb:
build: '.'
extends:
file: valid-common.yml
service: common-config
command: top

View File

@@ -0,0 +1,3 @@
common-config:
environment:
- FOO=1

View File

@@ -0,0 +1,2 @@
web:
command: top

View File

@@ -0,0 +1,3 @@
web:
build: '.'
hostname: "host-${HOSTNAME_VALUE}"

View File

@@ -0,0 +1,5 @@
myweb:
extends:
service: web
file: valid-interpolation-2.yml
command: top

View File

@@ -0,0 +1,15 @@
base:
image: busybox
environment:
- "BAR=1"
verbose:
extends:
service: base
environment:
- "FOO=1"
shorthand:
extends: base
environment:
- "FOO=2"

View File

@@ -0,0 +1,6 @@
version: '2'
services:
myservice:
image: redis
group_add:
- mail

View File

@@ -0,0 +1,8 @@
simple:
image: busybox:latest
labels:
com.example.department: "Finance"
command: top
another:
image: busybox:latest
command: ls

View File

@@ -0,0 +1,11 @@
db:
image: busybox:latest
command: top
web:
image: busybox:latest
command: top
links:
- db:db
console:
image: busybox:latest
command: top

View File

@@ -0,0 +1,8 @@
version: "2"
networks:
default:
driver: bridge
services:
web:
image: busybox
command: top

View File

@@ -0,0 +1,13 @@
version: "2"
services:
simple:
image: busybox:latest
command: top
another:
image: busybox:latest
command: top
networks:
default:
driver: bridge
driver_opts:
"com.docker.network.bridge.enable_icc": "false"

View File

@@ -0,0 +1,21 @@
version: "2"
services:
web:
image: busybox
command: top
networks: ["front"]
app:
image: busybox
command: top
networks: ["front", "back"]
links:
- "db:database"
db:
image: busybox
command: top
networks: ["back"]
networks:
front: {}
back: {}

View File

@@ -0,0 +1,12 @@
version: "2"
services:
simple:
image: busybox:latest
command: top
another:
image: busybox:latest
command: top
networks:
default:
external:
name: composetest_external_network

View File

@@ -0,0 +1,16 @@
version: "2"
services:
web:
image: busybox
command: top
networks:
- networks_foo
- bar
networks:
networks_foo:
external: true
bar:
external:
name: networks_bar

View File

@@ -0,0 +1,10 @@
version: "2"
services:
web:
image: busybox
command: top
networks: ["foo"]
networks:
bar: {}

View File

@@ -0,0 +1,16 @@
version: "2"
services:
web:
image: busybox
command: top
networks:
front:
aliases:
- forward_facing
- ahead
back:
networks:
front: {}
back: {}

View File

@@ -0,0 +1,13 @@
version: "2"
services:
web:
image: busybox
command: top
networks:
- internal
networks:
internal:
driver: bridge
internal: True

View File

@@ -0,0 +1,13 @@
version: "2.1"
services:
web:
image: busybox
command: top
networks:
- network_with_label
networks:
network_with_label:
labels:
- "label_key=label_val"

View File

@@ -0,0 +1,31 @@
version: "2"
services:
my_container:
image: busybox
command: top
bridge:
image: busybox
command: top
network_mode: bridge
service:
image: busybox
command: top
network_mode: "service:bridge"
container:
image: busybox
command: top
network_mode: "container:my_container"
host:
image: busybox
command: top
network_mode: host
none:
image: busybox
command: top
network_mode: none

View File

@@ -0,0 +1,19 @@
version: '2.1'
services:
app:
image: busybox
command: /bin/top
networks:
app_net:
ipv4_address: 172.20.238.10
networks:
app_net:
driver: bridge
enable_ipv6: true
ipam:
driver: default
config:
- subnet: 172.20.238.0/24
gateway: 172.20.238.1

View File

@@ -0,0 +1,8 @@
simple:
image: busybox:latest
command: top
ports:
- '3000'
- '49152:3001'
- '49153-49154:3002-3003'

View File

@@ -0,0 +1,15 @@
version: '3.2'
services:
simple:
image: busybox:latest
command: top
ports:
- target: 3000
- target: 3001
published: 49152
- target: 3002
published: 49153
protocol: tcp
- target: 3003
published: 49154
protocol: udp

View File

@@ -0,0 +1,10 @@
simple:
image: busybox:latest
command:
- sh
- '-c'
- |
trap 'exit 0' SIGINT
trap 'exit 1' SIGTERM
while true; do :; done
stop_signal: SIGINT

View File

@@ -0,0 +1,2 @@
version: '2.1'
services: {}

View File

@@ -0,0 +1,16 @@
version: "2.1"
services:
web:
image: busybox
command: top
volumes:
- foo:/var/lib/
- bar:/etc/
volumes:
foo:
external: true
bar:
external:
name: some_bar

View File

@@ -0,0 +1,13 @@
version: "2.1"
services:
web:
image: busybox
command: top
volumes:
- volume_with_label:/data
volumes:
volume_with_label:
labels:
- "label_key=label_val"