From a64e477c365c24e3853e9eeb9caa0479b244635d Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Thu, 11 Feb 2021 15:45:51 -0400 Subject: [PATCH 1/9] Initial script for IPv6 Cluster creation --- kubernetes/.run.sh.swp | Bin 0 -> 12288 bytes kubernetes/run_ipv6.sh | 51 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 kubernetes/.run.sh.swp create mode 100644 kubernetes/run_ipv6.sh diff --git a/kubernetes/.run.sh.swp b/kubernetes/.run.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..e6ca23a23913a0358adefe19b80019a875f007cb GIT binary patch literal 12288 zcmeHNO^h5z6>bwlfFyuG@&$n^?X@?Xq`JLcD@tZH2FJU^tH|-jyLJx2p43#=%#^pM zt6f#S>t(Wl07U``At4SRgak)U@r4WG0?H4FLw*kYoRAO_k;07x5(E-oRrk#HP8__7 zd;rlceVXa2davI5>eYKSyVX5*apf#|Fgh0C`B)IVaP`Pj*Z=j$+YbFc2sS0RO1qB# z{9N?o3_Z*E!%A(?Rjr~_ah6VreX&#+bH)cE>#KO9=n9<)D@?45EHZ;Bf#$Vgpkd$^ zGH_S0aD3ix^~2%aPM}y$6!0&+H0zU_y0TzItek2Hf4162d1TF)Q0}*ftI0(FPR}lOO_zmzY z;FrL+00CSCjskZ82Z1;541!++F96R2*MT1ZUk9!NPXLR+QQ)mRg5b}PyeC-CxzgWx6LJHS_f`+!$J6a=pT&jVirJ`4Q)gF)~b@FH*-SOo3|?gQ=xJ_-Ec zcGv-220jCP8hHBy@C|ql_$KfSa1AiP3E*e%$5`MbZ~*w*!65i5@HFr+@G0OB@XBpL z@GS5{;QPS$fbRld1|9)U0RP0g`~!F!cnf$Pcop~w;MVL};Q#3nhVg)qB9oc1EKTP~ zqB@f|vbc!OdRO(`b#P_`31{X*3;<<27&*R)LU}4lktfWGl~V7TWwtP6=G5xy$`T1L zjOP*%T zDd~gLOeMk)s@hkK%5r80?Qj%HD~9IDW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T$~P!r=Q{yQ_s&t|xSRPjh)r53p+P7(81Zh7-~C zwG*Wi;!_*k`&#aIdQD``mm&6fNKT&g@d=68s6yjF8>Q0Ns9th>%PfwUrbrZ_1`~Vl zsF@UNobxtNtWlyd2x*@ise%>Ezs+tH(+;-Xbve(MAU->/etc/sysctl.d/kubernetes.conf< /etc/apt/sources.list.d/kubernetes.list + apt update && apt install -y kubeadm=1.18.5-00 kubelet=1.18.5-00 kubectl=1.18.5-00 + + #Initialization + kubeadm init --apiserver-advertise-address=$IPV6_ADDR + + #Pull Calico config and apply + wget $CALICO_URL + kubectl apply -f calico.yaml + + exit + + mkdir -p $HOME/.kube + sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config + sudo chown $(id -u):$(id -g) $HOME/.kube/config + + #Will probably need to publish part of the data returned in the join command. + #Will need to publish the modified Calico config file + +} + +function do_uninstall { + cachengo-cli updateInstallStatus $APPID "Uninstalling" + kubeadm reset -f + cachengo-cli updateInstallStatus $APPID "Uninstalled" +} + + +case "$1" in + install) do_install ;; + uninstall) do_uninstall ;; +esac From 4a52993c8cc6ca67389322bb7512e399f7a87b29 Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Tue, 16 Feb 2021 22:16:44 -0400 Subject: [PATCH 2/9] Recipe will generate a High Availability K8s cluster with IPv6 capabilities --- kubernetes/.run.sh.swp | Bin 12288 -> 0 bytes kubernetes/calico.yaml | 848 ++++++++++++++++++++++++++++++++++++++++ kubernetes/package.json | 9 +- kubernetes/run.sh | 104 +---- kubernetes/run_ipv6.sh | 51 --- ubuntu@3.23.98.22 | 618 +++++++++++++++++++++++++++++ 6 files changed, 1492 insertions(+), 138 deletions(-) delete mode 100644 kubernetes/.run.sh.swp create mode 100644 kubernetes/calico.yaml delete mode 100644 kubernetes/run_ipv6.sh create mode 100755 ubuntu@3.23.98.22 diff --git a/kubernetes/.run.sh.swp b/kubernetes/.run.sh.swp deleted file mode 100644 index e6ca23a23913a0358adefe19b80019a875f007cb..0000000000000000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K@oekxclU9=Bt zH|D6DDc*+z)n&Vzrno8-xS%-$)ox=SCTmDMxwjn|(^DoaPoix$Oz}F7eU|4bg1(2X zluE9AcVvh8jfRXJOcXa!uGJN6`ASUbe!RI5EyN(gZ8VB~tgT3DUdOUb&pzqJy36>x z+A=Y;vSf6Gh%C`;iyU#O--rZ>VsSLeRnoy7#15B<-q~54Sv|MZd2D&Tb9!az{9-?> z`$SIG-zvRM5tYytk48miiab}&=nm6-u(K1-TzG8l!s_a|^Xtn?9T#~qbWYngF~)Ut ze7rkTme)@&bym)vdSuxdG7*9qlkdCERi44MJ%NPgs4wlH=oZ+f$e31S*2mH~@5M%R zS%(k6wTXw!Wsul#Epxoq7WCFCo;U!tKFm;l$!Q-xXc?P!)1Y00(Jo?3$vp|#GMP>4 z2*pvs=WObdW8?z2ym%T(RryT4CF@=aX@itZcp(@1D7jl1ij>4^7jv!hOMi~coH=)P zIrbW3u-lV;HyCwDk{C|bW7lU`SG0OJmKts(64@fJ_d*%jP1w{0X?stIRs#^l6j8jT z^u~<`IhWm$#pPS_c}Sroxnc{UsHF)S) z0#}J3?h8~nb5G&U1%wXg!m?1gB(b+t?LYJ#3oiB_eGsQG%we`zu6jK}nYVY6o@;L| z0NmQU#|1=+iZgykLf#M>j7?g)g-jFb%5G*QODF9{_3ReYf?{cM0V9N=C{9D1V#msO zp?Ak~M!6f-lN_fMGa1BkORZ*^aT$~P!r=Q{yQ_s&t|xSRPjh)r53p+P7(81Zh7-~C zwG*Wi;!_*k`&#aIdQD``mm&6fNKT&g@d=68s6yjF8>Q0Ns9th>%PfwUrbrZ_1`~Vl zsF@UNobxtNtWlyd2x*@ise%>Ezs+tH(+;-Xbve(MAU->/etc/apt/sources.list.d/kubernetes.list' | sudo -s - apt-get update - apt-get install -y \ - apt-transport-https \ - ca-certificates \ - curl \ - software-properties-common \ - build-essential \ - docker.io \ - kubelet \ - kubeadm \ - kubectl - swapoff -a +# cachengo-cli updateInstallStatus $APPID "Installing K8s" + + swapoff -a; sed -i '/swap/d' /etc/fstab - cachengo-cli updateInstallStatus $APPID "Starting K8s" - if [ "$(uname -m)" == 'aarch64' ]; then - ARCH=arm64 - ETCD_IMAGE=quay.io/coreos/etcd:v3.3.9-arm64 - UNSUPPORTED_ARCH=arm64 - else - ARCH=amd64 - ETCD_IMAGE=quay.io/coreos/etcd:v3.3.9 - fi + sysctl -w net.ipv6.conf.all.forwarding=1 - # Start Kubernetes - modprobe -r ipip - rm -rf /var/etcd/ - rm -rf /var/lib/etcd/ - rm -rf /etc/kubernetes/ - ip route flush proto bird - rm -rf $HOME/.kube - sysctl net.bridge.bridge-nf-call-iptables=1 - kubeadm init \ - --pod-network-cidr=$POD_NET_CIDR - --cluster-cidr=$POD_NET_CIDR - mkdir -p $HOME/.kube - cp -i /etc/kubernetes/admin.conf $HOME/.kube/config - chown $(id -u):$(id -g) $HOME/.kube/config - - # Taint the master node - kubectl taint nodes --all node-role.kubernetes.io/master- + #Will update sysctl settings + cat >>/etc/sysctl.d/kubernetes.conf< /etc/apt/sources.list.d/kubernetes.list + apt update && apt install -y kubeadm=1.18.5-00 kubelet=1.18.5-00 kubectl=1.18.5-00 - {% raw %} - sed "s;{{etcd_image}};$ETCD_IMAGE;g" etcd.yaml > etcd.yaml.tmp - sed -i "s/{{unsupported_arch}}/$UNSUPPORTED_ARCH/g" etcd.yaml.tmp - sed "s;{{pod_net_cidr}};$POD_NET_CIDR;g" calico.yaml > calico.yaml.tmp - {% endraw %} - kubectl apply -f etcd.yaml.tmp - kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/rbac.yaml - kubectl apply -f calico.yaml.tmp - rm etcd.yaml + #Initialization + kubeadm init --apiserver-advertise-address=$ADVERTISE_ADDRESS + + mkdir -p $HOME/.kube + cp -i /etc/kubernetes/admin.conf $HOME/.kube/config - # Setup helm - cachengo-cli updateInstallStatus $APPID "Installing Helm" - wget https://storage.googleapis.com/kubernetes-helm/helm-v2.12.3-linux-$ARCH.tar.gz - tar -xvf helm-v2.12.3-linux-$ARCH.tar.gz - cp linux-$ARCH/helm /usr/bin - cp linux-$ARCH/tiller /usr/bin - rm helm-v2.12.3-linux-$ARCH.tar.gz - rm -rf linux-$ARCH - if [ $ARCH == 'arm64' ]; then - helm init --tiller-image=jessestuart/tiller:v2.9.1 - else - helm init - fi - kubectl create serviceaccount --namespace kube-system tiller - kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller - kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' - - cachengo-cli updateInstallStatus $APPID "Waiting for node" - sleep 30 - if [ $(kubectl get nodes -o=jsonpath="{.items[0].status.conditions}" | grep -c "status:True type:Ready") -eq 1 ] - then - cachengo-cli updateInstallStatus $APPID "Installed" - echo -n "Installation Success" - else - cachengo-cli updateInstallStatus $APPID "Installation Failure" - echo "Installation Failure" - return 1 - fi + kubectl apply -f kubernetes/calico.yaml } function do_uninstall { @@ -103,4 +41,4 @@ function do_uninstall { case "$1" in install) do_install ;; uninstall) do_uninstall ;; -esac \ No newline at end of file +esac diff --git a/kubernetes/run_ipv6.sh b/kubernetes/run_ipv6.sh deleted file mode 100644 index 25b3803..0000000 --- a/kubernetes/run_ipv6.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -source "utils/cachengo.sh" - -function do_install { - cachengo-cli updateInstallStatus $APPID "Installing K8s" - sudo -i - ufw disable #should be changed after validating no issues appear without it - swapoff -a; sed -i '/swap/d' /etc/fstab - - #Will update sysctl settings - cat >>/etc/sysctl.d/kubernetes.conf< /etc/apt/sources.list.d/kubernetes.list - apt update && apt install -y kubeadm=1.18.5-00 kubelet=1.18.5-00 kubectl=1.18.5-00 - - #Initialization - kubeadm init --apiserver-advertise-address=$IPV6_ADDR - - #Pull Calico config and apply - wget $CALICO_URL - kubectl apply -f calico.yaml - - exit - - mkdir -p $HOME/.kube - sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config - sudo chown $(id -u):$(id -g) $HOME/.kube/config - - #Will probably need to publish part of the data returned in the join command. - #Will need to publish the modified Calico config file - -} - -function do_uninstall { - cachengo-cli updateInstallStatus $APPID "Uninstalling" - kubeadm reset -f - cachengo-cli updateInstallStatus $APPID "Uninstalled" -} - - -case "$1" in - install) do_install ;; - uninstall) do_uninstall ;; -esac diff --git a/ubuntu@3.23.98.22 b/ubuntu@3.23.98.22 new file mode 100755 index 0000000..1ba5f1e --- /dev/null +++ b/ubuntu@3.23.98.22 @@ -0,0 +1,618 @@ +#!/bin/sh +# This script was generated using Makeself 2.4.0 +# The license covering this archive and its contents, if any, is wholly independent of the Makeself license (GPL) + +ORIG_UMASK=`umask` +if test "n" = n; then + umask 077 +fi + +CRCsum="1301561995" +MD5="92cd7d8cf51e967d13ccaef8c2d7c3f4" +SHA="0000000000000000000000000000000000000000000000000000000000000000" +TMPROOT=${TMPDIR:=/tmp} +USER_PWD="$PWD"; export USER_PWD + +label="Starts a single-node kubernetes cluster" +script="kubernetes/run.sh" +scriptargs="" +licensetxt="" +helpheader='' +targetdir="build" +filesizes="5646" +keep="n" +nooverwrite="n" +quiet="n" +accept="n" +nodiskspace="n" +export_conf="n" + +print_cmd_arg="" +if type printf > /dev/null; then + print_cmd="printf" +elif test -x /usr/ucb/echo; then + print_cmd="/usr/ucb/echo" +else + print_cmd="echo" +fi + +if test -d /usr/xpg4/bin; then + PATH=/usr/xpg4/bin:$PATH + export PATH +fi + +if test -d /usr/sfw/bin; then + PATH=$PATH:/usr/sfw/bin + export PATH +fi + +unset CDPATH + +MS_Printf() +{ + $print_cmd $print_cmd_arg "$1" +} + +MS_PrintLicense() +{ + if test x"$licensetxt" != x; then + echo "$licensetxt" | more + if test x"$accept" != xy; then + while true + do + MS_Printf "Please type y to accept, n otherwise: " + read yn + if test x"$yn" = xn; then + keep=n + eval $finish; exit 1 + break; + elif test x"$yn" = xy; then + break; + fi + done + fi + fi +} + +MS_diskspace() +{ + ( + df -kP "$1" | tail -1 | awk '{ if ($4 ~ /%/) {print $3} else {print $4} }' + ) +} + +MS_dd() +{ + blocks=`expr $3 / 1024` + bytes=`expr $3 % 1024` + dd if="$1" ibs=$2 skip=1 obs=1024 conv=sync 2> /dev/null | \ + { test $blocks -gt 0 && dd ibs=1024 obs=1024 count=$blocks ; \ + test $bytes -gt 0 && dd ibs=1 obs=1024 count=$bytes ; } 2> /dev/null +} + +MS_dd_Progress() +{ + if test x"$noprogress" = xy; then + MS_dd $@ + return $? + fi + file="$1" + offset=$2 + length=$3 + pos=0 + bsize=4194304 + while test $bsize -gt $length; do + bsize=`expr $bsize / 4` + done + blocks=`expr $length / $bsize` + bytes=`expr $length % $bsize` + ( + dd ibs=$offset skip=1 2>/dev/null + pos=`expr $pos \+ $bsize` + MS_Printf " 0%% " 1>&2 + if test $blocks -gt 0; then + while test $pos -le $length; do + dd bs=$bsize count=1 2>/dev/null + pcent=`expr $length / 100` + pcent=`expr $pos / $pcent` + if test $pcent -lt 100; then + MS_Printf "\b\b\b\b\b\b\b" 1>&2 + if test $pcent -lt 10; then + MS_Printf " $pcent%% " 1>&2 + else + MS_Printf " $pcent%% " 1>&2 + fi + fi + pos=`expr $pos \+ $bsize` + done + fi + if test $bytes -gt 0; then + dd bs=$bytes count=1 2>/dev/null + fi + MS_Printf "\b\b\b\b\b\b\b" 1>&2 + MS_Printf " 100%% " 1>&2 + ) < "$file" +} + +MS_Help() +{ + cat << EOH >&2 +${helpheader}Makeself version 2.4.0 + 1) Getting help or info about $0 : + $0 --help Print this message + $0 --info Print embedded info : title, default target directory, embedded script ... + $0 --lsm Print embedded lsm entry (or no LSM) + $0 --list Print the list of files in the archive + $0 --check Checks integrity of the archive + + 2) Running $0 : + $0 [options] [--] [additional arguments to embedded script] + with following options (in that order) + --confirm Ask before running embedded script + --quiet Do not print anything except error messages + --accept Accept the license + --noexec Do not run embedded script + --keep Do not erase target directory after running + the embedded script + --noprogress Do not show the progress during the decompression + --nox11 Do not spawn an xterm + --nochown Do not give the extracted files to the current user + --nodiskspace Do not check for available disk space + --target dir Extract directly to a target directory (absolute or relative) + This directory may undergo recursive chown (see --nochown). + --tar arg1 [arg2 ...] Access the contents of the archive through the tar command + -- Following arguments will be passed to the embedded script +EOH +} + +MS_Check() +{ + OLD_PATH="$PATH" + PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"} + MD5_ARG="" + MD5_PATH=`exec <&- 2>&-; which md5sum || command -v md5sum || type md5sum` + test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which md5 || command -v md5 || type md5` + test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which digest || command -v digest || type digest` + PATH="$OLD_PATH" + + SHA_PATH=`exec <&- 2>&-; which shasum || command -v shasum || type shasum` + test -x "$SHA_PATH" || SHA_PATH=`exec <&- 2>&-; which sha256sum || command -v sha256sum || type sha256sum` + + if test x"$quiet" = xn; then + MS_Printf "Verifying archive integrity..." + fi + offset=`head -n 587 "$1" | wc -c | tr -d " "` + verb=$2 + i=1 + for s in $filesizes + do + crc=`echo $CRCsum | cut -d" " -f$i` + if test -x "$SHA_PATH"; then + if test x"`basename $SHA_PATH`" = xshasum; then + SHA_ARG="-a 256" + fi + sha=`echo $SHA | cut -d" " -f$i` + if test x"$sha" = x0000000000000000000000000000000000000000000000000000000000000000; then + test x"$verb" = xy && echo " $1 does not contain an embedded SHA256 checksum." >&2 + else + shasum=`MS_dd_Progress "$1" $offset $s | eval "$SHA_PATH $SHA_ARG" | cut -b-64`; + if test x"$shasum" != x"$sha"; then + echo "Error in SHA256 checksums: $shasum is different from $sha" >&2 + exit 2 + else + test x"$verb" = xy && MS_Printf " SHA256 checksums are OK." >&2 + fi + crc="0000000000"; + fi + fi + if test -x "$MD5_PATH"; then + if test x"`basename $MD5_PATH`" = xdigest; then + MD5_ARG="-a md5" + fi + md5=`echo $MD5 | cut -d" " -f$i` + if test x"$md5" = x00000000000000000000000000000000; then + test x"$verb" = xy && echo " $1 does not contain an embedded MD5 checksum." >&2 + else + md5sum=`MS_dd_Progress "$1" $offset $s | eval "$MD5_PATH $MD5_ARG" | cut -b-32`; + if test x"$md5sum" != x"$md5"; then + echo "Error in MD5 checksums: $md5sum is different from $md5" >&2 + exit 2 + else + test x"$verb" = xy && MS_Printf " MD5 checksums are OK." >&2 + fi + crc="0000000000"; verb=n + fi + fi + if test x"$crc" = x0000000000; then + test x"$verb" = xy && echo " $1 does not contain a CRC checksum." >&2 + else + sum1=`MS_dd_Progress "$1" $offset $s | CMD_ENV=xpg4 cksum | awk '{print $1}'` + if test x"$sum1" = x"$crc"; then + test x"$verb" = xy && MS_Printf " CRC checksums are OK." >&2 + else + echo "Error in checksums: $sum1 is different from $crc" >&2 + exit 2; + fi + fi + i=`expr $i + 1` + offset=`expr $offset + $s` + done + if test x"$quiet" = xn; then + echo " All good." + fi +} + +UnTAR() +{ + if test x"$quiet" = xn; then + tar $1vf - 2>&1 || { echo " ... Extraction failed." > /dev/tty; kill -15 $$; } + else + tar $1f - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 $$; } + fi +} + +finish=true +xterm_loop= +noprogress=n +nox11=n +copy=none +ownership=y +verbose=n + +initargs="$@" + +while true +do + case "$1" in + -h | --help) + MS_Help + exit 0 + ;; + -q | --quiet) + quiet=y + noprogress=y + shift + ;; + --accept) + accept=y + shift + ;; + --info) + echo Identification: "$label" + echo Target directory: "$targetdir" + echo Uncompressed size: 32 KB + echo Compression: gzip + echo Date of packaging: Tue Feb 16 19:34:19 AST 2021 + echo Built with Makeself version 2.4.0 on darwin18 + echo Build command was: "./makeself-2.4.0/makeself.sh \\ + \"./build\" \\ + \"kubernetes.recipe\" \\ + \"Starts a single-node kubernetes cluster\" \\ + \"kubernetes/run.sh\"" + if test x"$script" != x; then + echo Script run after extraction: + echo " " $script $scriptargs + fi + if test x"" = xcopy; then + echo "Archive will copy itself to a temporary location" + fi + if test x"n" = xy; then + echo "Root permissions required for extraction" + fi + if test x"n" = xy; then + echo "directory $targetdir is permanent" + else + echo "$targetdir will be removed after extraction" + fi + exit 0 + ;; + --dumpconf) + echo LABEL=\"$label\" + echo SCRIPT=\"$script\" + echo SCRIPTARGS=\"$scriptargs\" + echo archdirname=\"build\" + echo KEEP=n + echo NOOVERWRITE=n + echo COMPRESS=gzip + echo filesizes=\"$filesizes\" + echo CRCsum=\"$CRCsum\" + echo MD5sum=\"$MD5\" + echo OLDUSIZE=32 + echo OLDSKIP=588 + exit 0 + ;; + --lsm) +cat << EOLSM +No LSM. +EOLSM + exit 0 + ;; + --list) + echo Target directory: $targetdir + offset=`head -n 587 "$0" | wc -c | tr -d " "` + for s in $filesizes + do + MS_dd "$0" $offset $s | eval "gzip -cd" | UnTAR t + offset=`expr $offset + $s` + done + exit 0 + ;; + --tar) + offset=`head -n 587 "$0" | wc -c | tr -d " "` + arg1="$2" + if ! shift 2; then MS_Help; exit 1; fi + for s in $filesizes + do + MS_dd "$0" $offset $s | eval "gzip -cd" | tar "$arg1" - "$@" + offset=`expr $offset + $s` + done + exit 0 + ;; + --check) + MS_Check "$0" y + exit 0 + ;; + --confirm) + verbose=y + shift + ;; + --noexec) + script="" + shift + ;; + --keep) + keep=y + shift + ;; + --target) + keep=y + targetdir="${2:-.}" + if ! shift 2; then MS_Help; exit 1; fi + ;; + --noprogress) + noprogress=y + shift + ;; + --nox11) + nox11=y + shift + ;; + --nochown) + ownership=n + shift + ;; + --nodiskspace) + nodiskspace=y + shift + ;; + --xwin) + if test "n" = n; then + finish="echo Press Return to close this window...; read junk" + fi + xterm_loop=1 + shift + ;; + --phase2) + copy=phase2 + shift + ;; + --) + shift + break ;; + -*) + echo Unrecognized flag : "$1" >&2 + MS_Help + exit 1 + ;; + *) + break ;; + esac +done + +if test x"$quiet" = xy -a x"$verbose" = xy; then + echo Cannot be verbose and quiet at the same time. >&2 + exit 1 +fi + +if test x"n" = xy -a `id -u` -ne 0; then + echo "Administrative privileges required for this archive (use su or sudo)" >&2 + exit 1 +fi + +if test x"$copy" \!= xphase2; then + MS_PrintLicense +fi + +case "$copy" in +copy) + tmpdir="$TMPROOT"/makeself.$RANDOM.`date +"%y%m%d%H%M%S"`.$$ + mkdir "$tmpdir" || { + echo "Could not create temporary directory $tmpdir" >&2 + exit 1 + } + SCRIPT_COPY="$tmpdir/makeself" + echo "Copying to a temporary location..." >&2 + cp "$0" "$SCRIPT_COPY" + chmod +x "$SCRIPT_COPY" + cd "$TMPROOT" + exec "$SCRIPT_COPY" --phase2 -- $initargs + ;; +phase2) + finish="$finish ; rm -rf `dirname $0`" + ;; +esac + +if test x"$nox11" = xn; then + if tty -s; then # Do we have a terminal? + : + else + if test x"$DISPLAY" != x -a x"$xterm_loop" = x; then # No, but do we have X? + if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable + GUESS_XTERMS="xterm gnome-terminal rxvt dtterm eterm Eterm xfce4-terminal lxterminal kvt konsole aterm terminology" + for a in $GUESS_XTERMS; do + if type $a >/dev/null 2>&1; then + XTERM=$a + break + fi + done + chmod a+x $0 || echo Please add execution rights on $0 + if test `echo "$0" | cut -c1` = "/"; then # Spawn a terminal! + exec $XTERM -title "$label" -e "$0" --xwin "$initargs" + else + exec $XTERM -title "$label" -e "./$0" --xwin "$initargs" + fi + fi + fi + fi +fi + +if test x"$targetdir" = x.; then + tmpdir="." +else + if test x"$keep" = xy; then + if test x"$nooverwrite" = xy && test -d "$targetdir"; then + echo "Target directory $targetdir already exists, aborting." >&2 + exit 1 + fi + if test x"$quiet" = xn; then + echo "Creating directory $targetdir" >&2 + fi + tmpdir="$targetdir" + dashp="-p" + else + tmpdir="$TMPROOT/selfgz$$$RANDOM" + dashp="" + fi + mkdir $dashp "$tmpdir" || { + echo 'Cannot create target directory' $tmpdir >&2 + echo 'You should try option --target dir' >&2 + eval $finish + exit 1 + } +fi + +location="`pwd`" +if test x"$SETUP_NOCHECK" != x1; then + MS_Check "$0" +fi +offset=`head -n 587 "$0" | wc -c | tr -d " "` + +if test x"$verbose" = xy; then + MS_Printf "About to extract 32 KB in $tmpdir ... Proceed ? [Y/n] " + read yn + if test x"$yn" = xn; then + eval $finish; exit 1 + fi +fi + +if test x"$quiet" = xn; then + MS_Printf "Uncompressing $label" + + # Decrypting with openssl will ask for password, + # the prompt needs to start on new line + if test x"n" = xy; then + echo + fi +fi +res=3 +if test x"$keep" = xn; then + trap 'echo Signal caught, cleaning up >&2; cd $TMPROOT; /bin/rm -rf "$tmpdir"; eval $finish; exit 15' 1 2 3 15 +fi + +if test x"$nodiskspace" = xn; then + leftspace=`MS_diskspace "$tmpdir"` + if test -n "$leftspace"; then + if test "$leftspace" -lt 32; then + echo + echo "Not enough space left in "`dirname $tmpdir`" ($leftspace KB) to decompress $0 (32 KB)" >&2 + echo "Use --nodiskspace option to skip this check and proceed anyway" >&2 + if test x"$keep" = xn; then + echo "Consider setting TMPDIR to a directory with more free space." + fi + eval $finish; exit 1 + fi + fi +fi + +for s in $filesizes +do + if MS_dd_Progress "$0" $offset $s | eval "gzip -cd" | ( cd "$tmpdir"; umask $ORIG_UMASK ; UnTAR xp ) 1>/dev/null; then + if test x"$ownership" = xy; then + (cd "$tmpdir"; chown -R `id -u` .; chgrp -R `id -g` .) + fi + else + echo >&2 + echo "Unable to decompress $0" >&2 + eval $finish; exit 1 + fi + offset=`expr $offset + $s` +done +if test x"$quiet" = xn; then + echo +fi + +cd "$tmpdir" +res=0 +if test x"$script" != x; then + if test x"$export_conf" = x"y"; then + MS_BUNDLE="$0" + MS_LABEL="$label" + MS_SCRIPT="$script" + MS_SCRIPTARGS="$scriptargs" + MS_ARCHDIRNAME="$archdirname" + MS_KEEP="$KEEP" + MS_NOOVERWRITE="$NOOVERWRITE" + MS_COMPRESS="$COMPRESS" + export MS_BUNDLE MS_LABEL MS_SCRIPT MS_SCRIPTARGS + export MS_ARCHDIRNAME MS_KEEP MS_NOOVERWRITE MS_COMPRESS + fi + + if test x"$verbose" = x"y"; then + MS_Printf "OK to execute: $script $scriptargs $* ? [Y/n] " + read yn + if test x"$yn" = x -o x"$yn" = xy -o x"$yn" = xY; then + eval "\"$script\" $scriptargs \"\$@\""; res=$?; + fi + else + eval "\"$script\" $scriptargs \"\$@\""; res=$? + fi + if test "$res" -ne 0; then + test x"$verbose" = xy && echo "The program '$script' returned an error code ($res)" >&2 + fi +fi +if test x"$keep" = xn; then + cd "$TMPROOT" + /bin/rm -rf "$tmpdir" +fi +eval $finish; exit $res +{V,`=o8 +l}\i^Zm]dI+JI|wRߒ4MDXlgšjx9 i0Gt +#B4R.wR: o7 +cQ):ӭ7!kZ lUQq~:|?= F ^xfZ~xPx{|N(ehs3QI6)VqIҬ XxrIц +"q{9)g}@ab^;nJ4E$ ] +~Avy?{;.?aQw :_R1@Ό9?y~ZVHՏao!nqj%\(6&ƅ24['4@|UH__q6V;"ALJZHhpe2ʇ%Ic'j{n{dTk:-!5zIs =`}_ҚFM™{_ջMM0{JT mPX4 cbl{/Oרį[p6,ʑt5[L!-8XA1akeeLȳ柬Dr!Tnc9^xX6 R#-v_ 68l.&G*/1t@`ƽwxAգ!qb3E% e!|T @|Pmz|Q NU! |įĪ.$`:V &sޱg|FOM +vߔQc^ql3uh eAQ}*0+矂9Jx`r<l5mN-a:ŇA;@+ 9f(n%-мg ƃlS kFhm=ßإ5A1~m왾˥TPHa$lԽw' +3]xZ,:儲z3ni!9Iw!Y}~̖|'LJr~jCݙZs"_s/W`mtP~aڅ;lShF=»>.']q(ӥSq#\[;!m#-IUwZ4ab +|8<?}lP( (O*?6r}7^O*toՒaiQ`*J77YS +P c ` s-m[-(Y6F`ULt#N]q˾К *ǠW>{-;W@~'n؉si^aj{;EBCtujTq=Fêr&,`2QtZ?]3.° +R ֓)uTAHkηN/:y/ Di(4}d p\b! l[75M/Ƞ*%[TNzxrq9N6j2[rR;Nt{,M}TKߗMwpZJQ%L3_+X@=< .7 +[zˊhwG0)4=.x lփٴ1l̉TA"I, ̭H>vP9:u )ڹ}M<  t퍊kx> 57,V5)II4厠KU{&`9D RxLu)&3^i᠇bu^Ta\k9XLata9vY$XTꚋw5;f=*(t-PW\|' +q ǽwg{jʛLJ贤LVő^?M6lct1\'dxѤ&De i0֪>)a2xep9mܿ x œ-9mJfXr$a'tYލB&mv:QNє^,,A&Wm/Tb^)a5wOM}qPL]Q|x/mZ8/W>g.ݨoG|"t)kF[-ϣ;5h7ߑk.t1jo&n 3)*ڔ- +I/ qRZ?F@YȽb({'p#ȍNOA3_|MQT:Ik8IՌisk8NHkr|t/-ŬR]ON/JH*RN&d*7l'^ugAõܜZ=P!ceQ'\g~YcK.W2W J뵩[mI5J֖>}ciϖEP6IAX AJ<3hJڕk:uI|)͌f7-U;rOЪcv ^?FBKUtjɺ(V{nqpIZmS$` + vS IhjI < ,izIs +— +c+;ns^fo,G`ClIlp9V+}2%BA<7 +EstK[ΗmHPQgu|'izP뇗癿R.{#7v|)!U5rjQ$Ay +ZyO_Y ,+}LFb> 'm"9 Ǫb="] QNE .NQCB`9 {!Ûc\Bv"k3z:*'#ո^3."H]B;aLpPWi r6*l۷~Lf k[RУq+<'w/8NXVVfOW":Ps5 :h*zeo4(Xz7hWC#*nџ_N .'`;9w@+W.> D $}F+@H\ɧ +cELc:v\T5q*7b9p!韜'7fu!$D)w&1>N(@Ɯ ߋ6m{]9!o%DWF#缎'`囲@zqc wM h_SV͠5@̸fZ˗yy^yy^y?g_x \ No newline at end of file From 62e34836ef12134bddb29e5ee4d403c3b3b22488 Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Tue, 16 Feb 2021 22:22:31 -0400 Subject: [PATCH 3/9] remove unwanted files --- ubuntu@3.23.98.22 | 618 ---------------------------------------------- 1 file changed, 618 deletions(-) delete mode 100755 ubuntu@3.23.98.22 diff --git a/ubuntu@3.23.98.22 b/ubuntu@3.23.98.22 deleted file mode 100755 index 1ba5f1e..0000000 --- a/ubuntu@3.23.98.22 +++ /dev/null @@ -1,618 +0,0 @@ -#!/bin/sh -# This script was generated using Makeself 2.4.0 -# The license covering this archive and its contents, if any, is wholly independent of the Makeself license (GPL) - -ORIG_UMASK=`umask` -if test "n" = n; then - umask 077 -fi - -CRCsum="1301561995" -MD5="92cd7d8cf51e967d13ccaef8c2d7c3f4" -SHA="0000000000000000000000000000000000000000000000000000000000000000" -TMPROOT=${TMPDIR:=/tmp} -USER_PWD="$PWD"; export USER_PWD - -label="Starts a single-node kubernetes cluster" -script="kubernetes/run.sh" -scriptargs="" -licensetxt="" -helpheader='' -targetdir="build" -filesizes="5646" -keep="n" -nooverwrite="n" -quiet="n" -accept="n" -nodiskspace="n" -export_conf="n" - -print_cmd_arg="" -if type printf > /dev/null; then - print_cmd="printf" -elif test -x /usr/ucb/echo; then - print_cmd="/usr/ucb/echo" -else - print_cmd="echo" -fi - -if test -d /usr/xpg4/bin; then - PATH=/usr/xpg4/bin:$PATH - export PATH -fi - -if test -d /usr/sfw/bin; then - PATH=$PATH:/usr/sfw/bin - export PATH -fi - -unset CDPATH - -MS_Printf() -{ - $print_cmd $print_cmd_arg "$1" -} - -MS_PrintLicense() -{ - if test x"$licensetxt" != x; then - echo "$licensetxt" | more - if test x"$accept" != xy; then - while true - do - MS_Printf "Please type y to accept, n otherwise: " - read yn - if test x"$yn" = xn; then - keep=n - eval $finish; exit 1 - break; - elif test x"$yn" = xy; then - break; - fi - done - fi - fi -} - -MS_diskspace() -{ - ( - df -kP "$1" | tail -1 | awk '{ if ($4 ~ /%/) {print $3} else {print $4} }' - ) -} - -MS_dd() -{ - blocks=`expr $3 / 1024` - bytes=`expr $3 % 1024` - dd if="$1" ibs=$2 skip=1 obs=1024 conv=sync 2> /dev/null | \ - { test $blocks -gt 0 && dd ibs=1024 obs=1024 count=$blocks ; \ - test $bytes -gt 0 && dd ibs=1 obs=1024 count=$bytes ; } 2> /dev/null -} - -MS_dd_Progress() -{ - if test x"$noprogress" = xy; then - MS_dd $@ - return $? - fi - file="$1" - offset=$2 - length=$3 - pos=0 - bsize=4194304 - while test $bsize -gt $length; do - bsize=`expr $bsize / 4` - done - blocks=`expr $length / $bsize` - bytes=`expr $length % $bsize` - ( - dd ibs=$offset skip=1 2>/dev/null - pos=`expr $pos \+ $bsize` - MS_Printf " 0%% " 1>&2 - if test $blocks -gt 0; then - while test $pos -le $length; do - dd bs=$bsize count=1 2>/dev/null - pcent=`expr $length / 100` - pcent=`expr $pos / $pcent` - if test $pcent -lt 100; then - MS_Printf "\b\b\b\b\b\b\b" 1>&2 - if test $pcent -lt 10; then - MS_Printf " $pcent%% " 1>&2 - else - MS_Printf " $pcent%% " 1>&2 - fi - fi - pos=`expr $pos \+ $bsize` - done - fi - if test $bytes -gt 0; then - dd bs=$bytes count=1 2>/dev/null - fi - MS_Printf "\b\b\b\b\b\b\b" 1>&2 - MS_Printf " 100%% " 1>&2 - ) < "$file" -} - -MS_Help() -{ - cat << EOH >&2 -${helpheader}Makeself version 2.4.0 - 1) Getting help or info about $0 : - $0 --help Print this message - $0 --info Print embedded info : title, default target directory, embedded script ... - $0 --lsm Print embedded lsm entry (or no LSM) - $0 --list Print the list of files in the archive - $0 --check Checks integrity of the archive - - 2) Running $0 : - $0 [options] [--] [additional arguments to embedded script] - with following options (in that order) - --confirm Ask before running embedded script - --quiet Do not print anything except error messages - --accept Accept the license - --noexec Do not run embedded script - --keep Do not erase target directory after running - the embedded script - --noprogress Do not show the progress during the decompression - --nox11 Do not spawn an xterm - --nochown Do not give the extracted files to the current user - --nodiskspace Do not check for available disk space - --target dir Extract directly to a target directory (absolute or relative) - This directory may undergo recursive chown (see --nochown). - --tar arg1 [arg2 ...] Access the contents of the archive through the tar command - -- Following arguments will be passed to the embedded script -EOH -} - -MS_Check() -{ - OLD_PATH="$PATH" - PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"} - MD5_ARG="" - MD5_PATH=`exec <&- 2>&-; which md5sum || command -v md5sum || type md5sum` - test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which md5 || command -v md5 || type md5` - test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which digest || command -v digest || type digest` - PATH="$OLD_PATH" - - SHA_PATH=`exec <&- 2>&-; which shasum || command -v shasum || type shasum` - test -x "$SHA_PATH" || SHA_PATH=`exec <&- 2>&-; which sha256sum || command -v sha256sum || type sha256sum` - - if test x"$quiet" = xn; then - MS_Printf "Verifying archive integrity..." - fi - offset=`head -n 587 "$1" | wc -c | tr -d " "` - verb=$2 - i=1 - for s in $filesizes - do - crc=`echo $CRCsum | cut -d" " -f$i` - if test -x "$SHA_PATH"; then - if test x"`basename $SHA_PATH`" = xshasum; then - SHA_ARG="-a 256" - fi - sha=`echo $SHA | cut -d" " -f$i` - if test x"$sha" = x0000000000000000000000000000000000000000000000000000000000000000; then - test x"$verb" = xy && echo " $1 does not contain an embedded SHA256 checksum." >&2 - else - shasum=`MS_dd_Progress "$1" $offset $s | eval "$SHA_PATH $SHA_ARG" | cut -b-64`; - if test x"$shasum" != x"$sha"; then - echo "Error in SHA256 checksums: $shasum is different from $sha" >&2 - exit 2 - else - test x"$verb" = xy && MS_Printf " SHA256 checksums are OK." >&2 - fi - crc="0000000000"; - fi - fi - if test -x "$MD5_PATH"; then - if test x"`basename $MD5_PATH`" = xdigest; then - MD5_ARG="-a md5" - fi - md5=`echo $MD5 | cut -d" " -f$i` - if test x"$md5" = x00000000000000000000000000000000; then - test x"$verb" = xy && echo " $1 does not contain an embedded MD5 checksum." >&2 - else - md5sum=`MS_dd_Progress "$1" $offset $s | eval "$MD5_PATH $MD5_ARG" | cut -b-32`; - if test x"$md5sum" != x"$md5"; then - echo "Error in MD5 checksums: $md5sum is different from $md5" >&2 - exit 2 - else - test x"$verb" = xy && MS_Printf " MD5 checksums are OK." >&2 - fi - crc="0000000000"; verb=n - fi - fi - if test x"$crc" = x0000000000; then - test x"$verb" = xy && echo " $1 does not contain a CRC checksum." >&2 - else - sum1=`MS_dd_Progress "$1" $offset $s | CMD_ENV=xpg4 cksum | awk '{print $1}'` - if test x"$sum1" = x"$crc"; then - test x"$verb" = xy && MS_Printf " CRC checksums are OK." >&2 - else - echo "Error in checksums: $sum1 is different from $crc" >&2 - exit 2; - fi - fi - i=`expr $i + 1` - offset=`expr $offset + $s` - done - if test x"$quiet" = xn; then - echo " All good." - fi -} - -UnTAR() -{ - if test x"$quiet" = xn; then - tar $1vf - 2>&1 || { echo " ... Extraction failed." > /dev/tty; kill -15 $$; } - else - tar $1f - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 $$; } - fi -} - -finish=true -xterm_loop= -noprogress=n -nox11=n -copy=none -ownership=y -verbose=n - -initargs="$@" - -while true -do - case "$1" in - -h | --help) - MS_Help - exit 0 - ;; - -q | --quiet) - quiet=y - noprogress=y - shift - ;; - --accept) - accept=y - shift - ;; - --info) - echo Identification: "$label" - echo Target directory: "$targetdir" - echo Uncompressed size: 32 KB - echo Compression: gzip - echo Date of packaging: Tue Feb 16 19:34:19 AST 2021 - echo Built with Makeself version 2.4.0 on darwin18 - echo Build command was: "./makeself-2.4.0/makeself.sh \\ - \"./build\" \\ - \"kubernetes.recipe\" \\ - \"Starts a single-node kubernetes cluster\" \\ - \"kubernetes/run.sh\"" - if test x"$script" != x; then - echo Script run after extraction: - echo " " $script $scriptargs - fi - if test x"" = xcopy; then - echo "Archive will copy itself to a temporary location" - fi - if test x"n" = xy; then - echo "Root permissions required for extraction" - fi - if test x"n" = xy; then - echo "directory $targetdir is permanent" - else - echo "$targetdir will be removed after extraction" - fi - exit 0 - ;; - --dumpconf) - echo LABEL=\"$label\" - echo SCRIPT=\"$script\" - echo SCRIPTARGS=\"$scriptargs\" - echo archdirname=\"build\" - echo KEEP=n - echo NOOVERWRITE=n - echo COMPRESS=gzip - echo filesizes=\"$filesizes\" - echo CRCsum=\"$CRCsum\" - echo MD5sum=\"$MD5\" - echo OLDUSIZE=32 - echo OLDSKIP=588 - exit 0 - ;; - --lsm) -cat << EOLSM -No LSM. -EOLSM - exit 0 - ;; - --list) - echo Target directory: $targetdir - offset=`head -n 587 "$0" | wc -c | tr -d " "` - for s in $filesizes - do - MS_dd "$0" $offset $s | eval "gzip -cd" | UnTAR t - offset=`expr $offset + $s` - done - exit 0 - ;; - --tar) - offset=`head -n 587 "$0" | wc -c | tr -d " "` - arg1="$2" - if ! shift 2; then MS_Help; exit 1; fi - for s in $filesizes - do - MS_dd "$0" $offset $s | eval "gzip -cd" | tar "$arg1" - "$@" - offset=`expr $offset + $s` - done - exit 0 - ;; - --check) - MS_Check "$0" y - exit 0 - ;; - --confirm) - verbose=y - shift - ;; - --noexec) - script="" - shift - ;; - --keep) - keep=y - shift - ;; - --target) - keep=y - targetdir="${2:-.}" - if ! shift 2; then MS_Help; exit 1; fi - ;; - --noprogress) - noprogress=y - shift - ;; - --nox11) - nox11=y - shift - ;; - --nochown) - ownership=n - shift - ;; - --nodiskspace) - nodiskspace=y - shift - ;; - --xwin) - if test "n" = n; then - finish="echo Press Return to close this window...; read junk" - fi - xterm_loop=1 - shift - ;; - --phase2) - copy=phase2 - shift - ;; - --) - shift - break ;; - -*) - echo Unrecognized flag : "$1" >&2 - MS_Help - exit 1 - ;; - *) - break ;; - esac -done - -if test x"$quiet" = xy -a x"$verbose" = xy; then - echo Cannot be verbose and quiet at the same time. >&2 - exit 1 -fi - -if test x"n" = xy -a `id -u` -ne 0; then - echo "Administrative privileges required for this archive (use su or sudo)" >&2 - exit 1 -fi - -if test x"$copy" \!= xphase2; then - MS_PrintLicense -fi - -case "$copy" in -copy) - tmpdir="$TMPROOT"/makeself.$RANDOM.`date +"%y%m%d%H%M%S"`.$$ - mkdir "$tmpdir" || { - echo "Could not create temporary directory $tmpdir" >&2 - exit 1 - } - SCRIPT_COPY="$tmpdir/makeself" - echo "Copying to a temporary location..." >&2 - cp "$0" "$SCRIPT_COPY" - chmod +x "$SCRIPT_COPY" - cd "$TMPROOT" - exec "$SCRIPT_COPY" --phase2 -- $initargs - ;; -phase2) - finish="$finish ; rm -rf `dirname $0`" - ;; -esac - -if test x"$nox11" = xn; then - if tty -s; then # Do we have a terminal? - : - else - if test x"$DISPLAY" != x -a x"$xterm_loop" = x; then # No, but do we have X? - if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable - GUESS_XTERMS="xterm gnome-terminal rxvt dtterm eterm Eterm xfce4-terminal lxterminal kvt konsole aterm terminology" - for a in $GUESS_XTERMS; do - if type $a >/dev/null 2>&1; then - XTERM=$a - break - fi - done - chmod a+x $0 || echo Please add execution rights on $0 - if test `echo "$0" | cut -c1` = "/"; then # Spawn a terminal! - exec $XTERM -title "$label" -e "$0" --xwin "$initargs" - else - exec $XTERM -title "$label" -e "./$0" --xwin "$initargs" - fi - fi - fi - fi -fi - -if test x"$targetdir" = x.; then - tmpdir="." -else - if test x"$keep" = xy; then - if test x"$nooverwrite" = xy && test -d "$targetdir"; then - echo "Target directory $targetdir already exists, aborting." >&2 - exit 1 - fi - if test x"$quiet" = xn; then - echo "Creating directory $targetdir" >&2 - fi - tmpdir="$targetdir" - dashp="-p" - else - tmpdir="$TMPROOT/selfgz$$$RANDOM" - dashp="" - fi - mkdir $dashp "$tmpdir" || { - echo 'Cannot create target directory' $tmpdir >&2 - echo 'You should try option --target dir' >&2 - eval $finish - exit 1 - } -fi - -location="`pwd`" -if test x"$SETUP_NOCHECK" != x1; then - MS_Check "$0" -fi -offset=`head -n 587 "$0" | wc -c | tr -d " "` - -if test x"$verbose" = xy; then - MS_Printf "About to extract 32 KB in $tmpdir ... Proceed ? [Y/n] " - read yn - if test x"$yn" = xn; then - eval $finish; exit 1 - fi -fi - -if test x"$quiet" = xn; then - MS_Printf "Uncompressing $label" - - # Decrypting with openssl will ask for password, - # the prompt needs to start on new line - if test x"n" = xy; then - echo - fi -fi -res=3 -if test x"$keep" = xn; then - trap 'echo Signal caught, cleaning up >&2; cd $TMPROOT; /bin/rm -rf "$tmpdir"; eval $finish; exit 15' 1 2 3 15 -fi - -if test x"$nodiskspace" = xn; then - leftspace=`MS_diskspace "$tmpdir"` - if test -n "$leftspace"; then - if test "$leftspace" -lt 32; then - echo - echo "Not enough space left in "`dirname $tmpdir`" ($leftspace KB) to decompress $0 (32 KB)" >&2 - echo "Use --nodiskspace option to skip this check and proceed anyway" >&2 - if test x"$keep" = xn; then - echo "Consider setting TMPDIR to a directory with more free space." - fi - eval $finish; exit 1 - fi - fi -fi - -for s in $filesizes -do - if MS_dd_Progress "$0" $offset $s | eval "gzip -cd" | ( cd "$tmpdir"; umask $ORIG_UMASK ; UnTAR xp ) 1>/dev/null; then - if test x"$ownership" = xy; then - (cd "$tmpdir"; chown -R `id -u` .; chgrp -R `id -g` .) - fi - else - echo >&2 - echo "Unable to decompress $0" >&2 - eval $finish; exit 1 - fi - offset=`expr $offset + $s` -done -if test x"$quiet" = xn; then - echo -fi - -cd "$tmpdir" -res=0 -if test x"$script" != x; then - if test x"$export_conf" = x"y"; then - MS_BUNDLE="$0" - MS_LABEL="$label" - MS_SCRIPT="$script" - MS_SCRIPTARGS="$scriptargs" - MS_ARCHDIRNAME="$archdirname" - MS_KEEP="$KEEP" - MS_NOOVERWRITE="$NOOVERWRITE" - MS_COMPRESS="$COMPRESS" - export MS_BUNDLE MS_LABEL MS_SCRIPT MS_SCRIPTARGS - export MS_ARCHDIRNAME MS_KEEP MS_NOOVERWRITE MS_COMPRESS - fi - - if test x"$verbose" = x"y"; then - MS_Printf "OK to execute: $script $scriptargs $* ? [Y/n] " - read yn - if test x"$yn" = x -o x"$yn" = xy -o x"$yn" = xY; then - eval "\"$script\" $scriptargs \"\$@\""; res=$?; - fi - else - eval "\"$script\" $scriptargs \"\$@\""; res=$? - fi - if test "$res" -ne 0; then - test x"$verbose" = xy && echo "The program '$script' returned an error code ($res)" >&2 - fi -fi -if test x"$keep" = xn; then - cd "$TMPROOT" - /bin/rm -rf "$tmpdir" -fi -eval $finish; exit $res -{V,`=o8 -l}\i^Zm]dI+JI|wRߒ4MDXlgšjx9 i0Gt -#B4R.wR: o7 -cQ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'\g~YcK.W2W J뵩[mI5J֖>}ciϖEP6IAX AJ<3hJڕk:uI|)͌f7-U;rOЪcv ^?FBKUtjɺ(V{nqpIZmS$` - vS IhjI < ,izIs -— -c+;ns^fo,G`ClIlp9V+}2%BA<7 -EstK[ΗmHPQgu|'izP뇗癿R.{#7v|)!U5rjQ$Ay +ZyO_Y ,+}LFb> 'm"9 Ǫb="] QNE .NQCB`9 {!Ûc\Bv"k3z:*'#ո^3."H]B;aLpPWi r6*l۷~Lf k[RУq+<'w/8NXVVfOW":Ps5 :h*zeo4(Xz7hWC#*nџ_N .'`;9w@+W.> D $}F+@H\ɧ -cELc:v\T5q*7b9p!韜'7fu!$D)w&1>N(@Ɯ ߋ6m{]9!o%DWF#缎'`囲@zqc wM h_SV͠5@̸fZ˗yy^yy^y?g_x \ No newline at end of file From 591c4839a9fd3cb1cd7ac1ce6935e9dfd18bd212 Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Fri, 26 Mar 2021 16:58:08 -0400 Subject: [PATCH 4/9] Includes fixes that allow the K8s recipe to run on root and a new user --- kubernetes/package.json | 2 +- kubernetes/run.sh | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/kubernetes/package.json b/kubernetes/package.json index 9d91673..0640b35 100644 --- a/kubernetes/package.json +++ b/kubernetes/package.json @@ -4,7 +4,7 @@ "description": "Starts a single-node kubernetes cluster", "parameters": [ { - "name": "ADVERTISE_ADDRESSr", + "name": "ADVERTISE_ADDRESS", "index": "ADVERTISE_ADDRESS", "type": "string", "required": true diff --git a/kubernetes/run.sh b/kubernetes/run.sh index d7911c1..a48e7d5 100755 --- a/kubernetes/run.sh +++ b/kubernetes/run.sh @@ -3,8 +3,9 @@ source "utils/cachengo.sh" function do_install { -# cachengo-cli updateInstallStatus $APPID "Installing K8s" + cachengo-cli updateInstallStatus $APPID "Installing K8s" + sudo adduser kubernetes --disabled-password swapoff -a; sed -i '/swap/d' /etc/fstab sysctl -w net.ipv6.conf.all.forwarding=1 @@ -23,21 +24,22 @@ EOF #Initialization kubeadm init --apiserver-advertise-address=$ADVERTISE_ADDRESS - - - mkdir -p $HOME/.kube - cp -i /etc/kubernetes/admin.conf $HOME/.kube/config - kubectl apply -f kubernetes/calico.yaml + mkdir -p /home/kubernetes/.kube + cp -i /etc/kubernetes/admin.conf /home/kubernetes/.kube/config + chown -R kubernetes /home/kubernetes/.kube + chown kubernetes /home/kubernetes/.kube/config + + sudo -u kubernetes kubectl apply -f kubernetes/calico.yaml } function do_uninstall { cachengo-cli updateInstallStatus $APPID "Uninstalling" - kubeadm reset -f + #anadir eliminar usr kubernetes + kubeadm reset -f -y cachengo-cli updateInstallStatus $APPID "Uninstalled" } - case "$1" in install) do_install ;; uninstall) do_uninstall ;; From 104e0f152adf8c3bf73d0479c73b50b0d35b17ea Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Mon, 29 Mar 2021 13:05:15 -0400 Subject: [PATCH 5/9] Update app install indicator added, uninstall now deletes the kubernetes user --- kubernetes/run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kubernetes/run.sh b/kubernetes/run.sh index a48e7d5..97f1821 100755 --- a/kubernetes/run.sh +++ b/kubernetes/run.sh @@ -31,12 +31,15 @@ EOF chown kubernetes /home/kubernetes/.kube/config sudo -u kubernetes kubectl apply -f kubernetes/calico.yaml + + cachengo-cli updateInstallStatus $APPID "Installed" } function do_uninstall { cachengo-cli updateInstallStatus $APPID "Uninstalling" #anadir eliminar usr kubernetes kubeadm reset -f -y + sudo userdel -r kubernetes cachengo-cli updateInstallStatus $APPID "Uninstalled" } From 047a552ca14f7b2380b0b7498ea9a817acc99837 Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Mon, 29 Mar 2021 14:00:26 -0400 Subject: [PATCH 6/9] Uninstall improvements and removes logging of tokens and certs encryption key --- kubernetes/run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kubernetes/run.sh b/kubernetes/run.sh index 97f1821..7792318 100755 --- a/kubernetes/run.sh +++ b/kubernetes/run.sh @@ -3,7 +3,7 @@ source "utils/cachengo.sh" function do_install { - cachengo-cli updateInstallStatus $APPID "Installing K8s" + cachengo-cli updateInstallStatus $APPID "Installing" sudo adduser kubernetes --disabled-password swapoff -a; sed -i '/swap/d' /etc/fstab @@ -23,7 +23,7 @@ EOF apt update && apt install -y kubeadm=1.18.5-00 kubelet=1.18.5-00 kubectl=1.18.5-00 #Initialization - kubeadm init --apiserver-advertise-address=$ADVERTISE_ADDRESS + kubeadm init --apiserver-advertise-address=$ADVERTISE_ADDRES --skip-token-print --skip-certificate-key-print mkdir -p /home/kubernetes/.kube cp -i /etc/kubernetes/admin.conf /home/kubernetes/.kube/config @@ -37,8 +37,8 @@ EOF function do_uninstall { cachengo-cli updateInstallStatus $APPID "Uninstalling" - #anadir eliminar usr kubernetes - kubeadm reset -f -y + echo "Delete reached" + kubeadm reset -f sudo userdel -r kubernetes cachengo-cli updateInstallStatus $APPID "Uninstalled" } From 18c3b00c46e7151cbd52d2796bfdec9ae6bb328a Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Tue, 30 Mar 2021 07:50:54 -0400 Subject: [PATCH 7/9] Fixes a typo error on the cachengo declare secret func --- utils/cachengo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/cachengo.sh b/utils/cachengo.sh index 60be353..1889a0f 100644 --- a/utils/cachengo.sh +++ b/utils/cachengo.sh @@ -2,6 +2,6 @@ function update_status { cachengo-cli updateInstallStatus $APPID $1 } -funcion declare_secret { +function declare_secret { cachengo-cli declareSecret -i $APPID -n $1 -v $2 -} \ No newline at end of file +} From d84369bf0991b8dae84225f7a162fd24c0aa75d7 Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Tue, 30 Mar 2021 14:15:03 -0400 Subject: [PATCH 8/9] Adds support for installation on worker nodes --- kubernetes/package.json | 15 ++++++++++++++- kubernetes/run.sh | 33 +++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/kubernetes/package.json b/kubernetes/package.json index 0640b35..cf2b75a 100644 --- a/kubernetes/package.json +++ b/kubernetes/package.json @@ -8,12 +8,25 @@ "index": "ADVERTISE_ADDRESS", "type": "string", "required": true + }, + { + "name": "KUBERNETES_TKN", + "index": "KUBERNETES_TKN", + "type": "string", + "required": false + }, + { + "name": "KUBERNETES_CERT", + "index": "KUBERNETES_CERT", + "type": "string", + "required": false } ], "main": "kubernetes/run.sh", "dependencies": [ "kubernetes/run.sh", "utils/cachengo.sh", - "kubernetes/calico.yaml" + "kubernetes/calico.yaml", + "utils/cachengo.sh" ] } diff --git a/kubernetes/run.sh b/kubernetes/run.sh index 7792318..aa59741 100755 --- a/kubernetes/run.sh +++ b/kubernetes/run.sh @@ -22,27 +22,40 @@ EOF echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list apt update && apt install -y kubeadm=1.18.5-00 kubelet=1.18.5-00 kubectl=1.18.5-00 - #Initialization - kubeadm init --apiserver-advertise-address=$ADVERTISE_ADDRES --skip-token-print --skip-certificate-key-print - - mkdir -p /home/kubernetes/.kube - cp -i /etc/kubernetes/admin.conf /home/kubernetes/.kube/config - chown -R kubernetes /home/kubernetes/.kube - chown kubernetes /home/kubernetes/.kube/config + #Initialization happens conditionally depending if the machine is a master or a worker node + if [$KUBERNETES_TKN == '']; then + kubeadm init --apiserver-advertise-address=$ADVERTISE_ADDRESS --skip-token-print --skip-certificate-key-print + mkdir -p /home/kubernetes/.kube + cp -i /etc/kubernetes/admin.conf /home/kubernetes/.kube/config + chown -R kubernetes /home/kubernetes/.kube + chown kubernetes /home/kubernetes/.kube/config - sudo -u kubernetes kubectl apply -f kubernetes/calico.yaml + sudo -u kubernetes kubectl apply -f kubernetes/calico.yaml + + #Sets two env variables needed to provide the app secrets to the Cachengo portal. + KUBERNETES_TKN=$(sudo kubeadm token list | awk 'NR == 2 {print $1}') + KUBERNETES_CERT=$(openssl x509 -in /etc/kubernetes/pki/ca.crt -noout -pubkey | openssl rsa -pubin -outform DER 2>/dev/null | sha256sum | cut -d' ' -f1) + + declare_secret join-token "${KUBERNETES_TKN}" + declare_secret sha-ca-cert "${KUBERNETES_CERT}" + else + kubeadm join [$ADVERTISE_ADDRESS]:6443 --token $KUBERNETES_TKN --discovery-token-ca-cert-hash sha256:$KUBERNETES_CERT + fi - cachengo-cli updateInstallStatus $APPID "Installed" + cachengo-cli updateInstallStatus $APPID "Installed" } function do_uninstall { cachengo-cli updateInstallStatus $APPID "Uninstalling" - echo "Delete reached" kubeadm reset -f sudo userdel -r kubernetes cachengo-cli updateInstallStatus $APPID "Uninstalled" } +function declare_secret { + cachengo-cli declareSecret -i $APPID -n $1 -v $2 +} + case "$1" in install) do_install ;; uninstall) do_uninstall ;; From 84b7a8085b67369f0db60f3c30bdc1c29a6f1db2 Mon Sep 17 00:00:00 2001 From: Victor Nazario Date: Tue, 30 Mar 2021 19:22:00 -0400 Subject: [PATCH 9/9] Dependency fix and cleaner zero string comparison --- kubernetes/run.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kubernetes/run.sh b/kubernetes/run.sh index aa59741..e60176c 100755 --- a/kubernetes/run.sh +++ b/kubernetes/run.sh @@ -23,7 +23,7 @@ EOF apt update && apt install -y kubeadm=1.18.5-00 kubelet=1.18.5-00 kubectl=1.18.5-00 #Initialization happens conditionally depending if the machine is a master or a worker node - if [$KUBERNETES_TKN == '']; then + if [ ! "$KUBERNETES_TKN" ]; then kubeadm init --apiserver-advertise-address=$ADVERTISE_ADDRESS --skip-token-print --skip-certificate-key-print mkdir -p /home/kubernetes/.kube cp -i /etc/kubernetes/admin.conf /home/kubernetes/.kube/config @@ -52,10 +52,6 @@ function do_uninstall { cachengo-cli updateInstallStatus $APPID "Uninstalled" } -function declare_secret { - cachengo-cli declareSecret -i $APPID -n $1 -v $2 -} - case "$1" in install) do_install ;; uninstall) do_uninstall ;;