mirror of
https://github.com/clearlinux/cloud-native-setup.git
synced 2026-08-18 21:16:16 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e985ffd6e0 | |||
| 7840d720b0 | |||
| 43fa8bad8f | |||
| da6087762a | |||
| 5b03651467 | |||
| 598289573b | |||
| 6972963363 | |||
| d271a73fe3 | |||
| 674ab84d0d | |||
| 3984a18b18 | |||
| 02880b82ee | |||
| 88b899d7e3 | |||
| 2ae8360760 | |||
| aa86c554e8 | |||
| ad2fc108d3 | |||
| 4edbaebf87 | |||
| e7b7d33be0 |
@@ -0,0 +1,4 @@
|
||||
resources:
|
||||
- canal/canal.yaml
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
resources:
|
||||
cilium/cilium.yaml
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
resources:
|
||||
- flannel/Documentation/kube-flannel.yml
|
||||
@@ -4,3 +4,8 @@ resources:
|
||||
- packaging/kata-deploy/k8s-1.14/kata-fc-runtimeClass.yaml
|
||||
- packaging/kata-deploy/k8s-1.14/kata-qemu-runtimeClass.yaml
|
||||
|
||||
images:
|
||||
# change 'latest' to specified version
|
||||
- name: katadocker/kata-deploy
|
||||
newName: katadocker/kata-deploy
|
||||
newTag: 1.8.2
|
||||
@@ -13,8 +13,8 @@ Follow instructions in the [Vagrant docs](https://www.vagrantup.com/intro/gettin
|
||||
|
||||
Or, follow our [detailed steps](vagrant.md)
|
||||
|
||||
Now you have a 3 node cluster up and running. Each of them have 2 vCPU, 4GB Memory, 2x10GB disks, 1 additional private network.
|
||||
Customize the setup using environment variables. E.g., `NODES=1 MEMORY=8192 CPUS=8 vagrant up --provider=libvirt`
|
||||
Now you have a 3 node cluster up and running. Each of them have 4 vCPU, 8GB Memory, 2x10GB disks, 1 additional private network.
|
||||
Customize the setup using environment variables. E.g., `NODES=2 MEMORY=16384 CPUS=8 vagrant up --provider=libvirt`
|
||||
|
||||
To login to the master node and change to this directory
|
||||
|
||||
@@ -38,6 +38,11 @@ This script ensures the following
|
||||
script uses the runtime specified in the `RUNNER` environment variable and defaults to `crio`. To use the
|
||||
`containerd` runtime, set the `RUNNER` environment variable to `containerd`.
|
||||
|
||||
### Specify a version of Clear Linux
|
||||
|
||||
To specify a particular version of Clear Linux to use, set the CLRK8S_CLR_VER environment variable to the desired
|
||||
version before starting setup_system.sh (e.g. `CLRK8S_CLR_VER=31400 ./setup_system.sh`)
|
||||
|
||||
### Configuration for high numbers of pods per node
|
||||
|
||||
In order to enable running greater than 110 pods per node, set the environment
|
||||
@@ -65,6 +70,11 @@ you need to setup other cluster wide properties.
|
||||
There are different flavors to install, run `./create_stack.sh help` to get
|
||||
more information.
|
||||
|
||||
> NOTE: Before running [`create_stack.sh`](create_stack.sh) script, make sure to export
|
||||
the necessary environment variables if needed to be changed. By default it will use
|
||||
`CLRK8S_CNI` to be canal, and `CLRK8S_RUNNER` to be crio. Cilium is tested only in the
|
||||
Vagrant.
|
||||
|
||||
```bash
|
||||
# default shows help
|
||||
./create_stack.sh <subcommand>
|
||||
|
||||
Vendored
+4
-3
@@ -6,8 +6,8 @@ require 'ipaddr'
|
||||
require 'securerandom'
|
||||
|
||||
$num_instances = (ENV['NODES'] || 3).to_i
|
||||
$cpus = (ENV['CPUS'] || 2).to_i
|
||||
$memory = (ENV['MEMORY'] || 4096).to_i
|
||||
$cpus = (ENV['CPUS'] || 4).to_i
|
||||
$memory = (ENV['MEMORY'] || 8192).to_i
|
||||
$disks = 2
|
||||
# Using folder prefix instead of uuid until vagrant-libvirt fixes disk cleanup
|
||||
$disk_prefix = File.basename(File.dirname(__FILE__), "/")
|
||||
@@ -23,6 +23,7 @@ $driveletters = ('a'..'z').to_a
|
||||
$setup_fc = true ? (['true', '1'].include? ENV['SETUP_FC'].to_s) : false
|
||||
$runner = ENV.has_key?('RUNNER') ? ENV['RUNNER'].to_s : "crio".to_s
|
||||
$high_pod_count = ENV.has_key?('HIGH_POD_COUNT') ? ENV['HIGH_POD_COUNT'].to_s : ""
|
||||
$CLRK8S_CLR_VER = ENV.has_key?('CLRK8S_CLR_VER') ? ENV['CLRK8S_CLR_VER'].to_s : ""
|
||||
if !(["crio","containerd"].include? $runner)
|
||||
abort("it's either crio or containerd. Cannot do anything else")
|
||||
end
|
||||
@@ -97,7 +98,7 @@ Vagrant.configure("2") do |config|
|
||||
c.vm.provider :virtualbox do |_, override|
|
||||
override.vm.provision "shell", privileged: true, inline: "sudo mkdir -p /etc/profile.d; echo export MASTER_IP=#{$hosts["clr-01"]} > /etc/profile.d/cnsetup.sh"
|
||||
end
|
||||
c.vm.provision "shell", privileged: false, path: "setup_system.sh", env: {"RUNNER" => $runner, "HIGH_POD_COUNT" => $high_pod_count}
|
||||
c.vm.provision "shell", privileged: false, path: "setup_system.sh", env: {"RUNNER" => $runner, "HIGH_POD_COUNT" => $high_pod_count, "CLRK8S_CLR_VER" => $CLRK8S_CLR_VER}
|
||||
if $setup_fc
|
||||
if $runner == "crio".to_s
|
||||
c.vm.provision "shell", privileged: false, path: "setup_kata_firecracker.sh"
|
||||
|
||||
@@ -12,14 +12,26 @@ CUR_DIR=$(pwd)
|
||||
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
|
||||
: ${TOKEN:=}
|
||||
: ${MASTER_IP:=}
|
||||
: ${CERT_SANS:=}
|
||||
HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
|
||||
|
||||
# versions
|
||||
CANAL_VER="${CLRK8S_CANAL_VER:-v3.9}"
|
||||
CANAL_VER="${CLRK8S_CANAL_VER:-v3.10}"
|
||||
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.6}"
|
||||
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-16b0fe66285d1ad1f42b154ab852682f6fafb1a7}"
|
||||
K8S_VER="${CLRK8S_K8S_VER:-}"
|
||||
KATA_VER="${CLRK8S_KATA_VER:-1.8.2-kernel-config}"
|
||||
ROOK_VER="${CLRK8S_ROOK_VER:-v1.1.1}"
|
||||
METRICS_VER="${CLRK8S_METRICS_VER:-v0.3.5}"
|
||||
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.0.0-beta2}"
|
||||
INGRES_VER="${CLRK8S_INGRES_VER:-nginx-0.25.1}"
|
||||
EFK_VER="${CLRK8S_EFK_VER:-v1.15.1}"
|
||||
METALLB_VER="${CLRK8S_METALLB_VER:-v0.8.1}"
|
||||
NPD_VER="${CLRK8S_NPD_VER:-v0.6.6}"
|
||||
PROMETHEUS_VER="${CLRK8S_PROMETHEUS_VER:-f458e85e5d7675f7bc253072e1b4c8892b51af0f}"
|
||||
CNI=${CLRK8S_CNI:-"canal"}
|
||||
RUNNER=${CLRK8S_RUNNER:-"crio"}
|
||||
NFD_VER="${CLRK8S_NFD_VER:-v0.4.0}"
|
||||
|
||||
function print_usage_exit() {
|
||||
exit_code=${1:-0}
|
||||
@@ -45,17 +57,30 @@ trap finish EXIT
|
||||
function cluster_init() {
|
||||
# Config replacements
|
||||
if ! [ -z ${TOKEN} ]; then
|
||||
sed -i "/InitConfiguration/a bootstrapTokens:\\n- token: ${TOKEN}" ./kubeadm/base/kubeadm.yaml
|
||||
sed -i "/InitConfiguration/a bootstrapTokens:\\n- token: ${TOKEN}" ./kubeadm.yaml
|
||||
fi
|
||||
if ! [ -z ${MASTER_IP} ]; then
|
||||
sed -i "/InitConfiguration/a localAPIEndpoint:\\n advertiseAddress: ${MASTER_IP}" ./kubeadm/base/kubeadm.yaml
|
||||
sed -i "/InitConfiguration/a localAPIEndpoint:\\n advertiseAddress: ${MASTER_IP}" ./kubeadm.yaml
|
||||
fi
|
||||
if [[ -n "$K8S_VER" && $(grep -c kubernetesVersion ./kubeadm/base/kubeadm.yaml) -eq 0 ]]; then
|
||||
sed -i "s/ClusterConfiguration/ClusterConfiguration\nkubernetesVersion: ${K8S_VER}/g" ./kubeadm/base/kubeadm.yaml
|
||||
if [[ -n "$K8S_VER" && $(grep -c kubernetesVersion ./kubeadm.yaml) -eq 0 ]]; then
|
||||
sed -i "s/ClusterConfiguration/ClusterConfiguration\nkubernetesVersion: ${K8S_VER}/g" ./kubeadm.yaml
|
||||
fi
|
||||
if [[ -n "$CERT_SANS" ]]; then
|
||||
if [[ $(grep -c certSANs ./kubeadm.yaml) -gt 0 ]]; then
|
||||
sed -i '/certSANs/,/[a-zA-Z]*:/{//!d}' ./kubeadm.yaml
|
||||
else
|
||||
sed -i "/ClusterConfiguration/a apiServer:\\n certSANs:" ./kubeadm.yaml
|
||||
fi
|
||||
for CERT_SAN in ${CERT_SANS[@]}; do
|
||||
sed -i "/certSANs/a \ \ - ${CERT_SAN}" ./kubeadm.yaml
|
||||
done
|
||||
fi
|
||||
# Config patches
|
||||
if [[ -n "${HIGH_POD_COUNT}" ]]; then
|
||||
echo "$(kubectl kustomize ./kubeadm/high-pod-count/)" > ./kubeadm/base/kubeadm.yaml
|
||||
# increase limits in kubelet
|
||||
sed -i "/KubeletConfiguration/a maxOpenFiles\: 1048576" ./kubeadm.yaml
|
||||
sed -i "/KubeletConfiguration/a maxPods\: 5000" ./kubeadm.yaml
|
||||
# increase the address range per node
|
||||
sed -i "/ClusterConfiguration/a controllerManager:\\n extraArgs:\\n node-cidr-mask-size: \"20\"" ./kubeadm.yaml
|
||||
fi
|
||||
#This only works with kubernetes 1.12+. The kubeadm.yaml is setup
|
||||
#to enable the RuntimeClass featuregate
|
||||
@@ -63,7 +88,7 @@ function cluster_init() {
|
||||
echo "/var/lib/etcd exists! skipping init."
|
||||
return
|
||||
fi
|
||||
sudo -E kubeadm init --config=./kubeadm/base/kubeadm.yaml
|
||||
sudo -E kubeadm init --config=./kubeadm.yaml
|
||||
|
||||
rm -rf "${HOME}/.kube"
|
||||
mkdir -p "${HOME}/.kube"
|
||||
@@ -86,7 +111,7 @@ function cluster_init() {
|
||||
}
|
||||
|
||||
function kata() {
|
||||
KATA_VER=${1:-1.8.2-kernel-config}
|
||||
KATA_VER=${1:-$KATA_VER}
|
||||
KATA_URL="https://github.com/kata-containers/packaging.git"
|
||||
KATA_DIR="8-kata"
|
||||
get_repo "${KATA_URL}" "${KATA_DIR}/overlays/${KATA_VER}"
|
||||
@@ -96,23 +121,48 @@ function kata() {
|
||||
}
|
||||
|
||||
function cni() {
|
||||
# note version is not semver
|
||||
CANAL_VER=${1:-$CANAL_VER}
|
||||
CANAL_URL="https://docs.projectcalico.org/${CANAL_VER}/manifests"
|
||||
if [[ "$CANAL_VER" == "v3.3" ]]; then
|
||||
CANAL_URL="https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal"
|
||||
fi
|
||||
CANAL_DIR="0-canal"
|
||||
case "$CNI" in
|
||||
canal)
|
||||
# note version is not semver
|
||||
CANAL_VER=${1:-$CANAL_VER}
|
||||
CANAL_URL="https://docs.projectcalico.org/${CANAL_VER}/manifests"
|
||||
if [[ "$CANAL_VER" == "v3.3" ]]; then
|
||||
CANAL_URL="https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal"
|
||||
fi
|
||||
CANAL_DIR="0-canal"
|
||||
|
||||
# canal manifests are not kept in repo but in docs site so use curl
|
||||
mkdir -p "${CANAL_DIR}/overlays/${CANAL_VER}/canal"
|
||||
curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/canal.yaml" "$CANAL_URL/canal.yaml"
|
||||
if [[ "$CANAL_VER" == "v3.3" ]]; then
|
||||
curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/rbac.yaml" "$CANAL_URL/rbac.yaml"
|
||||
fi
|
||||
# canal doesnt pass kustomize validation
|
||||
kubectl apply -k "${CANAL_DIR}/overlays/${CANAL_VER}" --validate=false
|
||||
# canal manifests are not kept in repo but in docs site so use curl
|
||||
mkdir -p "${CANAL_DIR}/overlays/${CANAL_VER}/canal"
|
||||
curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/canal.yaml" "$CANAL_URL/canal.yaml"
|
||||
if [[ "$CANAL_VER" == "v3.3" ]]; then
|
||||
curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/rbac.yaml" "$CANAL_URL/rbac.yaml"
|
||||
fi
|
||||
# canal doesnt pass kustomize validation
|
||||
kubectl apply -k "${CANAL_DIR}/overlays/${CANAL_VER}" --validate=false
|
||||
;;
|
||||
flannel)
|
||||
FLANNEL_VER=${1:-$FLANNEL_VER}
|
||||
FLANNEL_URL="https://github.com/coreos/flannel"
|
||||
FLANNEL_DIR="0-flannel"
|
||||
|
||||
get_repo "${FLANNEL_URL}" "${FLANNEL_DIR}/overlays/${FLANNEL_VER}"
|
||||
set_repo_version "${FLANNEL_VER}" "${FLANNEL_DIR}/overlays/${FLANNEL_VER}/flannel"
|
||||
kubectl apply -k "${FLANNEL_DIR}/overlays/${FLANNEL_VER}"
|
||||
;;
|
||||
cilium)
|
||||
CILIUM_VER=${1:-$CILIUM_VER}
|
||||
CILIUM_URL="https://github.com/cilium/cilium.git"
|
||||
CILIUM_DIR="0-cilium"
|
||||
|
||||
get_repo "${CILIUM_URL}" "${CILIUM_DIR}/overlays/${CILIUM_VER}"
|
||||
set_repo_version "${CILIUM_VER}" "${CILIUM_DIR}/overlays/${CILIUM_VER}/cilium/"
|
||||
helm template "${CILIUM_DIR}/overlays/${CILIUM_VER}/cilium/install/kubernetes/cilium" --namespace kube-system --set global.containerRuntime.integration="$RUNNER" | kubectl apply -f -
|
||||
;;
|
||||
*)
|
||||
echo"Unknown cni $CNI"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function metrics() {
|
||||
@@ -194,7 +244,7 @@ function monitoring() {
|
||||
}
|
||||
|
||||
function dashboard() {
|
||||
DASHBOARD_VER=${1:-v2.0.0-beta2}
|
||||
DASHBOARD_VER=${1:-$DASHBOARD_VER}
|
||||
DASHBOARD_URL="https://github.com/kubernetes/dashboard.git"
|
||||
DASHBOARD_DIR="2-dashboard"
|
||||
get_repo "${DASHBOARD_URL}" "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}"
|
||||
@@ -203,7 +253,7 @@ function dashboard() {
|
||||
}
|
||||
|
||||
function ingres() {
|
||||
INGRES_VER=${1:-nginx-0.25.1}
|
||||
INGRES_VER=${1:-$INGRES_VER}
|
||||
INGRES_URL="https://github.com/kubernetes/ingress-nginx.git"
|
||||
INGRES_DIR="5-ingres-lb"
|
||||
get_repo "${INGRES_URL}" "${INGRES_DIR}/overlays/${INGRES_VER}"
|
||||
@@ -212,7 +262,7 @@ function ingres() {
|
||||
}
|
||||
|
||||
function efk() {
|
||||
EFK_VER=${1:-v1.15.1}
|
||||
EFK_VER=${1:-$EFK_VER}
|
||||
EFK_URL="https://github.com/kubernetes/kubernetes.git"
|
||||
EFK_DIR="3-efk"
|
||||
get_repo "${EFK_URL}" "${EFK_DIR}/overlays/${EFK_VER}"
|
||||
@@ -222,7 +272,7 @@ function efk() {
|
||||
}
|
||||
|
||||
function metallb() {
|
||||
METALLB_VER=${1:-v0.8.1}
|
||||
METALLB_VER=${1:-$METALLB_VER}
|
||||
METALLB_URL="https://github.com/danderson/metallb.git"
|
||||
METALLB_DIR="6-metal-lb"
|
||||
get_repo "${METALLB_URL}" "${METALLB_DIR}/overlays/${METALLB_VER}"
|
||||
@@ -230,9 +280,8 @@ function metallb() {
|
||||
kubectl apply -k "${METALLB_DIR}/overlays/${METALLB_VER}"
|
||||
|
||||
}
|
||||
|
||||
function npd() {
|
||||
NPD_VER=${1:-v0.6.6}
|
||||
NPD_VER=${1:-$NPD_VER}
|
||||
NPD_URL="https://github.com/kubernetes/node-problem-detector.git"
|
||||
NPD_DIR="node-problem-detector"
|
||||
get_repo "${NPD_URL}" "${NPD_DIR}/overlays/${NPD_VER}"
|
||||
@@ -240,6 +289,16 @@ function npd() {
|
||||
kubectl apply -k "${NPD_DIR}/overlays/${NPD_VER}"
|
||||
}
|
||||
|
||||
# node feature discovery
|
||||
function nfd() {
|
||||
NFD_VER=${1:-$NFD_VER}
|
||||
NFD_URL="https://github.com/kubernetes-sigs/node-feature-discovery.git"
|
||||
NFD_DIR="node-feature-discovery"
|
||||
get_repo "${NFD_URL}" "${NFD_DIR}/overlays/${NFD_VER}"
|
||||
set_repo_version "${NFD_VER}" "${NFD_DIR}/overlays/${NFD_VER}/node-feature-discovery"
|
||||
kubectl apply -k "${NFD_DIR}/overlays/${NFD_VER}"
|
||||
}
|
||||
|
||||
function miscellaneous() {
|
||||
|
||||
# dashboard
|
||||
@@ -287,7 +346,7 @@ function set_repo_version() {
|
||||
pushd "$(pwd)"
|
||||
cd "${path}"
|
||||
git fetch origin "${ver}"
|
||||
git checkout "${ver}"
|
||||
git -c advice.detachedHead=false checkout "${ver}"
|
||||
popd
|
||||
|
||||
}
|
||||
@@ -306,6 +365,7 @@ command_handlers[storage]=storage
|
||||
command_handlers[monitoring]=monitoring
|
||||
command_handlers[metallb]=metallb
|
||||
command_handlers[npd]=npd
|
||||
command_handlers[nfd]=nfd
|
||||
|
||||
declare -A command_help
|
||||
command_help[init]="Only inits a cluster using kubeadm"
|
||||
@@ -313,6 +373,7 @@ command_help[cni]="Setup network for running cluster"
|
||||
command_help[minimal]="init + cni + kata + metrics"
|
||||
command_help[all]="minimal + storage + monitoring + miscellaneous"
|
||||
command_help[help]="show this message"
|
||||
command_help[nfd]="node feature discovery"
|
||||
|
||||
cd "${SCRIPT_DIR}"
|
||||
|
||||
|
||||
Executable
+166
@@ -0,0 +1,166 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
###
|
||||
# update_checker.sh
|
||||
# Parses create_stack.sh for urls and versions
|
||||
# Curls urls for latest version and reports the comparison
|
||||
##
|
||||
|
||||
# first argument is path to create_stach.sh
|
||||
COMPONENT_FILE="${1:-$create_stack.sh}"
|
||||
# set CLRK8S_DEBUG=1 for debug output
|
||||
DEBUG=${CLRK8S_DEBUG:-0}
|
||||
# set CLRK8S_NO_COLOR=1 for no colors
|
||||
NO_COLOR=${CLRK8S_NO_COLOR:-""}
|
||||
# set CLRK8S_ALL=1 for all results, not just changed
|
||||
ALL=${CLRK8S_ALL:-""}
|
||||
# add components to skip (not check)
|
||||
# - canal doesn't use git repo tags for revisions
|
||||
declare -a COMPONENT_SKIP=( CANAL )
|
||||
|
||||
# internal vars
|
||||
declare -A COMPONENT_VER
|
||||
declare -A COMPONENT_URL
|
||||
LATEST_URL=""
|
||||
|
||||
# usage prints help and exit
|
||||
function usage(){
|
||||
echo "Compare default component versions to latest release"
|
||||
echo "usage: update_checker.sh <path to create_stack.sh>"
|
||||
exit 0
|
||||
}
|
||||
# log echoes to stdout
|
||||
function log(){
|
||||
echo "$1"
|
||||
}
|
||||
# debug echoes to stdout if debug is enabled
|
||||
function debug(){
|
||||
if [[ "${DEBUG}" -ne 0 ]]; then
|
||||
echo "$1"
|
||||
fi
|
||||
}
|
||||
# extract_component_data scans file for component versions and urls and add them to maps
|
||||
function extract_component_data(){
|
||||
file=${1:-$COMPONENT_FILE}
|
||||
name=""
|
||||
version=""
|
||||
url=""
|
||||
while read -r line
|
||||
do
|
||||
# versions
|
||||
if [[ $line =~ "_VER=" ]]; then
|
||||
debug "Found component version $line"
|
||||
name=${line%%_*}
|
||||
if [[ "$COMPONENT_SKIP" =~ (^|[[:space:]])"$name"($|[[:space:]]) ]]; then
|
||||
debug "Skipping component $name"
|
||||
continue
|
||||
fi
|
||||
versions=${line#*=}
|
||||
if [[ $versions =~ ":-" ]]; then
|
||||
version=${line#*:-}
|
||||
fi
|
||||
# cleanup value
|
||||
version=${version%\}}
|
||||
version=${version%\}\"}
|
||||
if [[ -n "$name" && ${COMPONENT_VER[$name]} == "" ]]; then
|
||||
debug "Adding component $name=$version to COMPONENT_VER"
|
||||
COMPONENT_VER[$name]=$version
|
||||
fi
|
||||
fi
|
||||
|
||||
# urls
|
||||
if [[ $line =~ "_URL=" ]]; then
|
||||
debug "Found component URL $line"
|
||||
name=${line%%_*}
|
||||
if [[ $COMPONENT_SKIP =~ (^|[[:space:]])"$name"($|[[:space:]]) ]]; then
|
||||
debug "Skipping component $name"
|
||||
continue
|
||||
fi
|
||||
urls=${line#*=}
|
||||
|
||||
if [[ $urls =~ ":-" ]]; then
|
||||
urls=${line#*:-}
|
||||
fi
|
||||
# cleanup value
|
||||
url=${urls%\"}
|
||||
url=${url#\"}
|
||||
if [[ -n "$name" && ${COMPONENT_URL[$name]} == "" ]]; then
|
||||
debug "Adding component $name=$url to COMPONENT_URL"
|
||||
COMPONENT_URL[$name]=$url
|
||||
fi
|
||||
fi
|
||||
|
||||
done < $file
|
||||
|
||||
}
|
||||
# resolve_latest_url extracts the real release/latest url from a repo url
|
||||
function resolve_latest_url(){
|
||||
repo=$1
|
||||
url=${repo%.git*}/releases/latest
|
||||
LATEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $url)
|
||||
if [[ "$?" -gt 0 ]]; then
|
||||
echo "curl error, exiting."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
# function_exists checks if a function exists
|
||||
function function_exists() {
|
||||
declare -f -F "$1" > /dev/null
|
||||
return $?
|
||||
}
|
||||
function report(){
|
||||
if [[ -z $NO_COLOR ]]; then
|
||||
BOLD="\e[1m\e[33m"
|
||||
BOLD_OFF="\e[0m"
|
||||
fi
|
||||
mode="changed"
|
||||
out=""
|
||||
if [[ -n "$1" ]]; then
|
||||
mode="all"
|
||||
fi
|
||||
out+="\n"
|
||||
out+="Components ($mode)\n"
|
||||
out+="--------------------------\n"
|
||||
echo -e $out
|
||||
out="NAME CURRENT LATEST\n"
|
||||
# loop thru each url, get latest version and report
|
||||
for k in "${!COMPONENT_URL[@]}";
|
||||
do
|
||||
name=$k
|
||||
resolve_latest_url "${COMPONENT_URL[$k]}"
|
||||
latest_url="$LATEST_URL"
|
||||
latest_ver="${latest_url#*tag/}"
|
||||
current_ver="${COMPONENT_VER[$name]}"
|
||||
if [[ "${current_ver}" != "${latest_ver}" ]]; then
|
||||
out+="$name $current_ver $BOLD $latest_ver $BOLD_OFF\n";
|
||||
fi
|
||||
if [[ "${current_ver}" == "${latest_ver}" && -n $ALL ]]; then
|
||||
out+="$name $current_ver $latest_ver\n";
|
||||
fi
|
||||
done;
|
||||
echo -e "${out}" | column -t
|
||||
if [[ "${#COMPONENT_SKIP[@]}" -gt 0 ]]; then
|
||||
echo "---"
|
||||
echo "WARNING: Skipped comparisions for the following components:"
|
||||
for s in "${!COMPONENT_SKIP[@]}"
|
||||
do
|
||||
echo "${COMPONENT_SKIP[$s]}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
###
|
||||
# Main
|
||||
##
|
||||
|
||||
# print help if no args
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
# get the versions
|
||||
extract_component_data "$1"
|
||||
# output
|
||||
report "${ALL}"
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
apiVersion: kubeadm.k8s.io/v1beta1
|
||||
kind: InitConfiguration
|
||||
metadata:
|
||||
name: init-config
|
||||
---
|
||||
apiVersion: kubelet.config.k8s.io/v1beta1
|
||||
kind: KubeletConfiguration
|
||||
metadata:
|
||||
name: kubelet-config
|
||||
cgroupDriver: systemd
|
||||
# Allowing for CPU pinning and isolation in case of guaranteed QoS class
|
||||
cpuManagerPolicy: static
|
||||
@@ -19,8 +15,6 @@ kubeReserved:
|
||||
---
|
||||
apiVersion: kubeadm.k8s.io/v1beta1
|
||||
kind: ClusterConfiguration
|
||||
metadata:
|
||||
name: cluster-config
|
||||
networking:
|
||||
dnsDomain: cluster.local
|
||||
podSubnet: 10.244.0.0/16
|
||||
@@ -1,2 +0,0 @@
|
||||
resources:
|
||||
- kubeadm.yaml
|
||||
@@ -1,3 +0,0 @@
|
||||
[
|
||||
{"op": "add", "path": "/controllerManager", "value": {"extraArgs": {"node-cidr-mask-size": "20"}}}
|
||||
]
|
||||
@@ -1,4 +0,0 @@
|
||||
[
|
||||
{"op": "add", "path": "/maxOpenFiles", "value": 1048576},
|
||||
{"op": "add", "path": "/maxPods", "value": 5000}
|
||||
]
|
||||
@@ -1,17 +0,0 @@
|
||||
bases:
|
||||
- ../base/
|
||||
patchesJson6902:
|
||||
# increase limits in kubelet
|
||||
- target:
|
||||
group: kubelet.config.k8s.io
|
||||
version: v1beta1
|
||||
kind: KubeletConfiguration
|
||||
name: kubelet-config
|
||||
path: kubelet-config.json
|
||||
# increase the address range per node
|
||||
- target:
|
||||
group: kubeadm.k8s.io
|
||||
version: v1beta1
|
||||
kind: ClusterConfiguration
|
||||
name: cluster-config
|
||||
path: cluster-config.json
|
||||
@@ -0,0 +1,5 @@
|
||||
resources:
|
||||
- node-feature-discovery/nfd-daemonset-combined.yaml.template
|
||||
- node-feature-discovery/nfd-worker-daemonset.yaml.template
|
||||
|
||||
|
||||
@@ -5,15 +5,21 @@ set -o nounset
|
||||
|
||||
# global vars
|
||||
CLRK8S_OS=${CLRK8S_OS:-""}
|
||||
CLR_VER=${CLRK8S_CLR_VER:-""}
|
||||
HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
|
||||
|
||||
# set no proxy
|
||||
ADD_NO_PROXY="10.244.0.0/16,10.96.0.0/12"
|
||||
ADD_NO_PROXY=".svc,10.244.0.0/16,10.96.0.0/12"
|
||||
ADD_NO_PROXY+=",$(hostname -I | sed 's/[[:space:]]/,/g')"
|
||||
: "${RUNNER:=crio}"
|
||||
|
||||
# update os version
|
||||
function upate_os_version() {
|
||||
if [[ -n "${CLR_VER}" ]];
|
||||
then
|
||||
sudo swupd repair -m "${CLR_VER}" --picky
|
||||
return
|
||||
fi
|
||||
sudo swupd update
|
||||
}
|
||||
|
||||
|
||||
@@ -140,47 +140,52 @@ for (currentdir in resultdirs) {
|
||||
# filename has date on the end, so look for the right file name
|
||||
freemem_pattern='^memory\\-free'
|
||||
files=list.files(memory_dir, pattern=freemem_pattern)
|
||||
# collectd csv plugin starts a new file for each day of data collected
|
||||
for(file in files) {
|
||||
mem_free_csv=paste(memory_dir, file, sep="/")
|
||||
node_mem_free_data=read.csv(mem_free_csv, header=TRUE, sep=",")
|
||||
node_mem_free_data=cbind(node_mem_free_data,
|
||||
node=rep(n, length(node_mem_free_data$value)))
|
||||
node_mem_free_data=cbind(node_mem_free_data,
|
||||
testname=rep(testname, length(node_mem_free_data$value)))
|
||||
node_mem_free_data$s_offset = node_mem_free_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
mem_free_csv=paste(memory_dir, files[1], sep="/")
|
||||
node_mem_free_data=read.csv(mem_free_csv, header=TRUE, sep=",")
|
||||
node_mem_free_data=cbind(node_mem_free_data,
|
||||
node=rep(n, length(node_mem_free_data$value)))
|
||||
node_mem_free_data=cbind(node_mem_free_data,
|
||||
testname=rep(testname, length(node_mem_free_data$value)))
|
||||
node_mem_free_data$s_offset = node_mem_free_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
mem_free_data=rbind(mem_free_data, node_mem_free_data)
|
||||
mem_free_data=rbind(mem_free_data, node_mem_free_data)
|
||||
}
|
||||
|
||||
# grab CPU data
|
||||
cpu_dir=paste(localhost_dir, "aggregation-cpu-average", sep="/")
|
||||
# filename has date on the end, so look for the right file name
|
||||
percent_idle_pattern='^percent\\-idle'
|
||||
files=list.files(cpu_dir, pattern=percent_idle_pattern)
|
||||
for(file in files) {
|
||||
cpu_idle_csv=paste(cpu_dir, file, sep="/")
|
||||
node_cpu_idle_data=read.csv(cpu_idle_csv, header=TRUE, sep=",")
|
||||
node_cpu_idle_data=cbind(node_cpu_idle_data,
|
||||
node=rep(n, length(node_cpu_idle_data$value)))
|
||||
node_cpu_idle_data=cbind(node_cpu_idle_data,
|
||||
testname=rep(testname, length(node_cpu_idle_data$value)))
|
||||
node_cpu_idle_data$s_offset = node_cpu_idle_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
cpu_idle_csv=paste(cpu_dir, files[1], sep="/")
|
||||
node_cpu_idle_data=read.csv(cpu_idle_csv, header=TRUE, sep=",")
|
||||
node_cpu_idle_data=cbind(node_cpu_idle_data,
|
||||
node=rep(n, length(node_cpu_idle_data$value)))
|
||||
node_cpu_idle_data=cbind(node_cpu_idle_data,
|
||||
testname=rep(testname, length(node_cpu_idle_data$value)))
|
||||
node_cpu_idle_data$s_offset = node_cpu_idle_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
cpu_idle_data=rbind(cpu_idle_data, node_cpu_idle_data)
|
||||
cpu_idle_data=rbind(cpu_idle_data, node_cpu_idle_data)
|
||||
}
|
||||
|
||||
# grab inode data
|
||||
inode_dir=paste(localhost_dir, "df-root", sep="/")
|
||||
# filename has date on the end, so look for the right file name
|
||||
inode_free_pattern='^df_inodes\\-free'
|
||||
files=list.files(inode_dir, pattern=inode_free_pattern)
|
||||
inode_free_csv=paste(inode_dir, files[1], sep="/")
|
||||
node_inode_free_data=read.csv(inode_free_csv, header=TRUE, sep=",")
|
||||
node_inode_free_data=cbind(node_inode_free_data,
|
||||
node=rep(n, length(node_inode_free_data$value)))
|
||||
node_inode_free_data=cbind(node_inode_free_data,
|
||||
testname=rep(testname, length(node_inode_free_data$value)))
|
||||
node_inode_free_data$s_offset = node_inode_free_data$epoch - local_bootdata[1,]$epoch
|
||||
for(file in files) {
|
||||
inode_free_csv=paste(inode_dir, file, sep="/")
|
||||
node_inode_free_data=read.csv(inode_free_csv, header=TRUE, sep=",")
|
||||
node_inode_free_data=cbind(node_inode_free_data,
|
||||
node=rep(n, length(node_inode_free_data$value)))
|
||||
node_inode_free_data=cbind(node_inode_free_data,
|
||||
testname=rep(testname, length(node_inode_free_data$value)))
|
||||
node_inode_free_data$s_offset = node_inode_free_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
inode_free_data=rbind(inode_free_data, node_inode_free_data)
|
||||
inode_free_data=rbind(inode_free_data, node_inode_free_data)
|
||||
}
|
||||
|
||||
# grab interface data
|
||||
interface_dir_pattern='^interface\\-'
|
||||
@@ -191,71 +196,79 @@ for (currentdir in resultdirs) {
|
||||
|
||||
# filename has date on the end, so look for the right file name
|
||||
interface_packets_pattern='^if_packets'
|
||||
files=list.files(interface_dir, pattern=interface_packets_pattern)
|
||||
interface_packets_csv=paste(interface_dir, files[1], sep="/")
|
||||
node_interface_packets_data=read.csv(interface_packets_csv, header=TRUE, sep=",")
|
||||
node_interface_packets_data=cbind(node_interface_packets_data,
|
||||
node=rep(n, length(node_interface_packets_data$epoch)))
|
||||
node_interface_packets_data=cbind(node_interface_packets_data,
|
||||
testname=rep(testname,
|
||||
int_files=list.files(interface_dir, pattern=interface_packets_pattern)
|
||||
for (int_file in int_files) {
|
||||
interface_packets_csv=paste(interface_dir, int_file, sep="/")
|
||||
node_interface_packets_data=read.csv(interface_packets_csv, header=TRUE, sep=",")
|
||||
node_interface_packets_data=cbind(node_interface_packets_data,
|
||||
node=rep(n, length(node_interface_packets_data$epoch)))
|
||||
node_interface_packets_data=cbind(node_interface_packets_data,
|
||||
testname=rep(testname,
|
||||
length(node_interface_packets_data$epoch)))
|
||||
node_interface_packets_data=cbind(node_interface_packets_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_packets_data$epoch)))
|
||||
node_interface_packets_data=cbind(node_interface_packets_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_packets_data$epoch)))
|
||||
node_interface_packets_data$s_offset = node_interface_packets_data$epoch - local_bootdata[1,]$epoch
|
||||
node_interface_packets_data$s_offset = node_interface_packets_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
interface_packets_data=rbind(interface_packets_data, node_interface_packets_data)
|
||||
interface_packets_data=rbind(interface_packets_data, node_interface_packets_data)
|
||||
}
|
||||
|
||||
# filename has date on the end, so look for the right file name
|
||||
interface_octets_pattern='^if_octets'
|
||||
files=list.files(interface_dir, pattern=interface_octets_pattern)
|
||||
interface_octets_csv=paste(interface_dir, files[1], sep="/")
|
||||
node_interface_octets_data=read.csv(interface_octets_csv, header=TRUE, sep=",")
|
||||
node_interface_octets_data=cbind(node_interface_octets_data,
|
||||
node=rep(n, length(node_interface_octets_data$epoch)))
|
||||
node_interface_octets_data=cbind(node_interface_octets_data,
|
||||
testname=rep(testname,
|
||||
int_files=list.files(interface_dir, pattern=interface_octets_pattern)
|
||||
for (int_file in int_files) {
|
||||
interface_octets_csv=paste(interface_dir, int_file, sep="/")
|
||||
node_interface_octets_data=read.csv(interface_octets_csv, header=TRUE, sep=",")
|
||||
node_interface_octets_data=cbind(node_interface_octets_data,
|
||||
node=rep(n, length(node_interface_octets_data$epoch)))
|
||||
node_interface_octets_data=cbind(node_interface_octets_data,
|
||||
testname=rep(testname,
|
||||
length(node_interface_octets_data$epoch)))
|
||||
node_interface_octets_data=cbind(node_interface_octets_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_octets_data$epoch)))
|
||||
node_interface_octets_data=cbind(node_interface_octets_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_octets_data$epoch)))
|
||||
node_interface_octets_data$s_offset = node_interface_octets_data$epoch - local_bootdata[1,]$epoch
|
||||
node_interface_octets_data$s_offset = node_interface_octets_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
interface_octets_data=rbind(interface_octets_data, node_interface_octets_data)
|
||||
interface_octets_data=rbind(interface_octets_data, node_interface_octets_data)
|
||||
}
|
||||
|
||||
# filename has date on the end, so look for the right file name
|
||||
interface_dropped_pattern='^if_dropped'
|
||||
files=list.files(interface_dir, pattern=interface_dropped_pattern)
|
||||
interface_dropped_csv=paste(interface_dir, files[1], sep="/")
|
||||
node_interface_dropped_data=read.csv(interface_dropped_csv, header=TRUE, sep=",")
|
||||
node_interface_dropped_data=cbind(node_interface_dropped_data,
|
||||
node=rep(n, length(node_interface_dropped_data$epoch)))
|
||||
node_interface_dropped_data=cbind(node_interface_dropped_data,
|
||||
testname=rep(testname,
|
||||
int_files=list.files(interface_dir, pattern=interface_dropped_pattern)
|
||||
for (int_file in int_files) {
|
||||
interface_dropped_csv=paste(interface_dir, int_file, sep="/")
|
||||
node_interface_dropped_data=read.csv(interface_dropped_csv, header=TRUE, sep=",")
|
||||
node_interface_dropped_data=cbind(node_interface_dropped_data,
|
||||
node=rep(n, length(node_interface_dropped_data$epoch)))
|
||||
node_interface_dropped_data=cbind(node_interface_dropped_data,
|
||||
testname=rep(testname,
|
||||
length(node_interface_dropped_data$epoch)))
|
||||
node_interface_dropped_data=cbind(node_interface_dropped_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_dropped_data$epoch)))
|
||||
node_interface_dropped_data=cbind(node_interface_dropped_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_dropped_data$epoch)))
|
||||
node_interface_dropped_data$s_offset = node_interface_dropped_data$epoch - local_bootdata[1,]$epoch
|
||||
node_interface_dropped_data$s_offset = node_interface_dropped_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
interface_dropped_data=rbind(interface_dropped_data, node_interface_dropped_data)
|
||||
interface_dropped_data=rbind(interface_dropped_data, node_interface_dropped_data)
|
||||
}
|
||||
|
||||
# filename has date on the end, so look for the right file name
|
||||
interface_errors_pattern='^if_errors'
|
||||
files=list.files(interface_dir, pattern=interface_errors_pattern)
|
||||
interface_errors_csv=paste(interface_dir, files[1], sep="/")
|
||||
node_interface_errors_data=read.csv(interface_errors_csv, header=TRUE, sep=",")
|
||||
node_interface_errors_data=cbind(node_interface_errors_data,
|
||||
node=rep(n, length(node_interface_errors_data$epoch)))
|
||||
node_interface_errors_data=cbind(node_interface_errors_data,
|
||||
testname=rep(testname,
|
||||
int_files=list.files(interface_dir, pattern=interface_errors_pattern)
|
||||
for (int_file in int_files) {
|
||||
interface_errors_csv=paste(interface_dir, int_file, sep="/")
|
||||
node_interface_errors_data=read.csv(interface_errors_csv, header=TRUE, sep=",")
|
||||
node_interface_errors_data=cbind(node_interface_errors_data,
|
||||
node=rep(n, length(node_interface_errors_data$epoch)))
|
||||
node_interface_errors_data=cbind(node_interface_errors_data,
|
||||
testname=rep(testname,
|
||||
length(node_interface_errors_data$epoch)))
|
||||
node_interface_errors_data=cbind(node_interface_errors_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_errors_data$epoch)))
|
||||
node_interface_errors_data=cbind(node_interface_errors_data,
|
||||
name=rep(interface_name,
|
||||
length(node_interface_errors_data$epoch)))
|
||||
node_interface_errors_data$s_offset = node_interface_errors_data$epoch - local_bootdata[1,]$epoch
|
||||
node_interface_errors_data$s_offset = node_interface_errors_data$epoch - local_bootdata[1,]$epoch
|
||||
|
||||
interface_errors_data=rbind(interface_errors_data, node_interface_errors_data)
|
||||
interface_errors_data=rbind(interface_errors_data, node_interface_errors_data)
|
||||
}
|
||||
}
|
||||
|
||||
# Do not use the master (non-schedulable) nodes to calculate
|
||||
|
||||
Reference in New Issue
Block a user