mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 03:33:26 +00:00
Use a skeleton provider for unimplemented functionality
This commit is contained in:
@@ -14,87 +14,15 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This script contains skeletons of helper functions that each provider hosting
|
||||
# Kubernetes must implement to use cluster/kube-*.sh scripts.
|
||||
# It sets KUBERNETES_PROVIDER to its default value (gce) if it is unset, and
|
||||
# then sources cluster/${KUBERNETES_PROVIDER}/util.sh.
|
||||
|
||||
KUBERNETES_PROVIDER="${KUBERNETES_PROVIDER:-gce}"
|
||||
|
||||
# Must ensure that the following ENV vars are set
|
||||
function detect-master {
|
||||
echo "KUBE_MASTER_IP: $KUBE_MASTER_IP" 1>&2
|
||||
echo "KUBE_MASTER: $KUBE_MASTER" 1>&2
|
||||
}
|
||||
|
||||
# Get node names if they are not static.
|
||||
function detect-node-names {
|
||||
echo "NODE_NAMES: [${NODE_NAMES[*]}]" 1>&2
|
||||
}
|
||||
|
||||
# Get node IP addresses and store in KUBE_NODE_IP_ADDRESSES[]
|
||||
function detect-nodes {
|
||||
echo "KUBE_NODE_IP_ADDRESSES: [${KUBE_NODE_IP_ADDRESSES[*]}]" 1>&2
|
||||
}
|
||||
|
||||
# Verify prereqs on host machine
|
||||
function verify-prereqs {
|
||||
echo "TODO: verify-prereqs" 1>&2
|
||||
}
|
||||
|
||||
# Validate a kubernetes cluster
|
||||
function validate-cluster {
|
||||
# by default call the generic validate-cluster.sh script, customizable by
|
||||
# any cluster provider if this does not fit.
|
||||
"${KUBE_ROOT}/cluster/validate-cluster.sh"
|
||||
}
|
||||
|
||||
# Instantiate a kubernetes cluster
|
||||
function kube-up {
|
||||
echo "TODO: kube-up" 1>&2
|
||||
}
|
||||
|
||||
# Delete a kubernetes cluster
|
||||
function kube-down {
|
||||
echo "TODO: kube-down" 1>&2
|
||||
}
|
||||
|
||||
# Update a kubernetes cluster
|
||||
function kube-push {
|
||||
echo "TODO: kube-push" 1>&2
|
||||
}
|
||||
|
||||
# Prepare update a kubernetes component
|
||||
function prepare-push {
|
||||
echo "TODO: prepare-push" 1>&2
|
||||
}
|
||||
|
||||
# Update a kubernetes master
|
||||
function push-master {
|
||||
echo "TODO: push-master" 1>&2
|
||||
}
|
||||
|
||||
# Update a kubernetes node
|
||||
function push-node {
|
||||
echo "TODO: push-node" 1>&2
|
||||
}
|
||||
|
||||
# Execute prior to running tests to build a release if required for env
|
||||
function test-build-release {
|
||||
echo "TODO: test-build-release" 1>&2
|
||||
}
|
||||
|
||||
# Execute prior to running tests to initialize required structure
|
||||
function test-setup {
|
||||
echo "TODO: test-setup" 1>&2
|
||||
}
|
||||
|
||||
# Execute after running tests to perform any required clean-up
|
||||
function test-teardown {
|
||||
echo "TODO: test-teardown" 1>&2
|
||||
}
|
||||
# This script will source the default skeleton helper functions, then sources
|
||||
# cluster/${KUBERNETES_PROVIDER}/util.sh where KUBERNETES_PROVIDER, if unset,
|
||||
# will use its default value (gce).
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
|
||||
source "${KUBE_ROOT}/cluster/skeleton/util.sh"
|
||||
|
||||
KUBERNETES_PROVIDER="${KUBERNETES_PROVIDER:-gce}"
|
||||
PROVIDER_UTILS="${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
||||
if [ -f ${PROVIDER_UTILS} ]; then
|
||||
source "${PROVIDER_UTILS}"
|
||||
@@ -112,7 +40,7 @@ function set-federated-zone-vars {
|
||||
|
||||
export KUBE_GCE_ZONE="$zone"
|
||||
# gcloud has a 61 character limit, and for firewall rules this
|
||||
# prefix gets appended to itslef, with some extra information
|
||||
# prefix gets appended to itself, with some extra information
|
||||
# need tot keep it short
|
||||
export KUBE_GCE_INSTANCE_PREFIX="${USER}-${zone}"
|
||||
|
||||
|
Reference in New Issue
Block a user