mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Merge pull request #23121 from deromka/master
Automatic merge from submit-queue Added vsphere support for vagrant Since the native vsphere support (using govc library) requires admin permissions on ESX/vCenter, not everyone can have such permissions. So I'm adding a vsphere support using vagrant using vagrant-vsphere plugin
This commit is contained in:
@@ -51,8 +51,8 @@ CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.246.0.0/16}"
|
||||
SERVICE_CLUSTER_IP_RANGE=10.247.0.0/16 # formerly PORTAL_NET
|
||||
|
||||
# Since this isn't exposed on the network, default to a simple user/passwd
|
||||
MASTER_USER=vagrant
|
||||
MASTER_PASSWD=vagrant
|
||||
MASTER_USER="${MASTER_USER:-vagrant}"
|
||||
MASTER_PASSWD="${MASTER_PASSWD:-vagrant}"
|
||||
|
||||
# Admission Controllers to invoke prior to persisting objects in cluster
|
||||
# If we included ResourceQuota, we should keep it at the end of the list to prevent incremeting quota usage prematurely.
|
||||
@@ -111,3 +111,6 @@ OPENCONTRAIL_KUBERNETES_TAG="${OPENCONTRAIL_KUBERNETES_TAG:-master}"
|
||||
OPENCONTRAIL_PUBLIC_SUBNET="${OPENCONTRAIL_PUBLIC_SUBNET:-10.1.0.0/16}"
|
||||
# Optional: if set to true, kube-up will configure the cluster to run e2e tests.
|
||||
E2E_STORAGE_TEST_ENVIRONMENT=${KUBE_E2E_STORAGE_TEST_ENVIRONMENT:-false}
|
||||
|
||||
# Default fallback NETWORK_IF_NAME, will be used in case when no 'VAGRANT-BEGIN' comments were defined in network-script
|
||||
export DEFAULT_NETWORK_IF_NAME="eth0"
|
||||
|
@@ -21,6 +21,8 @@ set -o pipefail
|
||||
# Set the host name explicitly
|
||||
# See: https://github.com/mitchellh/vagrant/issues/2430
|
||||
hostnamectl set-hostname ${MASTER_NAME}
|
||||
# Set the variable to empty value explicitly
|
||||
if_to_edit=""
|
||||
|
||||
if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=23 ]]; then
|
||||
# Disable network interface being managed by Network Manager (needed for Fedora 21+)
|
||||
@@ -33,7 +35,13 @@ if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=23 ]]; then
|
||||
systemctl restart network
|
||||
fi
|
||||
|
||||
# needed for vsphere support
|
||||
# handle the case when no 'VAGRANT-BEGIN' comment was defined in network-scripts
|
||||
# set the NETWORK_IF_NAME to have a default value in such case
|
||||
NETWORK_IF_NAME=`echo ${if_to_edit} | awk -F- '{ print $3 }'`
|
||||
if [[ -z "$NETWORK_IF_NAME" ]]; then
|
||||
NETWORK_IF_NAME=${DEFAULT_NETWORK_IF_NAME}
|
||||
fi
|
||||
|
||||
function release_not_found() {
|
||||
echo "It looks as if you don't have a compiled version of Kubernetes. If you" >&2
|
||||
|
@@ -70,6 +70,12 @@ EOF
|
||||
NETWORK_CONF_PATH=/etc/sysconfig/network-scripts/
|
||||
if_to_edit=$( find ${NETWORK_CONF_PATH}ifcfg-* | xargs grep -l VAGRANT-BEGIN )
|
||||
NETWORK_IF_NAME=`echo ${if_to_edit} | awk -F- '{ print $3 }'`
|
||||
# needed for vsphere support
|
||||
# handle the case when no 'VAGRANT-BEGIN' comment was defined in network-scripts
|
||||
# set the NETWORK_IF_NAME to have a default value in such case
|
||||
if [[ -z "$NETWORK_IF_NAME" ]]; then
|
||||
NETWORK_IF_NAME=${DEFAULT_NETWORK_IF_NAME}
|
||||
fi
|
||||
cat <<EOF >/etc/sysconfig/flanneld
|
||||
FLANNEL_ETCD="${FLANNEL_ETCD_URL}"
|
||||
FLANNEL_ETCD_KEY="/coreos.com/network"
|
||||
|
@@ -30,6 +30,12 @@ function provision-network-node {
|
||||
NETWORK_CONF_PATH=/etc/sysconfig/network-scripts/
|
||||
if_to_edit=$( find ${NETWORK_CONF_PATH}ifcfg-* | xargs grep -l VAGRANT-BEGIN )
|
||||
NETWORK_IF_NAME=`echo ${if_to_edit} | awk -F- '{ print $3 }'`
|
||||
# needed for vsphere support
|
||||
# handle the case when no 'VAGRANT-BEGIN' comment was defined in network-scripts
|
||||
# set the NETWORK_IF_NAME to have a default value in such case
|
||||
if [[ -z "$NETWORK_IF_NAME" ]]; then
|
||||
NETWORK_IF_NAME=${DEFAULT_NETWORK_IF_NAME}
|
||||
fi
|
||||
cat <<EOF >/etc/sysconfig/flanneld
|
||||
FLANNEL_ETCD="${FLANNEL_ETCD_URL}"
|
||||
FLANNEL_ETCD_KEY="/coreos.com/network"
|
||||
|
@@ -21,6 +21,7 @@ set -o pipefail
|
||||
# Set the host name explicitly
|
||||
# See: https://github.com/mitchellh/vagrant/issues/2430
|
||||
hostnamectl set-hostname ${NODE_NAME}
|
||||
if_to_edit=""
|
||||
|
||||
if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=23 ]]; then
|
||||
# Disable network interface being managed by Network Manager (needed for Fedora 21+)
|
||||
@@ -33,7 +34,13 @@ if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=23 ]]; then
|
||||
systemctl restart network
|
||||
fi
|
||||
|
||||
# needed for vsphere support
|
||||
# handle the case when no 'VAGRANT-BEGIN' comment was defined in network-scripts
|
||||
# set the NETWORK_IF_NAME to have a default value in such case
|
||||
NETWORK_IF_NAME=`echo ${if_to_edit} | awk -F- '{ print $3 }'`
|
||||
if [[ -z "$NETWORK_IF_NAME" ]]; then
|
||||
NETWORK_IF_NAME=${DEFAULT_NETWORK_IF_NAME}
|
||||
fi
|
||||
|
||||
# Setup hosts file to support ping by hostname to master
|
||||
if [ ! "$(cat /etc/hosts | grep $MASTER_NAME)" ]; then
|
||||
|
@@ -53,6 +53,7 @@ function verify-prereqs {
|
||||
prlctl parallels vagrant-parallels
|
||||
VBoxManage virtualbox ''
|
||||
virsh libvirt vagrant-libvirt
|
||||
'' vsphere vagrant-vsphere
|
||||
)
|
||||
local provider_found=''
|
||||
local provider_bin
|
||||
|
Reference in New Issue
Block a user