forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lukianov Artyom <[email protected]>
- Loading branch information
Lukianov Artyom
committed
Jan 24, 2018
1 parent
40df4e3
commit 9fffd8c
Showing
21 changed files
with
188 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
PROVIDER=${PROVIDER:-vagrant} | ||
PROVIDER=${PROVIDER:-vagrant-kubernetes} | ||
source cluster/$PROVIDER/provider.sh | ||
down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
PROVIDER=${PROVIDER:-vagrant} | ||
PROVIDER=${PROVIDER:-vagrant-kubernetes} | ||
source cluster/$PROVIDER/provider.sh | ||
up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
The purpose of this folder is to hold all relevant stuff to deploy | ||
KubeVirt on kubernetes cluster in a vagrant box. | ||
|
||
Thus this folder primarily contains | ||
- The deployment scripts for master and nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cluster/vagrant/README.md → cluster/vagrant-openshift/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
The purpose of this folder is to hold all relevant stuff to deploy | ||
KubeVirt in a vagrant box. | ||
KubeVirt on OpenShift cluster in a vagrant box. | ||
|
||
Thus this folder primarily contains | ||
- The deployment scripts for master and nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
function _main_ip() { | ||
echo 192.168.200.2 | ||
} | ||
|
||
function up() { | ||
export USING_KUBE_SCRIPTS=true | ||
# Make sure that the vagrant environment is up and running | ||
vagrant up --provider=libvirt | ||
# Synchronize kubectl config | ||
vagrant ssh-config master 2>&1 | grep "not yet ready for SSH" >/dev/null && | ||
{ | ||
echo "Master node is not up" | ||
exit 1 | ||
} | ||
|
||
OPTIONS=$(vagrant ssh-config master | grep -v '^Host ' | awk -v ORS=' ' 'NF{print "-o " $1 "=" $2}') | ||
|
||
scp $OPTIONS master:/bin/oc ${KUBEVIRT_PATH}cluster/vagrant-openshift/.oc | ||
chmod u+x cluster/vagrant-openshift/.oc | ||
|
||
vagrant ssh master -c "sudo cat /etc/origin/master/openshift-master.kubeconfig" >${KUBEVIRT_PATH}cluster/vagrant-openshift/.kubeconfig | ||
|
||
# Make sure that local config is correct | ||
prepare_config | ||
} | ||
|
||
function prepare_config() { | ||
BASE_PATH=${KUBEVIRT_PATH:-$PWD} | ||
cat >hack/config-provider-vagrant-openshift.sh <<EOF | ||
master_ip=$(_main_ip) | ||
docker_tag=devel | ||
kubeconfig=${BASE_PATH}/cluster/vagrant-openshift/.kubeconfig | ||
EOF | ||
} | ||
|
||
function build() { | ||
make build manifests | ||
for VM in $(vagrant status | grep -v "^The Libvirt domain is running." | grep running | cut -d " " -f1); do | ||
vagrant rsync $VM # if you do not use NFS | ||
vagrant ssh $VM -c "cd /vagrant && export DOCKER_TAG=${docker_tag} && sudo -E hack/build-docker.sh build && sudo -E hack/build-docker.sh build optional" | ||
done | ||
} | ||
|
||
function _kubectl() { | ||
export KUBECONFIG=${KUBEVIRT_PATH}cluster/vagrant-openshift/.kubeconfig | ||
${KUBEVIRT_PATH}cluster/vagrant-openshift/.oc "$@" | ||
} | ||
|
||
function down() { | ||
vagrant halt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#/bin/bash -xe | ||
# | ||
# This file is part of the KubeVirt project | ||
# | ||
# 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. | ||
# | ||
# Copyright 2017 Red Hat, Inc. | ||
# | ||
|
||
# Enter master and nodes to /etc/hosts | ||
sed -i "/$(hostname)/d" /etc/hosts | ||
grep 'master' /etc/hosts || echo "$1 master" >> /etc/hosts | ||
IFS=. read ip1 ip2 ip3 ip4 <<< "$1" | ||
for node in $(seq 0 $(($2 - 1))); do | ||
node_hostname="node$node" | ||
node_ip="$ip1.$ip2.$ip3.$(($ip4 + node + 1))" | ||
grep $node_hostname /etc/hosts || echo "$node_ip $node_hostname" >> /etc/hosts | ||
done | ||
|
||
# Install OpenShift packages | ||
yum install -y centos-release-openshift-origin | ||
yum install -y wget git net-tools bind-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct docker | ||
systemctl start docker | ||
systemctl enable docker | ||
yum -y update | ||
yum --enablerepo=centos-openshift-origin-testing install -y atomic-openshift-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#/bin/bash -xe | ||
# | ||
# This file is part of the KubeVirt project | ||
# | ||
# 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. | ||
# | ||
# Copyright 2017 Red Hat, Inc. | ||
# | ||
|
||
master_ip=$1 | ||
nodes=$2 | ||
|
||
bash /vagrant/cluster/vagrant-openshift/setup_common.sh $master_ip $nodes |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.