From c870db4bd2454beb34c70d10439bec46bdba124f Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Sun, 22 Apr 2018 23:50:20 -0500 Subject: [PATCH] closes #19 #26 #24 #21 #25 #22 (#29) Signed-off-by: Josh Cox woot! --- .travis.yml | 35 +- Makefile | 12 +- README.md | 15 +- bin/kubash | 448 ++++++++++++++++-- docs/ingress.md | 5 + examples/gke-cluster.yaml | 19 + pax/ubuntu1.8.11/http/preseed-hyperv.cfg | 38 ++ pax/ubuntu1.8.11/http/preseed.cfg | 35 ++ pax/ubuntu1.8.11/scripts/cleanup.sh | 68 +++ pax/ubuntu1.8.11/scripts/hyperv.sh | 14 + pax/ubuntu1.8.11/scripts/networking.sh | 22 + pax/ubuntu1.8.11/scripts/sudoers.sh | 7 + pax/ubuntu1.8.11/scripts/update.sh | 27 ++ pax/ubuntu1.8.11/scripts/vagrant.sh | 14 + pax/ubuntu1.8.11/scripts/vmware.sh | 8 + .../ubuntu1.8.11-16.04-amd64.json | 362 ++++++++++++++ submodules/kubespray | 2 +- submodules/openshift-ansible | 2 +- 18 files changed, 1074 insertions(+), 59 deletions(-) create mode 100755 examples/gke-cluster.yaml create mode 100755 pax/ubuntu1.8.11/http/preseed-hyperv.cfg create mode 100644 pax/ubuntu1.8.11/http/preseed.cfg create mode 100644 pax/ubuntu1.8.11/scripts/cleanup.sh create mode 100755 pax/ubuntu1.8.11/scripts/hyperv.sh create mode 100644 pax/ubuntu1.8.11/scripts/networking.sh create mode 100644 pax/ubuntu1.8.11/scripts/sudoers.sh create mode 100644 pax/ubuntu1.8.11/scripts/update.sh create mode 100644 pax/ubuntu1.8.11/scripts/vagrant.sh create mode 100644 pax/ubuntu1.8.11/scripts/vmware.sh create mode 100644 pax/ubuntu1.8.11/ubuntu1.8.11-16.04-amd64.json diff --git a/.travis.yml b/.travis.yml index b8ccc173..80fcbdee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ matrix: - MINIKUBE_DRIVER=none - HELM_INSTALL_DIR=$HOME/.local/bin - NVM_DIR="$HOME/.nvm" + - CHANGE_MINIKUBE_NONE_USER=true + - MINIKUBE_VERSION=v0.25.2 + - KUBE_VERSION=v1.9.4 language: node_js node_js: @@ -40,12 +43,23 @@ addons: before_install: # install nsenter which is required for port forwarding + +before_script: +# Download kubectl, which is a requirement for using minikube. +# Download minikube. +- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ +- curl -Lo minikube https://storage.googleapis.com/minikube/releases/$MINIKUBE_VERSION/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ +- sudo minikube start --vm-driver=none --kubernetes-version=$KUBE_VERSION +# Fix the kubectl context, as it's often stale. +- minikube update-context +# Wait for Kubernetes to be up and ready. +- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done + +script: - npm i -g yaml2json - ln -s $(pwd) /home/travis/.kubash - make bats - make ct - -script: - ls -alh /home/travis - ls -alh /home/travis/.kubash - ls -alh /home/travis/.kubash/bin @@ -53,22 +67,31 @@ script: - curl -sL --silent https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get|bash - bash scripts/dotfiles - bash scripts/chkdirs - - sudo chown -R $USER /usr/local - - sudo mkdir -p /etc/kubernetes - - sudo chown -R $USER /etc/kubernetes + - sudo chown $USER /var/lib - /bin/bash -l -c "/usr/bin/time -v make -e ci" - env - pwd - mkdir -p clusters/default - cp $HOME/.kube/config clusters/default/ + - /bin/bash -l -c "kubash tiller" - /bin/bash -l -c "kubash openebs" - /bin/bash -l -c "w8s/generic.w8 openebs-provisioner default" + - sleep 5 - bats .ci/.tests.bats - - /bin/bash -l -c "kubash demo" + #- /bin/bash -l -c "kubash demo" # too much memory usage so we will end it there and destroy the VM # as the next though successful take too long #- /bin/bash -l -c "kubash demo" #- /bin/bash -l -c "w8s/generic.w8 percona default" #- /bin/bash -l -c "w8s/generic.w8 pgset-0 default" #- /bin/bash -l -c "w8s/generic.w8 rabbitmq-0 default" + #- sudo chown -R $USER /usr/local + #- sudo ls -lh /usr/bin + #- sudo chown -R $USER /lib/systemd/system + #- sudo chown $USER /usr/bin + #- sudo mkdir -p /etc/kubernetes + #- sudo chown $USER /etc + #- sudo chown -R $USER /etc/kubernetes + #- sudo mkdir /etc/system.d + #- sudo chown -R $USER /etc/system.d #- /bin/bash -l -c "w8s/generic.w8 mongo-0 default" diff --git a/Makefile b/Makefile index 67c15d5e..012adef7 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ $(eval MONITORING_NAMESPACE := monitoring) $(eval MINIKUBE_CPU := 2) $(eval MINIKUBE_MEMORY := 3333) $(eval MINIKUBE_DRIVER := virtualbox) -$(eval MY_KUBE_VERSION := v1.8.0) +$(eval MY_KUBE_VERSION := v1.9.4) $(eval CHANGE_MINIKUBE_NONE_USER := true) $(eval KUBECONFIG := $(HOME)/.kube/config) $(eval MINIKUBE_WANTREPORTERRORPROMPT := false) @@ -227,8 +227,8 @@ $(KUBASH_BIN)/bats: && sudo ./install.sh /usr/local rm -Rf $(TMP) -ci: chown autopilot - +ci: chown reqs + ci-next: extended_tests monitoring chown: @@ -257,7 +257,8 @@ extended_tests: free -m .minikube.made: - minikube \ + sudo cp -v $(KUBASH_BIN)/minikube /usr/local/bin/ + sudo minikube \ --kubernetes-version $(MY_KUBE_VERSION) \ --dns-domain $(MINIKUBE_CLUSTER_DOMAIN) \ --memory $(MINIKUBE_MEMORY) \ @@ -353,6 +354,9 @@ $(KUBASH_BIN)/onessl: mv $(TMP)/onessl $(KUBASH_BIN)/ rm -Rf $(TMP) +gcloud: + curl https://sdk.cloud.google.com | bash + submodules/openebs: cd submodules; git clone https://github.com/openebs/openebs.git diff --git a/README.md b/README.md index 44686b36..35590c3f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Kubash -Build, provision, initialize, add common components, and tear down a cluster PDQ. +Build, provision, initialize, add common components, interact and tear down a cluster PDQ. [![Build Status](https://travis-ci.org/kubash/kubash.svg?branch=master)](https://travis-ci.org/kubash/kubash) [![Waffle.io - Columns and their card count](https://badge.waffle.io/kubash/kubash.svg?columns=all)](https://waffle.io/kubash/kubash) @@ -189,8 +189,7 @@ See the [debugging](./docs/debug.md) page for more ### [Interactive Mode](./docs/interactive.md) -`kubash` -- alone will invoke an interactive shell (or if you prefer -`kubash interactive`) +`kubash` -- alone will invoke an interactive shell see the [Interactive Mode](./docs/interactive.md) documentation @@ -215,3 +214,13 @@ This project takes advantage of [GNU Parallel](https://www.gnu.org/software/para ;login: The USENIX Magazine, February 2011:42-47. ``` + +### Pseudo-etymology + +"The whole kubash" - a bastardization of "The whole kit and kaboodle", +["The whole shebang" (#!)](https://www.phrases.org.uk/meanings/the-whole-shebang.html) +, kubernetes, and bash. The meaning here is that kubash is taking on +everything else that kubeadm considers 'out of scope'. From building +images, provisioning, to usage of kubeadm itself, on through to a quick +shell for interacting with the running cluster, and finally +decommissioning the cluster. diff --git a/bin/kubash b/bin/kubash index c8e5df4a..2040ace9 100755 --- a/bin/kubash +++ b/bin/kubash @@ -208,8 +208,9 @@ echo -n 'kubectl shorthand commands: # Drop into an interactive terminal on a container keti="kubectl exec -ti" # Pod management. - kgp="kubectl get pods" - kgpa="kubectl get pods --all-namespaces" + kgp="kubectl get pods| grep -v '^pvc-' " + kgpa="kubectl get pods --all-namespaces| grep -v '^pvc-' " + kgpvc="kubectl get pods | grep '^pvc-' " klp="kubectl logs pods" kep="kubectl edit pods" kdp="kubectl describe pods" @@ -230,6 +231,8 @@ echo -n 'kubectl shorthand commands: kdeld="kubectl delete deployment" ksd="kubectl scale deployment" krsd="kubectl rollout status deployment" + # voyager management. + kei="kubectl edit ingress.voyager.appscode.com " # Rollout management. kgrs="kubectl get rs" krh="kubectl rollout history" @@ -534,6 +537,179 @@ vbox-provisioner () { exit 1 } +gke_yaml2cluster () { + yaml2cluster_tmp=$(mktemp -d) + echo yaml2cluster + if [[ -z "$1" ]]; then + echo 'gke_yaml2cluster requires an argument' + exit 1 + fi + this_yaml=$1 + this_json=$yaml2cluster_tmp/this.json + yaml2json $this_yaml > $this_json + gke_json2cluster $this_json + rm $this_json + rm -Rf $yaml2cluster_tmp +} + +gke_json2cluster () { + json2cluster_tmp=$(mktemp -d) + if [[ -z "$1" ]]; then + echo 'json2cluster requires an argument' + exit 1 + fi + this_json=$1 + + # csv_version + # should be a string not an int! + jq -r '.csv_version | "\(.)" ' \ + $this_json > $json2cluster_tmp/csv_version + # kubernetes_version + # should be a string not an int! + jq -r '.kubernetes_version | "\(.)" ' \ + $this_json > $json2cluster_tmp/kubernetes_version + jq -r '.project | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_project=$(cat $json2cluster_tmp/this_tmp) + jq -r '.cluster_name | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_cluster_name=$(cat $json2cluster_tmp/this_tmp) + jq -r '.zone | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_zone=$(cat $json2cluster_tmp/this_tmp) + jq -r '.username | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_username=$(cat $json2cluster_tmp/this_tmp) + jq -r '.cluster_version | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_cluster_version=$(cat $json2cluster_tmp/this_tmp) + jq -r '.machine_type | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_machine_type=$(cat $json2cluster_tmp/this_tmp) + jq -r '.image_type | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_image_type=$(cat $json2cluster_tmp/this_tmp) + jq -r '.disk_size | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_disk_size=$(cat $json2cluster_tmp/this_tmp) + jq -r '.scopes | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_scopes=$(cat $json2cluster_tmp/this_tmp) + jq -r '.num_nodes | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_num_nodes=$(cat $json2cluster_tmp/this_tmp) + jq -r '.network | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_network=$(cat $json2cluster_tmp/this_tmp) + jq -r '.subnetwork | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_subnetwork=$(cat $json2cluster_tmp/this_tmp) + jq -r '.additional_opts | "\(.)" ' \ + $this_json > $json2cluster_tmp/this_tmp + gke_additional_opts=$(cat $json2cluster_tmp/this_tmp) + + echo 'Provisioning on GKE with these attributes' + + echo "gke_project=$gke_project +gke_cluster_name=$gke_cluster_name +gke_zone=$gke_zone +gke_username=$gke_username +gke_cluster_version=$gke_cluster_version +gke_machine_type=$gke_machine_type +gke_image_type=$gke_image_type +gke_disk_size=$gke_disk_size +gke_scopes=$gke_scopes +gke_num_nodes=$gke_num_nodes +gke_network=$gke_network +gke_subnetwork=$gke_subnetwork +gke_additional_opts=$gke_additional_opts +" + + echo -n 'Ctrl-C now to stop if this is not what you intend!' + echo -n '!'; sleep 1; echo -n '!'; sleep 1; echo -n '!'; sleep 1; echo '!'; sleep 1; + sleep 2 + + gke_gcloud_provision $gke_project $gke_cluster_name $gke_zone $gke_username $gke_cluster_version $gke_machine_type $gke_image_type $gke_disk_size $gke_scopes $gke_num_nodes $gke_network $gke_subnetwork "$gke_additional_opts" +} + +gke_gcloud_provision () { + gke_project=$1 + gke_cluster_name=$2 + gke_zone=$3 + gke_username=$4 + gke_cluster_version=$5 + gke_machine_type=$6 + gke_image_type=$7 + gke_disk_size=$8 + gke_scopes=$9 + gke_num_nodes=${10} + gke_network=${11} + gke_subnetwork=${12} + gke_additional_opts=${13} + + echo "gcloud beta container \ + --project '$gke_project' \ + clusters create '$gke_cluster_name' \ + --zone '$gke_zone' \ + --username '$gke_username' \ + --cluster-version '$gke_cluster_version' \ + --machine-type '$gke_machine_type' \ + --image-type '$gke_image_type' \ + --disk-size '$gke_disk_size' \ + --scopes $gke_scopes \ + --num-nodes '$gke_num_nodes' \ + --network '$gke_network' \ + --subnetwork '$gke_subnetwork' \ + $gke_additional_opts" + + gcloud beta container \ + --project "$gke_project" \ + clusters create "$gke_cluster_name" \ + --zone "$gke_zone" \ + --username "$gke_username" \ + --cluster-version "$gke_cluster_version" \ + --machine-type "$gke_machine_type" \ + --image-type "$gke_image_type" \ + --disk-size "$gke_disk_size" \ + --scopes $gke_scopes \ + --num-nodes "$gke_num_nodes" \ + --network "$gke_network" \ + --subnetwork "$gke_subnetwork" \ + $gke_additional_opts + + sleep 3 + + KUBECONFIG=$KUBECONFIG \ + gcloud container \ + clusters \ + --zone $gke_zone \ + get-credentials $gke_cluster_name + + KUBECONFIG=$KUBECONFIG \ + kubectl create clusterrolebinding cluster-admin-binding \ + --clusterrole cluster-admin \ + --user $(gcloud config get-value account) +} + +gke-provisioner () { + squawk 1 "gke-provisioner $@" + + if [[ -z "$1" ]]; then + echo 'gke-provisioner requires an argument' + exit 1 + fi + + if [[ "${1: -5}" == '.yaml' ]]; then + squawk 1 "gke_yaml2cluster $1" + gke_yaml2cluster $1 + elif [ "${1: -4}" = ".yml" ]; then + squawk 1 "gke_yaml2cluster $1" + gke_yaml2cluster $1 + elif [ "${1: -5}" = ".json" ]; then + squawk 1 "gke_json2cluster $1" + gke_json2cluster $1 + fi +} qemu-provisioner () { squawk 1 "qemu-provisioner $@" @@ -859,6 +1035,7 @@ configure_secondary_network_interfaces () { squawk 1 "OS not supported by network configurator" fi done <<< "$slurpy" + touch $configure_static_network_addresses_tmp/kubash_interface rm $configure_static_network_addresses_tmp/kubash_interface rmdir $configure_static_network_addresses_tmp squawk 19 'secondary network interfaces configured' @@ -1053,26 +1230,75 @@ apparmor_fix_all_provisioning_hosts () { do_nginx_ingress () { INGRESS_NAME=$1 - KUBECONFIG=$KUBECONFIG helm install stable/nginx-ingress --name $INGRESS_NAME --set rbac.create=true + KUBECONFIG=$KUBECONFIG \ + helm install \ + stable/nginx-ingress \ + --name $INGRESS_NAME \ + --set rbac.create=true } demo () { - cd $KUBASH_DIR/submodules/openebs/k8s/demo/crunchy-postgres - KUBECONFIG=$KUBECONFIG bash run.sh - cd $KUBASH_DIR/submodules/openebs/k8s/demo/rabbitmq - KUBECONFIG=$KUBECONFIG bash run.sh - cd $KUBASH_DIR/submodules/openebs/k8s/demo/percona - kubectl --kubeconfig=$KUBECONFIG apply -f \ - demo-percona-mysql-pvc.yaml - cd $KUBASH_DIR/submodules/openebs/k8s/demo/jupyter - kubectl --kubeconfig=$KUBECONFIG apply -f \ - demo-jupyter-openebs.yaml - cd $KUBASH_DIR/submodules/openebs/k8s/demo/mongodb - kubectl --kubeconfig=$KUBECONFIG apply -f \ - mongo-statefulset.yml - cd $KUBASH_DIR/submodules/openebs/k8s/demo/jenkins - kubectl --kubeconfig=$KUBECONFIG apply -f \ - jenkins.yml + do_postgres + do_rabbitmq + do_percona + do_jupyter + do_mongodb + do_jenkins + do_kafka + do_redis +} + +do_redis () { + cd $KUBASH_DIR/submodules/openebs/k8s/demo/redis + kubectl --kubeconfig=$KUBECONFIG apply -f \ + redis-statefulset.yml +} + +do_postgres () { + cd $KUBASH_DIR/submodules/openebs/k8s/demo/crunchy-postgres + KUBECONFIG=$KUBECONFIG bash run.sh +} + +do_rabbitmq () { + cd $KUBASH_DIR/submodules/openebs/k8s/demo/rabbitmq + KUBECONFIG=$KUBECONFIG bash run.sh +} + +do_percona () { + cd $KUBASH_DIR/submodules/openebs/k8s/demo/percona + kubectl --kubeconfig=$KUBECONFIG apply -f \ + demo-percona-mysql-pvc.yaml +} + +do_jupyter () { + cd $KUBASH_DIR/submodules/openebs/k8s/demo/jupyter + kubectl --kubeconfig=$KUBECONFIG apply -f \ + demo-jupyter-openebs.yaml +} + +do_mongodb () { + cd $KUBASH_DIR/submodules/openebs/k8s/demo/mongodb + kubectl --kubeconfig=$KUBECONFIG apply -f \ + mongo-statefulset.yml +} + +do_jenkins () { + cd $KUBASH_DIR/submodules/openebs/k8s/demo/jenkins + kubectl --kubeconfig=$KUBECONFIG apply -f \ + jenkins.yml +} + +do_kafka () { + squawk 1 " do_kafka" + KUBECONFIG=$KUBECONFIG \ + helm \ + repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator + + KUBECONFIG=$KUBECONFIG \ + helm install \ + --name my-kafka \ + incubator/kafka \ + --set persistence.storageClass=openebs-kafka } do_net () { @@ -1094,23 +1320,38 @@ do_searchlight () { $KUBASH_DIR/templates/searchlight.yaml } +taint_ingress () { + squawk 1 " taint_ingress $@" + for ingress_node in "$@" + do + squawk 5 "kubectl --kubeconfig=$KUBECONFIG taint --overwrite node $ingress_node IngressOnly=true:NoSchedule" + kubectl --kubeconfig=$KUBECONFIG taint --overwrite node $ingress_node IngressOnly=true:NoSchedule + squawk 5 "kubectl --kubeconfig=$KUBECONFIG label --overwrite node $ingress_node ingress=true" + kubectl --kubeconfig=$KUBECONFIG label --overwrite node $ingress_node ingress=true + done +} + +do_dashboard () { + squawk 1 " do_dashboard" + kubectl --kubeconfig=$KUBECONFIG \ + apply -f \ + https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml +} + do_voyager () { squawk 1 " do_voyager" if [ "$VOYAGER_BY_HELM" = "true" ]; then + KUBECONFIG=$KUBECONFIG \ helm install stable/voyager --name voyager \ --set cloudProvider=$VOYAGER_PROVIDER \ --set apiserver.ca="$(onessl get kube-ca)" \ $VOYAGER_ADMISSIONWEBHOOK else - KUBECONFIG=$KUBECONFIG \ - curl -fsSL \ + KUBECONFIG=$KUBECONFIG \ + curl -fsSL \ https://raw.githubusercontent.com/appscode/voyager/6.0.0/hack/deploy/voyager.sh \ - | bash -s -- --provider=$VOYAGER_PROVIDER + | bash -s -- --provider=$VOYAGER_PROVIDER --rbac fi - # lets encrypt - KUBECONFIG=$KUBECONFIG \ - curl -fsSL https://raw.githubusercontent.com/appscode/voyager/6.0.0/hack/deploy/voyager.sh \ - | bash -s -- --provider=$VOYAGER_PROVIDER --rbac } do_linkerd () { @@ -1148,7 +1389,8 @@ do_tiller () { #kubectl --kubeconfig=$KUBECONFIG create serviceaccount tiller --namespace kube-system kubectl --kubeconfig=$KUBECONFIG create -f $KUBASH_DIR/tiller/rbac-tiller-config.yaml sleep 5 - KUBECONFIG=$KUBECONFIG helm init --service-account tiller + KUBECONFIG=$KUBECONFIG \ + helm init --service-account tiller } write_ansible_hosts () { @@ -1547,8 +1789,8 @@ remove_vagrant_user () { if [[ "$K8S_os" == 'coreos' ]]; then squawk 9 'coreos so skipping' else - REMMY="userdel -f vagrant && rm -Rf /home/vagrant" - squawk 5 "ssh -n -p $K8S_sshPort $K8S_user@$K8S_ip1 \"$REMMY\"" + REMMY="userdel -fr vagrant" + squawk 6 "ssh -n -p $K8S_sshPort $K8S_user@$K8S_ip1 \"$REMMY\"" echo "ssh -n -p $K8S_sshPort $K8S_user@$K8S_ip1 \"$REMMY\""\ >> $remove_vagrant_user_tmp_para/hopper fi @@ -1557,11 +1799,15 @@ remove_vagrant_user () { if [[ "$VERBOSITY" -gt "9" ]] ; then cat $remove_vagrant_user_tmp_para/hopper fi + + set +e #some of the new builds have been erroring out as vagrant has been removed already, softening if [[ "$PARALLEL_JOBS" -gt "1" ]] ; then $PARALLEL -j $PARALLEL_JOBS -- < $remove_vagrant_user_tmp_para/hopper else bash $remove_vagrant_user_tmp_para/hopper fi + set -e # End softening + rm -Rf $remove_vagrant_user_tmp_para } @@ -2963,7 +3209,24 @@ packer_build () { activate_monitoring () { # Prometheus - KUBECONFIG=$KUBECONFIG helm install stable/prometheus + cd $KUBASH_DIR/submodules/openebs/k8s/openebs-monitoring/configs + kubectl --kubeconfig=$KUBECONFIG create -f \ + prometheus-config.yaml + kubectl --kubeconfig=$KUBECONFIG create -f \ + prometheus-env.yaml + kubectl --kubeconfig=$KUBECONFIG create -f \ + prometheus-alert-rules.yaml + kubectl --kubeconfig=$KUBECONFIG create -f \ + alertmanager-templates.yaml + kubectl --kubeconfig=$KUBECONFIG create -f \ + alertmanager-config.yaml + cd $KUBASH_DIR/submodules/openebs/k8s/openebs-monitoring + kubectl --kubeconfig=$KUBECONFIG create -f \ + prometheus-operator.yaml + kubectl --kubeconfig=$KUBECONFIG create -f \ + alertmanager.yaml + kubectl --kubeconfig=$KUBECONFIG create -f \ + grafana-operator.yaml } build_all_in_parallel () { @@ -3138,9 +3401,10 @@ kubash_interactive () { l|list) helm_passthru list ;; d|describe) kubectl_passthru describe $args ;; keti) kubectl_passthru exec -ti $args ;; - kgn) kubectl_passthru get nodes $args ;; - kgpa) kubectl_passthru get pods --all-namespaces $args ;; - kgp) kubectl_passthru get pods $args ;; + kgn) kubectl_passthru get nodes $args ;; + kgpa) kubectl_passthru get pods --all-namespaces $args | grep -v '^pvc-' ;; + kgp) kubectl_passthru get pods $args | grep -v '^pvc-' ;; + kgpvc) kubectl_passthru get pods $args | grep '^pvc-' ;; klp) kubectl_passthru logs pods $args ;; kep) kubectl_passthru logs pods $args ;; kdp) kubectl_passthru describe pods $args ;; @@ -3154,6 +3418,7 @@ kubash_interactive () { kdelsec) kubectl_passthru delete secret $args ;; kgd) kubectl_passthru get deployment $args ;; ked) kubectl_passthru edit deployment $args ;; + kei) kubectl_passthru edit ingress.voyager.appscode.com $args ;; kdd) kubectl_passthru describe deployment $args ;; kdeld) kubectl_passthru delete deployment $args ;; ksd) kubectl_passthru scale deployment $args ;; @@ -3224,7 +3489,7 @@ main () { # Execute getopt on the arguments passed to this program, identified by the special character $@ short_opts="c:hvyn:" - long_opts="version,oidc,clustername:,initializer:,csv:,help,yes,verbose,verbosity:,target-os:,target-build:,build-virt:,node-join-name:,node-join-user:,node-join-ip:,node-join-port:,node-join-role:,parallel:,builder:,debug" + long_opts="version,oidc,clustername:,initializer:,csv:,help,yes,verbose,verbosity:,target-os:,target-build:,build-virt:,node-join-name:,node-join-user:,node-join-ip:,node-join-port:,node-join-role:,parallel:,builder:,debug,provisioner:" PARSED_OPTIONS=$(getopt -n "$0" -o "$short_opts" --long "$long_opts" -- "$@") #Bad arguments, something has gone wrong with the getopt command. @@ -3265,6 +3530,9 @@ main () { KUBASH_HOSTS_CSV="$2" RAISON=true shift 2 ;; + --provisioner) + provisioner="$2" + shift 2 ;; --initializer) initializer="$2" shift 2 ;; @@ -3362,16 +3630,22 @@ main () { -n $KUBASH_CLUSTER_NAME kubash ping \ -n $KUBASH_CLUSTER_NAME + kubash configure_interfaces \ + -n $KUBASH_CLUSTER_NAME kubash init \ -n $KUBASH_CLUSTER_NAME sleep 10 kubash openebs \ -n $KUBASH_CLUSTER_NAME sleep 10 - kubash tiller \ + kubash dashboard \ + -n $KUBASH_CLUSTER_NAME + kubash voyager \ + -n $KUBASH_CLUSTER_NAME + kubash searchlight \ -n $KUBASH_CLUSTER_NAME sleep 10 - kubash ingress \ + kubash tiller \ -n $KUBASH_CLUSTER_NAME squawk 1 "Full auto finished" exit 0 @@ -3482,14 +3756,18 @@ main () { provision_usage exit 1 fi - copy_image_to_all_provisioning_hosts - provisioner - squawk 1 "wating on hosts to come up" - sleep 33 - refresh_network_addresses - prep - remove_vagrant_user - hostname_in_parallel + if [ "$provisioner" = 'gke' ]; then + gke-provisioner $@ + else + copy_image_to_all_provisioning_hosts + provisioner + squawk 1 "wating on hosts to come up" + sleep 33 + refresh_network_addresses + prep + remove_vagrant_user + hostname_in_parallel + fi elif [[ $RAISON == "hostnamer" ]]; then if [[ $print_help == "true" ]]; then horizontal_rule @@ -3605,6 +3883,76 @@ main () { exit 1 fi do_searchlight + elif [[ $RAISON == "taint_ingress" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + taint_ingress $@ + elif [[ $RAISON == "dashboard" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_dashboard + elif [[ $RAISON == "kafka" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_kafka + elif [[ $RAISON == "redis" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_redis + elif [[ $RAISON == "postgres" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_postgres + elif [[ $RAISON == "rabbitmq" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_rabbitmq + elif [[ $RAISON == "percona" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_percona + elif [[ $RAISON == "jupyter" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_jupyter + elif [[ $RAISON == "mongodb" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_mongodb + elif [[ $RAISON == "jenkins" ]]; then + if [[ $print_help == "true" ]]; then + horizontal_rule + usage + exit 1 + fi + do_jenkins elif [[ $RAISON == "voyager" ]]; then if [[ $print_help == "true" ]]; then horizontal_rule @@ -3768,6 +4116,18 @@ main () { if [[ -z "$target_build" ]]; then target_build=ubuntu197-16.04-amd64 fi + elif [[ "$target_os" == "ubuntu1.8.10" ]]; then + if [[ -z "$target_build" ]]; then + target_build=ubuntu1.8.10-16.04-amd64 + fi + elif [[ "$target_os" == "ubuntu1.8.11" ]]; then + if [[ -z "$target_build" ]]; then + target_build=ubuntu1.8.11-16.04-amd64 + fi + elif [[ "$target_os" == "ubuntu1.10.0" ]]; then + if [[ -z "$target_build" ]]; then + target_build=ubuntu1.10.0-16.04-amd64 + fi elif [[ "$target_os" == "coreos" ]]; then #override packer atm builder=coreos diff --git a/docs/ingress.md b/docs/ingress.md index 5531c6f3..f6759610 100644 --- a/docs/ingress.md +++ b/docs/ingress.md @@ -14,3 +14,8 @@ for testing #### [linkerd](https://linkerd.io) `kubash linkerd` + +#### taint_ingress node1 [node2] [node3].... + +This preps a node with an 'ingress=true' label it as ingress, and also prevents normal +scheduling on the node. diff --git a/examples/gke-cluster.yaml b/examples/gke-cluster.yaml new file mode 100755 index 00000000..70e3a18d --- /dev/null +++ b/examples/gke-cluster.yaml @@ -0,0 +1,19 @@ +--- + provisioner: gke + csv_version: '2.0.0' + kubernetes_version: 'v1.9.6' + cluster_version: "1.9.6-gke.0" + project: "example" + cluster_name: "cluster-1" + zone: "us-central1-a" + username: "admin" + machine_type: "custom-1-1280" + image_type: "UBUNTU" + disk_size: "50" + scopes: '"https://www.googleapis.com/auth/compute","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append"' + num_nodes: "3" + network: "default" + subnetwork: "default" + additional_opts: '--enable-cloud-logging --enable-cloud-monitoring' + # These additional three options are COS only and do not work for the UBUNTU image-type + # additional_opts: '--enable-cloud-logging --enable-cloud-monitoring --enable-legacy-authorization --enable-autoupgrade --enable-autorepair' diff --git a/pax/ubuntu1.8.11/http/preseed-hyperv.cfg b/pax/ubuntu1.8.11/http/preseed-hyperv.cfg new file mode 100755 index 00000000..0422b5b9 --- /dev/null +++ b/pax/ubuntu1.8.11/http/preseed-hyperv.cfg @@ -0,0 +1,38 @@ +choose-mirror-bin mirror/http/proxy string +d-i base-installer/kernel/override-image string linux-server +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i finish-install/reboot_in_progress note +d-i grub-installer/only_debian boolean true +d-i grub-installer/with_other_os boolean true +d-i mirror/country string manual +d-i mirror/http/directory string /ubuntu/ +d-i mirror/http/hostname string archive.ubuntu.com +d-i mirror/http/proxy string +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true +d-i partman-partitioning/no_bootable_gpt_biosgrub boolean false +d-i partman-partitioning/no_bootable_gpt_efi boolean false +d-i partman-efi/non_efi_system boolean true +d-i passwd/user-fullname string vagrant +d-i passwd/user-uid string 1000 +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +d-i passwd/username string vagrant +d-i pkgsel/include string openssh-server ntp linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) linux-cloud-tools-common +d-i pkgsel/install-language-support boolean false +d-i pkgsel/update-policy select none +d-i pkgsel/upgrade select full-upgrade +d-i time/zone string UTC +d-i user-setup/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false +tasksel tasksel/first multiselect standard, server diff --git a/pax/ubuntu1.8.11/http/preseed.cfg b/pax/ubuntu1.8.11/http/preseed.cfg new file mode 100644 index 00000000..7b4a3235 --- /dev/null +++ b/pax/ubuntu1.8.11/http/preseed.cfg @@ -0,0 +1,35 @@ +choose-mirror-bin mirror/http/proxy string +d-i base-installer/kernel/override-image string linux-server +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i finish-install/reboot_in_progress note +d-i grub-installer/only_debian boolean true +d-i grub-installer/with_other_os boolean true +d-i mirror/country string manual +d-i mirror/http/directory string /ubuntu/ +d-i mirror/http/hostname string archive.ubuntu.com +d-i mirror/http/proxy string +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true +d-i passwd/user-fullname string vagrant +d-i passwd/user-uid string 1000 +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +d-i passwd/username string vagrant +d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common linux-headers-$(uname -r) perl +d-i pkgsel/install-language-support boolean false +d-i pkgsel/update-policy select none +d-i pkgsel/upgrade select full-upgrade +d-i time/zone string UTC +d-i user-setup/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false +tasksel tasksel/first multiselect standard, server diff --git a/pax/ubuntu1.8.11/scripts/cleanup.sh b/pax/ubuntu1.8.11/scripts/cleanup.sh new file mode 100644 index 00000000..99781543 --- /dev/null +++ b/pax/ubuntu1.8.11/scripts/cleanup.sh @@ -0,0 +1,68 @@ +#!/bin/sh -eux + +# Delete all Linux headers +dpkg --list \ + | awk '{ print $2 }' \ + | grep 'linux-headers' \ + | xargs apt-get -y purge; + +# Remove specific Linux kernels, such as linux-image-3.11.0-15-generic but +# keeps the current kernel and does not touch the virtual packages, +# e.g. 'linux-image-generic', etc. +dpkg --list \ + | awk '{ print $2 }' \ + | grep 'linux-image-.*-generic' \ + | grep -v `uname -r` \ + | xargs apt-get -y purge; + +# Delete Linux source +dpkg --list \ + | awk '{ print $2 }' \ + | grep linux-source \ + | xargs apt-get -y purge; + +# Delete development packages +dpkg --list \ + | awk '{ print $2 }' \ + | grep -- '-dev$' \ + | xargs apt-get -y purge; + +# delete docs packages +dpkg --list \ + | awk '{ print $2 }' \ + | grep -- '-doc$' \ + | xargs apt-get -y purge; + +# Delete X11 libraries +apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6; + +# Delete obsolete networking +apt-get -y purge ppp pppconfig pppoeconf; + +# Delete oddities +apt-get -y purge popularity-contest installation-report command-not-found command-not-found-data friendly-recovery bash-completion fonts-ubuntu-font-family-console laptop-detect; + +# Exlude the files we don't need w/o uninstalling linux-firmware +echo "==> Setup dpkg excludes for linux-firmware" +cat <<_EOF_ | cat >> /etc/dpkg/dpkg.cfg.d/excludes +#BENTO-BEGIN +path-exclude=/lib/firmware/* +path-exclude=/usr/share/doc/linux-firmware/* +#BENTO-END +_EOF_ + +# Delete the massive firmware packages +rm -rf /lib/firmware/* +rm -rf /usr/share/doc/linux-firmware/* + +apt-get -y autoremove; +apt-get -y clean; + +# Remove docs +rm -rf /usr/share/doc/* + +# Remove caches +find /var/cache -type f -exec rm -rf {} \; + +# delete any logs that have built up during the install +find /var/log/ -name *.log -exec rm -f {} \; diff --git a/pax/ubuntu1.8.11/scripts/hyperv.sh b/pax/ubuntu1.8.11/scripts/hyperv.sh new file mode 100755 index 00000000..76e5a38a --- /dev/null +++ b/pax/ubuntu1.8.11/scripts/hyperv.sh @@ -0,0 +1,14 @@ +#!/bin/sh -eux +ubuntu_version="`lsb_release -r | awk '{print $2}'`"; +major_version="`echo $ubuntu_version | awk -F. '{print $1}'`"; + +case "$PACKER_BUILDER_TYPE" in +hyperv-iso) + if [ "$major_version" -eq "14" ]; then + apt-get install -y hv-kvp-daemon-init linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial; + elif [ "$major_version" -eq "16" ]; then + apt-get install -y linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial; + elif [ "$major_version" -eq "17" ]; then + apt-get -y install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual; + fi +esac diff --git a/pax/ubuntu1.8.11/scripts/networking.sh b/pax/ubuntu1.8.11/scripts/networking.sh new file mode 100644 index 00000000..4293923f --- /dev/null +++ b/pax/ubuntu1.8.11/scripts/networking.sh @@ -0,0 +1,22 @@ +#!/bin/sh -eux +ubuntu_version="`lsb_release -r | awk '{print $2}'`"; + +if [ "$ubuntu_version" = '17.10' ]; then +echo "Create netplan config for eth0" +cat </etc/netplan/01-netcfg.yaml; +network: + version: 2 + ethernets: + eth0: + dhcp4: true +EOF +else + # Set up eth0 for pre-17.10 + echo "auto eth0\niface eth0 inet dhcp" >> /etc/network/interfaces.d/eth0.cfg + # Adding a 2 sec delay to the interface up, to make the dhclient happy + echo "pre-up sleep 2" >>/etc/network/interfaces; +fi + +# Seriously though eth0 +sed -ie 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub +update-grub diff --git a/pax/ubuntu1.8.11/scripts/sudoers.sh b/pax/ubuntu1.8.11/scripts/sudoers.sh new file mode 100644 index 00000000..e56537fe --- /dev/null +++ b/pax/ubuntu1.8.11/scripts/sudoers.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers; + +# Set up password-less sudo for the vagrant user +echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/99_vagrant; +chmod 440 /etc/sudoers.d/99_vagrant; diff --git a/pax/ubuntu1.8.11/scripts/update.sh b/pax/ubuntu1.8.11/scripts/update.sh new file mode 100644 index 00000000..9e872b68 --- /dev/null +++ b/pax/ubuntu1.8.11/scripts/update.sh @@ -0,0 +1,27 @@ +#!/bin/sh -eux +export DEBIAN_FRONTEND=noninteractive + +ubuntu_version="`lsb_release -r | awk '{print $2}'`"; +ubuntu_major_version="`echo $ubuntu_version | awk -F. '{print $1}'`"; + +# Disable release-upgrades +sed -i.bak 's/^Prompt=.*$/Prompt=never/' /etc/update-manager/release-upgrades; + +# Update the package list +apt-get -y update; + +# update package index on boot +cat </etc/init/refresh-apt.conf; +description "update package index" +start on networking +task +exec /usr/bin/apt-get update +EOF + +# Disable periodic activities of apt +cat </etc/apt/apt.conf.d/10disable-periodic; +APT::Periodic::Enable "0"; +EOF + +# Upgrade all installed packages incl. kernel and kernel headers +apt-get -y dist-upgrade -o Dpkg::Options::="--force-confnew"; diff --git a/pax/ubuntu1.8.11/scripts/vagrant.sh b/pax/ubuntu1.8.11/scripts/vagrant.sh new file mode 100644 index 00000000..bd4b3ec2 --- /dev/null +++ b/pax/ubuntu1.8.11/scripts/vagrant.sh @@ -0,0 +1,14 @@ +#!/bin/bash -eux + +pubkey_url="https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub"; +mkdir -p $HOME_DIR/.ssh; +if command -v wget >/dev/null 2>&1; then + wget --no-check-certificate "$pubkey_url" -O $HOME_DIR/.ssh/authorized_keys; +elif command -v curl >/dev/null 2>&1; then + curl --insecure --location "$pubkey_url" > $HOME_DIR/.ssh/authorized_keys; +else + echo "Cannot download vagrant public key"; + exit 1; +fi +chown -R vagrant $HOME_DIR/.ssh; +chmod -R go-rwsx $HOME_DIR/.ssh; diff --git a/pax/ubuntu1.8.11/scripts/vmware.sh b/pax/ubuntu1.8.11/scripts/vmware.sh new file mode 100644 index 00000000..fed59131 --- /dev/null +++ b/pax/ubuntu1.8.11/scripts/vmware.sh @@ -0,0 +1,8 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in +vmware-iso|vmware-vmx) + apt-get install -y open-vm-tools; + mkdir /mnt/hgfs; + echo "platform specific vmware.sh executed"; +esac diff --git a/pax/ubuntu1.8.11/ubuntu1.8.11-16.04-amd64.json b/pax/ubuntu1.8.11/ubuntu1.8.11-16.04-amd64.json new file mode 100644 index 00000000..601bdfe5 --- /dev/null +++ b/pax/ubuntu1.8.11/ubuntu1.8.11-16.04-amd64.json @@ -0,0 +1,362 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/sda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", + "guest_os_type": "Ubuntu_64", + "hard_drive_interface": "sata", + "headless": "{{ user `headless` }}", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "../builds/packer-{{user `template`}}-virtualbox", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "type": "virtualbox-iso", + "vboxmanage": [ + [ + "modifyvm", + "{{.Name}}", + "--memory", + "{{ user `memory` }}" + ], + [ + "modifyvm", + "{{.Name}}", + "--cpus", + "{{ user `cpus` }}" + ] + ], + "virtualbox_version_file": ".vbox_version", + "vm_name": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/sda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "guest_os_type": "ubuntu-64", + "headless": "{{ user `headless` }}", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "../builds/packer-{{user `template`}}-vmware", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "tools_upload_flavor": "linux", + "type": "vmware-iso", + "vm_name": "{{ user `template` }}", + "vmx_data": { + "cpuid.coresPerSocket": "1", + "ethernet0.pciSlotNumber": "32", + "memsize": "{{ user `memory` }}", + "numvcpus": "{{ user `cpus` }}" + }, + "vmx_remove_ethernet_interfaces": true + }, + { + "boot_command": [ + "", + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/sda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "guest_os_type": "ubuntu", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "../builds/packer-{{user `template`}}-parallels", + "parallels_tools_flavor": "lin", + "prlctl": [ + [ + "set", + "{{.Name}}", + "--memsize", + "{{ user `memory` }}" + ], + [ + "set", + "{{.Name}}", + "--cpus", + "{{ user `cpus` }}" + ] + ], + "prlctl_version_file": ".prlctl_version", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "ssh_wait_timeout": "10000s", + "type": "parallels-iso", + "vm_name": "{{ user `template` }}" + }, + { + "boot_command": [ + "", + "", + "", + "", + "/install/vmlinuz", + " auto", + " console-setup/ask_detect=false", + " console-setup/layoutcode=us", + " console-setup/modelcode=pc105", + " debconf/frontend=noninteractive", + " debian-installer=en_US.UTF-8", + " fb=false", + " initrd=/install/initrd.gz", + " kbd-chooser/method=us", + " keyboard-configuration/layout=USA", + " keyboard-configuration/variant=USA", + " locale=en_US.UTF-8", + " netcfg/get_domain=vm", + " netcfg/get_hostname=vagrant", + " grub-installer/bootdev=/dev/vda", + " noapic", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": "{{user `disk_size`}}", + "headless": "{{ user `headless` }}", + "format": "qcow2", + "accelerator": "kvm", + "disk_interface": "virtio", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "../builds/packer-{{user `template`}}-qemu", + "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_username": "vagrant", + "net_device": "virtio-net", + "ssh_wait_timeout": "10000s", + "net_device": "virtio-net", + "type": "qemu", + "vm_name": "{{ user `template` }}", + "qemuargs": [ + [ + "-m", + "{{ user `memory` }}M" + ], + [ + "-smp", + "{{ user `cpus` }}" + ] + ] + }, + { + "boot_command": [ + "", + "set gfxpayload=1024x768", + "linux /install/vmlinuz ", + "preseed/url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed-hyperv.cfg ", + "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", + "hostname={{.Name}} ", + "fb=false debconf/frontend=noninteractive ", + "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", + "keyboard-configuration/variant=USA console-setup/ask_detect=false ", + "initrd /install/initrd.gz", + "boot" + ], + "boot_wait": "10s", + "communicator": "ssh", + "cpu": "{{ user `cpus` }}", + "disk_size": "{{user `disk_size`}}", + "enable_secure_boot": false, + "generation": "{{user `hyperv_generation`}}", + "http_directory": "http", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "output_directory": "../builds/packer-{{user `template`}}-hyperv", + "ram_size": "{{user `memory`}}", + "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_timeout": "10000s", + "ssh_username": "vagrant", + "switch_name": "{{user `hyperv_switch`}}", + "type": "hyperv-iso", + "vm_name": "{{ user `template` }}" + } + ], + "post-processors": [ + { + "output": "../builds/{{user `box_basename`}}.{{.Provider}}.box", + "except": ["qemu"], + "type": "vagrant" + } + ], + "provisioners": [ + { + "environment_vars": [ + "HOME_DIR=/home/vagrant", + "http_proxy={{user `http_proxy`}}", + "https_proxy={{user `https_proxy`}}", + "KUBEADM_INSTALL={{ user `kubeadm_install`}}", + "DOCKER_PKG={{ user `DOCKER_PKG`}}", + "DOCKER_COMPOSE_PKG={{ user `DOCKER_COMPOSE_PKG`}}", + "KUBEPKG_VERSION={{ user `KUBEPKG_VERSION`}}", + "ETCD_VERSION={{ user `ETCD_VERSION`}}", + "no_proxy={{user `no_proxy`}}" + ], + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'", + "expect_disconnect": true, + "scripts": [ + "scripts/update.sh", + "../_common/sshd.sh", + "scripts/networking.sh", + "scripts/sudoers.sh", + "scripts/vagrant.sh", + "../_common/virtualbox.sh", + "scripts/vmware.sh", + "../_common/parallels.sh", + "scripts/hyperv.sh", + "../packstrap", + "scripts/cleanup.sh", + "../_common/minimize.sh" + ], + "type": "shell" + }, + { + "environment_vars": [ + "HOME_DIR=/home/vagrant", + "KEYS_TO_ADD={{user `keys_to_add`}}", + "KEYS_URL={{user `keys_url`}}", + "http_proxy={{user `http_proxy`}}", + "https_proxy={{user `https_proxy`}}", + "KUBASH_SET_ROOT_PW={{user `root_password_to_set`}}", + "KUBASH_SET_SU_PW={{user `su_password_to_set`}}", + "K8S_SU_USER={{user `k8s_su_user`}}", + "no_proxy={{user `no_proxy`}}" + ], + "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'", + "expect_disconnect": true, + "scripts": [ + "../keyer", + "../kubashgrouper", + "../removeswap" + ], + "type": "shell" + } + ], + "variables": { + "box_basename": "ubuntu1.8.11-16.04", + "build_timestamp": "{{isotime \"20060102150405\"}}", + "keys_to_add": "{{ env `KEYS_TO_ADD`}}", + "keys_url": "{{ env `KEYS_URL`}}", + "root_password_to_set": "{{ env `KUBASH_SET_ROOT_PW`}}", + "su_password_to_set": "{{ env `KUBASH_SET_SU_PW`}}", + "kubeadm_install": "kubeadm", + "k8s_su_user": "{{ env `K8S_SU_USER`}}", + "DOCKER_PKG": "17.03", + "DOCKER_COMPOSE_PKG": "1.8.0", + "KUBEPKG_VERSION": "1.8.11", + "ETCD_VERSION": "3.2.7", + "cpus": "1", + "disk_size": "65536", + "git_revision": "__unknown_git_revision__", + "headless": "true", + "http_proxy": "{{env `http_proxy`}}", + "https_proxy": "{{env `https_proxy`}}", + "hyperv_generation": "2", + "hyperv_switch": "{{env `hyperv_switch`}}", + "iso_checksum": "a06cd926f5855d4f21fb4bc9978a35312f815fbda0d0ef7fdc846861f4fc4600", + "iso_checksum_type": "sha256", + "iso_name": "ubuntu-16.04.3-server-amd64.iso", + "memory": "1024", + "mirror": "http://releases.ubuntu.com", + "mirror_directory": "16.04.3", + "name": "ubuntu1.8.11-16.04", + "no_proxy": "{{env `no_proxy`}}", + "preseed_path": "preseed.cfg", + "template": "ubuntu1.8.11-16.04-amd64", + "version": "TIMESTAMP" + } +} diff --git a/submodules/kubespray b/submodules/kubespray index deac627d..cac2196a 160000 --- a/submodules/kubespray +++ b/submodules/kubespray @@ -1 +1 @@ -Subproject commit deac627dc79e87c7cf7af2fbacc866162322acf1 +Subproject commit cac2196ad5bee6e8df6597f9821e7d14363b3cdb diff --git a/submodules/openshift-ansible b/submodules/openshift-ansible index 108513c5..062a77c8 160000 --- a/submodules/openshift-ansible +++ b/submodules/openshift-ansible @@ -1 +1 @@ -Subproject commit 108513c5cd1450768f43c959e5e57b47a02bccf9 +Subproject commit 062a77c8a0d05fc614549af594e387c8424c574c