mirror of https://github.com/k3s-io/k3s
Removing unused scripts from km and kubernetes.
parent
ee2d43ac35
commit
74c00d431e
|
@ -1,59 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# This script downloads a Kubernetes release and creates a tar file with only
|
||||
# the files that are needed for this charm.
|
||||
|
||||
# Usage: create_kubernetes_tar.sh VERSION ARCHITECTURE
|
||||
|
||||
usage() {
|
||||
echo "Build a tar file with only the files needed for the kubernetes charm."
|
||||
echo "The script accepts two arguments version and desired architecture."
|
||||
echo "$0 version architecture"
|
||||
}
|
||||
|
||||
download_kubernetes() {
|
||||
local VERSION=$1
|
||||
URL_PREFIX="https://github.com/GoogleCloudPlatform/kubernetes"
|
||||
KUBERNETES_URL="${URL_PREFIX}/releases/download/${VERSION}/kubernetes.tar.gz"
|
||||
# Remove the previous temporary files to remain idempotent.
|
||||
if [ -f /tmp/kubernetes.tar.gz ]; then
|
||||
rm /tmp/kubernetes.tar.gz
|
||||
fi
|
||||
# Download the kubernetes release from the Internet.
|
||||
wget --no-verbose --tries 2 -O /tmp/kubernetes.tar.gz $KUBERNETES_URL
|
||||
}
|
||||
|
||||
extract_kubernetes() {
|
||||
local ARCH=$1
|
||||
# Untar the kubernetes release file.
|
||||
tar -xvzf /tmp/kubernetes.tar.gz -C /tmp
|
||||
# Untar the server linux amd64 package.
|
||||
tar -xvzf /tmp/kubernetes/server/kubernetes-server-linux-$ARCH.tar.gz -C /tmp
|
||||
}
|
||||
|
||||
create_charm_tar() {
|
||||
local OUTPUT_FILE=${1:-"$PWD/kubernetes.tar.gz"}
|
||||
local OUTPUT_DIR=`dirname $OUTPUT_FILE`
|
||||
if [ ! -d $OUTPUT_DIR ]; then
|
||||
mkdir -p $OUTPUT
|
||||
fi
|
||||
|
||||
# Change to the directory the binaries are.
|
||||
cd /tmp/kubernetes/server/bin/
|
||||
|
||||
# Create a tar file with the binaries that are needed for kubernetes master.
|
||||
tar -cvzf $OUTPUT_FILE kube-apiserver kube-controller-manager kubectl kube-scheduler
|
||||
}
|
||||
|
||||
if [ $# -gt 2 ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
VERSION=${1:-"v0.8.1"}
|
||||
ARCH=${2:-"amd64"}
|
||||
download_kubernetes $VERSION
|
||||
extract_kubernetes $ARCH
|
||||
TAR_FILE="$PWD/kubernetes-master-$VERSION-$ARCH.tar.gz"
|
||||
create_charm_tar $TAR_FILE
|
|
@ -1,52 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script sets up the guestbook example application in Kubernetes.
|
||||
# The KUBERENTES_MASTER variable must be set to the URL for kubectl to work.
|
||||
# The first argument is optional and can be used for debugging.
|
||||
|
||||
set -o errexit # (set -e)
|
||||
|
||||
DEBUG=false
|
||||
if [[ "$1" == "-d" ]] || [[ "$1" == "--debug" ]]; then
|
||||
DEBUG=true
|
||||
set -o xtrace # (set -x)
|
||||
fi
|
||||
cd /opt/kubernetes/
|
||||
# Step One Turn up the redis master
|
||||
kubectl create -f examples/guestbook/v1beta3/redis-master.json
|
||||
if [[ "${DEBUG}" == true ]]; then
|
||||
kubectl get pods
|
||||
fi
|
||||
# Step Two: Turn up the master service
|
||||
kubectl create -f examples/guestbook/v1beta3/redis-master-service.json
|
||||
if [[ "${DEBUG}" == true ]]; then
|
||||
kubectl get services
|
||||
fi
|
||||
# Step Three: Turn up the replicated slave pods
|
||||
kubectl create -f examples/guestbook/v1beta3/redis-slave-controller.json
|
||||
if [[ "${DEBUG}" == true ]]; then
|
||||
kubectl get replicationcontrollers
|
||||
kubectl get pods
|
||||
fi
|
||||
# Step Four: Create the redis slave service
|
||||
kubectl create -f examples/guestbook/v1beta3/redis-slave-service.json
|
||||
if [[ "${DEBUG}" == true ]]; then
|
||||
kubectl get services
|
||||
fi
|
||||
# Step Five: Create the frontend pod
|
||||
kubectl create -f examples/guestbook/v1beta3/frontend-controller.json
|
||||
if [[ "${DEBUG}" == true ]]; then
|
||||
kubectl get replicationcontrollers
|
||||
kubectl get pods
|
||||
fi
|
||||
# Step Six: Create the guestbook service
|
||||
kubectl create -f examples/guestbook/v1beta3/frontend-service.json
|
||||
if [[ "${DEBUG}" == true ]]; then
|
||||
kubectl get services
|
||||
fi
|
||||
set +x
|
||||
|
||||
echo "# Now run the following commands on your juju client"
|
||||
echo "juju run --service kubernetes 'open-port 8000'"
|
||||
echo "juju expose kubernetes"
|
||||
echo "# Go to the kubernetes public address on port 8000 to see the guestbook application"
|
|
@ -1,59 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# This script downloads a Kubernetes release and creates a tar file with only
|
||||
# the files that are needed for this charm.
|
||||
|
||||
# Usage: create_kubernetes_tar.sh VERSION ARCHITECTURE
|
||||
|
||||
usage() {
|
||||
echo "Build a tar file with only the files needed for the kubernetes charm."
|
||||
echo "The script accepts two arguments version and desired architecture."
|
||||
echo "$0 version architecture"
|
||||
}
|
||||
|
||||
download_kubernetes() {
|
||||
local VERSION=$1
|
||||
URL_PREFIX="https://github.com/GoogleCloudPlatform/kubernetes"
|
||||
KUBERNETES_URL="${URL_PREFIX}/releases/download/${VERSION}/kubernetes.tar.gz"
|
||||
# Remove the previous temporary files to remain idempotent.
|
||||
if [ -f /tmp/kubernetes.tar.gz ]; then
|
||||
rm /tmp/kubernetes.tar.gz
|
||||
fi
|
||||
# Download the kubernetes release from the Internet.
|
||||
wget --no-verbose --tries 2 -O /tmp/kubernetes.tar.gz $KUBERNETES_URL
|
||||
}
|
||||
|
||||
extract_kubernetes() {
|
||||
local ARCH=$1
|
||||
# Untar the kubernetes release file.
|
||||
tar -xvzf /tmp/kubernetes.tar.gz -C /tmp
|
||||
# Untar the server linux amd64 package.
|
||||
tar -xvzf /tmp/kubernetes/server/kubernetes-server-linux-$ARCH.tar.gz -C /tmp
|
||||
}
|
||||
|
||||
create_charm_tar() {
|
||||
local OUTPUT_FILE=${1:-"$PWD/kubernetes.tar.gz"}
|
||||
local OUTPUT_DIR=`dirname $OUTPUT_FILE`
|
||||
if [ ! -d $OUTPUT_DIR ]; then
|
||||
mkdir -p $OUTPUT
|
||||
fi
|
||||
|
||||
# Change to the directory the binaries are.
|
||||
cd /tmp/kubernetes/server/bin/
|
||||
|
||||
# Create a tar file with the binaries that are needed for kubernetes minion.
|
||||
tar -cvzf $OUTPUT_FILE kubelet kube-proxy
|
||||
}
|
||||
|
||||
if [ $# -gt 2 ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
VERSION=${1:-"v0.8.1"}
|
||||
ARCH=${2:-"amd64"}
|
||||
download_kubernetes $VERSION
|
||||
extract_kubernetes $ARCH
|
||||
TAR_FILE="$PWD/kubernetes-$VERSION-$ARCH.tar.gz"
|
||||
create_charm_tar $TAR_FILE
|
Loading…
Reference in New Issue