Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kubevirt/kubevirt into cdi-1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanzr committed Dec 20, 2018
2 parents ec7ec3a + b1884aa commit 37b8770
Show file tree
Hide file tree
Showing 92 changed files with 2,924 additions and 444 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ deploy:
on:
tags: false
all_branches: true
condition: $TRAVIS_BRANCH != revert-*
- provider: script
script: docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" && make publish DOCKER_TAG=$TRAVIS_TAG
skip_cleanup: true
Expand Down
71 changes: 45 additions & 26 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,6 @@
}
}
},
"/apis/kubevirt.io/v1alpha2/healthz": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Health endpoint",
"operationId": "checkHealth",
"responses": {
"200": {
"description": "OK"
},
"500": {
"description": "Unhealthy"
},
"default": {
"description": "OK"
}
}
}
},
"/apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancemigrations": {
"get": {
"produces": [
Expand Down Expand Up @@ -3687,6 +3664,29 @@
}
}
},
"/apis/subresources.kubevirt.io/v1alpha2/healthz": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Health endpoint",
"operationId": "checkHealth",
"responses": {
"200": {
"description": "OK"
},
"500": {
"description": "Unhealthy"
},
"default": {
"description": "OK"
}
}
}
},
"/apis/subresources.kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name}/console": {
"get": {
"summary": "Open a websocket connection to a serial console on the specified VirtualMachineInstance.",
Expand Down Expand Up @@ -3992,7 +3992,7 @@
"v1.CDRomTarget": {
"properties": {
"bus": {
"description": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi, ide.",
"description": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi.",
"type": "string"
},
"readonly": {
Expand Down Expand Up @@ -4263,7 +4263,7 @@
"v1.DiskTarget": {
"properties": {
"bus": {
"description": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi, ide.",
"description": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi.",
"type": "string"
},
"pciAddress": {
Expand Down Expand Up @@ -4556,6 +4556,10 @@
"description": "The path to HostDisk image located on the cluster",
"type": "string"
},
"shared": {
"description": "Shared indicate whether the path is shared between nodes",
"type": "boolean"
},
"type": {
"description": "Contains information if disk.img exists or should be created\nallowed options are 'Disk' and 'DiskOrCreate'",
"type": "string"
Expand Down Expand Up @@ -4752,7 +4756,7 @@
"v1.LunTarget": {
"properties": {
"bus": {
"description": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi, ide.",
"description": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi.",
"type": "string"
},
"readonly": {
Expand Down Expand Up @@ -5691,10 +5695,21 @@
},
"v1.VirtualMachineInstanceNetworkInterface": {
"properties": {
"interfaceName": {
"description": "The interface name inside the Virtual Machine",
"type": "string"
},
"ipAddress": {
"description": "IP address of a Virtual Machine interface",
"type": "string"
},
"ipAddresses": {
"description": "List of all IP addresses of a Virtual Machine interface",
"type": "array",
"items": {
"type": "string"
}
},
"mac": {
"description": "Hardware address of a Virtual Machine interface",
"type": "string"
Expand Down Expand Up @@ -5969,6 +5984,10 @@
"$ref": "#/definitions/v1.VirtualMachineInstanceNetworkInterface"
}
},
"migrationMethod": {
"description": "Represents the method using which the vmi can be migrated: live migration or block migration",
"type": "string"
},
"migrationState": {
"description": "Represents the status of a live migration",
"$ref": "#/definitions/v1.VirtualMachineInstanceMigrationState"
Expand Down
8 changes: 4 additions & 4 deletions automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ if [[ $TARGET =~ openshift-.* ]]; then
if [[ $TARGET =~ .*-crio-.* ]]; then
export KUBEVIRT_PROVIDER="os-3.11.0-crio"
elif [[ $TARGET =~ .*-multus-.* ]]; then
export KUBEVIRT_PROVIDER="os-3.10.0-multus"
export KUBEVIRT_PROVIDER="os-3.11.0-multus"
else
export KUBEVIRT_PROVIDER="os-3.11.0"
fi
elif [[ $TARGET =~ .*-1.10.4-.* ]]; then
export KUBEVIRT_PROVIDER="k8s-1.10.4"
elif [[ $TARGET =~ .*-multus-1.11.1-.* ]]; then
export KUBEVIRT_PROVIDER="k8s-multus-1.11.1"
elif [[ $TARGET =~ .*-multus-1.12.2-.* ]]; then
export KUBEVIRT_PROVIDER="k8s-multus-1.12.2"
elif [[ $TARGET =~ .*-genie-1.11.1-.* ]]; then
export KUBEVIRT_PROVIDER="k8s-genie-1.11.1"
else
Expand Down Expand Up @@ -154,7 +154,7 @@ trap '{ make cluster-down; }' EXIT SIGINT SIGTERM SIGSTOP

# Check if we are on a pull request in jenkins.
export KUBEVIRT_CACHE_FROM=${ghprbTargetBranch}
if [ -n ${KUBEVIRT_CACHE_FROM} ]; then
if [ -n "${KUBEVIRT_CACHE_FROM}" ]; then
make pull-cache
fi

Expand Down
92 changes: 51 additions & 41 deletions cluster/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,58 +26,68 @@ source hack/config.sh
echo "Cleaning up ..."

# Remove finalizers from all running vmis, to not block the cleanup
cluster/kubectl.sh get vmis --all-namespaces -o=custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace,FINALIZERS:.metadata.finalizers --no-headers | grep foregroundDeleteVirtualMachine | while read p; do
_kubectl get vmis --all-namespaces -o=custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace,FINALIZERS:.metadata.finalizers --no-headers | grep foregroundDeleteVirtualMachine | while read p; do
arr=($p)
name="${arr[0]}"
namespace="${arr[1]}"
_kubectl patch vmi $name -n $namespace --type=json -p '[{ "op": "remove", "path": "/metadata/finalizers" }]'
done

# Work around https://github.com/kubernetes/kubernetes/issues/33517
_kubectl delete ds -l "kubevirt.io" -n ${namespace} --cascade=false --grace-period 0 2>/dev/null || :
_kubectl delete pods -n ${namespace} -l="kubevirt.io=libvirt" --force --grace-period 0 2>/dev/null || :
_kubectl delete pods -n ${namespace} -l="kubevirt.io=virt-handler" --force --grace-period 0 2>/dev/null || :

# Delete all traces of kubevirt
namespaces=(default ${namespace})
for i in ${namespaces[@]}; do
_kubectl -n ${i} delete apiservices -l 'kubevirt.io'
_kubectl -n ${i} delete deployment -l 'kubevirt.io'
_kubectl -n ${i} delete rs -l 'kubevirt.io'
_kubectl -n ${i} delete services -l 'kubevirt.io'
_kubectl -n ${i} delete apiservices -l 'kubevirt.io'
_kubectl -n ${i} delete validatingwebhookconfiguration -l 'kubevirt.io'
_kubectl -n ${i} delete secrets -l 'kubevirt.io'
_kubectl -n ${i} delete pvc -l 'kubevirt.io'
_kubectl -n ${i} delete pv -l 'kubevirt.io'
_kubectl -n ${i} delete ds -l 'kubevirt.io'
_kubectl -n ${i} delete customresourcedefinitions -l 'kubevirt.io'
_kubectl -n ${i} delete pods -l 'kubevirt.io'
_kubectl -n ${i} delete clusterrolebinding -l 'kubevirt.io'
_kubectl -n ${i} delete rolebinding -l 'kubevirt.io'
_kubectl -n ${i} delete roles -l 'kubevirt.io'
_kubectl -n ${i} delete clusterroles -l 'kubevirt.io'
_kubectl -n ${i} delete serviceaccounts -l 'kubevirt.io'
_kubectl -n ${i} delete configmaps -l 'kubevirt.io'
done
namespaces=(default ${namespace} ${cdi_namespace})
labels=("kubevirt.io" "cdi.kubevirt.io")

# delete all traces of CDI
for i in ${namespaces[@]}; do
_kubectl -n ${i} delete deployment -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete services -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete apiservices -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete validatingwebhookconfiguration -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete secrets -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete pvc -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete customresourcedefinitions -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete pods -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete clusterrolebinding -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete rolebinding -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete roles -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete clusterroles -l 'cdi.kubevirt.io'
_kubectl -n ${i} delete serviceaccounts -l 'cdi.kubevirt.io'
for label in ${labels[@]}; do
_kubectl -n ${i} delete deployment -l ${label}
_kubectl -n ${i} delete ds -l ${label}
_kubectl -n ${i} delete rs -l ${label}
_kubectl -n ${i} delete pods -l ${label}
_kubectl -n ${i} delete validatingwebhookconfiguration -l ${label}
_kubectl -n ${i} delete services -l ${label}
_kubectl -n ${i} delete pvc -l ${label}
_kubectl -n ${i} delete pv -l ${label}
_kubectl -n ${i} delete clusterrolebinding -l ${label}
_kubectl -n ${i} delete rolebinding -l ${label}
_kubectl -n ${i} delete roles -l ${label}
_kubectl -n ${i} delete clusterroles -l ${label}
_kubectl -n ${i} delete serviceaccounts -l ${label}
_kubectl -n ${i} delete configmaps -l ${label}
_kubectl -n ${i} delete secrets -l ${label}
_kubectl -n ${i} delete customresourcedefinitions -l ${label}

# W/A for https://github.com/kubernetes/kubernetes/issues/65818
if [[ "$KUBEVIRT_PROVIDER" =~ .*.10..* ]]; then
# k8s version 1.10.* does not have --wait parameter
_kubectl -n ${i} delete apiservices -l ${label}
else
_kubectl -n ${i} delete apiservices -l ${label} --wait=false
fi
_kubectl -n ${i} get apiservices -l ${label} -o=custom-columns=NAME:.metadata.name,FINALIZERS:.metadata.finalizers --no-headers | grep foregroundDeletion | while read p; do
arr=($p)
name="${arr[0]}"
_kubectl -n ${i} patch apiservices $name --type=json -p '[{ "op": "remove", "path": "/metadata/finalizers" }]'
done
done
done

if [ "$(_kubectl get ns | grep ${namespace})" ]; then
echo "Clean ${namespace} namespace"
_kubectl delete ns ${namespace}

start_time=0
sample=10
timeout=120
echo "Waiting for ${namespace} namespace to dissappear ..."
while [ "$(_kubectl get ns | grep ${namespace})" ]; do
sleep $sample
start_time=$((current_time + sample))
if [ $current_time -gt $timeout ]; then
exit 1
fi
done
fi

sleep 2

echo "Done"
13 changes: 0 additions & 13 deletions cluster/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ source hack/config.sh

echo "Deploying ..."

# Create the installation namespace if it does not exist already
_kubectl apply -f - <<EOF
---
apiVersion: v1
kind: Namespace
metadata:
name: ${namespace}
EOF

# Deploy infra for testing first
_kubectl create -f ${MANIFESTS_OUT_DIR}/testing -R $i

# Deploy the right manifests for the right target
if [[ -z $TARGET ]] || [[ $TARGET =~ .*-dev ]]; then
_kubectl create -f ${MANIFESTS_OUT_DIR}/dev -R $i
Expand All @@ -51,7 +39,6 @@ fi

if [[ "$KUBEVIRT_PROVIDER" =~ os-* ]]; then
_kubectl adm policy add-scc-to-user privileged -z kubevirt-controller -n ${namespace}
_kubectl adm policy add-scc-to-user privileged -z kubevirt-testing -n ${namespace}
_kubectl adm policy add-scc-to-user privileged -z kubevirt-privileged -n ${namespace}
_kubectl adm policy add-scc-to-user privileged -z kubevirt-apiserver -n ${namespace}
# Helpful for development. Allows admin to access everything KubeVirt creates in the web console
Expand Down
3 changes: 0 additions & 3 deletions cluster/examples/vmi-sriov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ spec:
machine:
type: ""
resources:
limits:
intel.com/sriov: "1"
requests:
intel.com/sriov: "1"
memory: 1024M
networks:
- name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kubernetes 1.11.1 with multus network plugin in ephemeral containers
# Kubernetes 1.12.2 with multus network plugin in ephemeral containers

Provides a pre-deployed Kubernetes with version 1.11.1 purely in docker
Provides a pre-deployed Kubernetes with version 1.12.2 purely in docker
containers with qemu. The provided VMs are completely ephemeral and are
recreated on every cluster restart. The KubeVirt containers are built on the
local machine and are the pushed to a registry which is exposed at
Expand All @@ -9,7 +9,7 @@ local machine and are the pushed to a registry which is exposed at
## Bringing the cluster up

```bash
export KUBEVIRT_PROVIDER=k8s-multus-1.11.1
export KUBEVIRT_PROVIDER=k8s-multus-1.12.2
export KUBEVIRT_NUM_NODES=2 # master + one node
make cluster-up
```
Expand All @@ -19,14 +19,14 @@ The cluster can be accessed as usual:
```bash
$ cluster/kubectl.sh get nodes
NAME STATUS ROLES AGE VERSION
node01 NotReady master 31s v1.11.1
node02 NotReady <none> 5s v1.11.1
node01 NotReady master 31s v1.12.2
node02 NotReady <none> 5s v1.12.2
```

## Bringing the cluster down

```bash
export KUBEVIRT_PROVIDER=k8s-multus-1.11.1
export KUBEVIRT_PROVIDER=k8s-multus-1.12.2
make cluster-down
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

image="k8s-multus-1.11.1@sha256:b5f1fa6125f1ad0057284fac433b9f9f0abad3a27214784552d84b6265be20d1"
image="k8s-multus-1.12.2@sha256:4974496beb19a30156c125d7721912b54a705926dcbf66c41f570dca286996ba"

source cluster/ephemeral-provider-common.sh

Expand Down
7 changes: 0 additions & 7 deletions cluster/os-3.10.0-multus/provider.sh

This file was deleted.

2 changes: 1 addition & 1 deletion cluster/os-3.11.0-crio/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e

source cluster/os-3.11.0/provider.sh

image="os-3.11.0-crio@sha256:e2629b93e98a7f7a30a70acd9e478fa526977ee86a84d6a5514a33421e91863a"
image="os-3.11.0-crio@sha256:3f11a6f437fcdf2d70de4fcc31e0383656f994d0d05f9a83face114ea7254bc0"
Loading

0 comments on commit 37b8770

Please sign in to comment.