Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/master' into release-1.14

  • Loading branch information...
hoegaarden committed Feb 26, 2019
2 parents 39dac9a + b3ca826 commit 6c7afd1222ebf2cb91567364471d74ac056437b7
Showing with 3,817 additions and 1,733 deletions.
  1. +14 −11 Godeps/Godeps.json
  2. +2 −2 api/openapi-spec/swagger.json
  3. +5 −1 cluster/gce/gci/node-helper.sh
  4. +15 −0 cluster/gce/windows/common.psm1
  5. +2 −14 cluster/gce/windows/configure.ps1
  6. +19 −43 cluster/gce/windows/k8s-node-setup.psm1
  7. +2 −2 cluster/juju/prereqs/ubuntu-juju.sh
  8. +18 −15 cluster/juju/util.sh
  9. +3 −1 cluster/kubemark/gce/config-default.sh
  10. +1 −0 cluster/kubemark/iks/config-default.sh
  11. +4 −4 cluster/kubemark/util.sh
  12. +8 −1 cluster/local/util.sh
  13. +3 −3 cluster/update-storage-objects.sh
  14. +1 −1 cmd/kubeadm/app/apis/kubeadm/types.go
  15. +4 −1 cmd/kubeadm/app/cmd/init.go
  16. +3 −0 cmd/kubeadm/app/cmd/join.go
  17. +7 −1 cmd/kubeadm/app/cmd/phases/init/BUILD
  18. +4 −9 cmd/kubeadm/app/cmd/phases/init/addons.go
  19. +4 −14 cmd/kubeadm/app/cmd/phases/init/bootstraptoken.go
  20. +4 −14 cmd/kubeadm/app/cmd/phases/init/certs.go
  21. +1 −0 cmd/kubeadm/app/cmd/phases/init/certs_test.go
  22. +2 −9 cmd/kubeadm/app/cmd/phases/init/controlplane.go
  23. +47 −0 cmd/kubeadm/app/cmd/phases/init/data.go
  24. +49 −0 cmd/kubeadm/app/cmd/phases/init/data_test.go
  25. +1 −8 cmd/kubeadm/app/cmd/phases/init/etcd.go
  26. +2 −14 cmd/kubeadm/app/cmd/phases/init/kubeconfig.go
  27. +1 −11 cmd/kubeadm/app/cmd/phases/init/kubelet.go
  28. +1 −9 cmd/kubeadm/app/cmd/phases/init/markcontrolplane.go
  29. +1 −12 cmd/kubeadm/app/cmd/phases/init/preflight.go
  30. +1 −11 cmd/kubeadm/app/cmd/phases/init/uploadcerts.go
  31. +1 −6 cmd/kubeadm/app/cmd/phases/init/uploadconfig.go
  32. +2 −11 cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go
  33. +14 −1 cmd/kubeadm/app/cmd/phases/join/BUILD
  34. +1 −9 cmd/kubeadm/app/cmd/phases/join/checketcd.go
  35. +3 −12 cmd/kubeadm/app/cmd/phases/join/controlplanejoin.go
  36. +3 −9 cmd/kubeadm/app/cmd/phases/join/controlplaneprepare.go
  37. +38 −0 cmd/kubeadm/app/cmd/phases/join/data.go
  38. +40 −0 cmd/kubeadm/app/cmd/phases/join/data_test.go
  39. +2 −10 cmd/kubeadm/app/cmd/phases/join/kubelet.go
  40. +1 −8 cmd/kubeadm/app/cmd/phases/join/preflight.go
  41. +13 −13 cmd/kubeadm/app/phases/addons/dns/dns.go
  42. +26 −26 cmd/kubeadm/app/phases/addons/dns/dns_test.go
  43. +3 −3 cmd/kubeadm/app/phases/addons/dns/manifests.go
  44. +1 −1 cmd/kubeadm/app/phases/addons/proxy/manifests.go
  45. +8 −8 cmd/kubeadm/app/phases/addons/proxy/proxy.go
  46. +19 −19 cmd/kubeadm/app/phases/addons/proxy/proxy_test.go
  47. +9 −9 cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go
  48. +2 −2 cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go
  49. +2 −2 cmd/kubeadm/app/phases/markcontrolplane/markcontrolplane.go
  50. +6 −6 cmd/kubeadm/app/phases/selfhosting/podspec_mutation.go
  51. +3 −3 cmd/kubeadm/app/phases/selfhosting/podspec_mutation_test.go
  52. +10 −10 cmd/kubeadm/app/phases/upgrade/health.go
  53. +4 −4 cmd/kubeadm/app/phases/upgrade/postupgrade.go
  54. +1 −1 cmd/kubeadm/app/phases/upgrade/prepull.go
  55. +3 −3 cmd/kubeadm/app/phases/uploadconfig/uploadconfig_test.go
  56. +5 −11 cmd/kubeadm/app/preflight/checks.go
  57. +7 −7 cmd/kubeadm/app/util/etcd/etcd.go
  58. +0 −19 hack/.golint_failures
  59. +0 −37 hack/.shellcheck_failures
  60. +2 −1 hack/generate-bindata.sh
  61. +1 −1 hack/generate-docs.sh
  62. +1 −1 hack/install-etcd.sh
  63. +5 −5 hack/lib/etcd.sh
  64. +2 −1 hack/update-bazel.sh
  65. +2 −2 hack/update-generated-runtime.sh
  66. +9 −9 hack/verify-generated-device-plugin.sh
  67. +1 −1 hack/verify-generated-docs.sh
  68. +3 −2 hack/verify-generated-files.sh
  69. +6 −6 hack/verify-generated-kms.sh
  70. +9 −9 hack/verify-generated-kubelet-plugin-registration.sh
  71. +6 −6 hack/verify-generated-pod-resources.sh
  72. +1 −1 hack/verify-generated-protobuf.sh
  73. +6 −6 hack/verify-generated-runtime.sh
  74. +3 −3 hack/verify-linkcheck.sh
  75. +1 −1 hack/verify-pkg-names.sh
  76. +4 −3 hack/verify-spelling.sh
  77. +2 −2 hack/verify-staging-godeps.sh
  78. +2 −2 hack/verify-symbols.sh
  79. +2 −1 pkg/apis/admission/v1beta1/register.go
  80. +2 −1 pkg/apis/authentication/v1beta1/register.go
  81. +2 −1 pkg/apis/authorization/v1beta1/register.go
  82. +2 −1 pkg/apis/coordination/v1/register.go
  83. +2 −1 pkg/apis/coordination/v1beta1/register.go
  84. +2 −1 pkg/apis/imagepolicy/v1alpha1/register.go
  85. +2 −1 pkg/apis/scheduling/v1alpha1/register.go
  86. +2 −1 pkg/apis/scheduling/v1beta1/register.go
  87. +2 −1 pkg/apis/settings/v1alpha1/register.go
  88. +2 −1 pkg/apis/storage/v1alpha1/register.go
  89. +12 −0 pkg/cloudprovider/providers/azure/azure_backoff.go
  90. +12 −3 pkg/cloudprovider/providers/azure/azure_controller_standard.go
  91. +12 −4 pkg/cloudprovider/providers/azure/azure_controller_vmss.go
  92. +1 −1 pkg/cloudprovider/providers/azure/azure_loadbalancer.go
  93. +65 −0 pkg/cloudprovider/providers/azure/azure_loadbalancer_test.go
  94. +30 −3 pkg/cloudprovider/providers/openstack/openstack.go
  95. +5 −0 pkg/cloudprovider/providers/openstack/openstack_volumes.go
  96. +6 −0 pkg/features/kube_features.go
  97. +1 −0 pkg/kubectl/BUILD
  98. +2 −7 pkg/kubectl/cmd/drain/BUILD
  99. +85 −346 pkg/kubectl/cmd/drain/drain.go
  100. +37 −18 pkg/kubectl/cmd/drain/drain_test.go
  101. +76 −11 pkg/kubectl/cmd/logs/logs.go
  102. +285 −38 pkg/kubectl/cmd/logs/logs_test.go
  103. +41 −0 pkg/kubectl/drain/BUILD
  104. +97 −0 pkg/kubectl/drain/cordon.go
  105. +159 −0 pkg/kubectl/drain/drain.go
  106. +223 −0 pkg/kubectl/drain/filters.go
  107. +1 −1 pkg/kubectl/polymorphichelpers/interface.go
  108. +5 −5 pkg/kubectl/polymorphichelpers/logsforobject.go
  109. +1 −1 pkg/kubelet/config/BUILD
  110. +12 −19 pkg/kubelet/config/file_linux.go
  111. +1 −2 pkg/kubelet/config/file_linux_test.go
  112. +7 −0 pkg/kubelet/dockershim/BUILD
  113. +15 −4 pkg/kubelet/dockershim/docker_container.go
  114. +48 −0 pkg/kubelet/dockershim/docker_container_unsupported.go
  115. +216 −0 pkg/kubelet/dockershim/docker_container_windows.go
  116. +304 −0 pkg/kubelet/dockershim/docker_container_windows_test.go
  117. +12 −0 pkg/kubelet/dockershim/docker_service.go
  118. +3 −3 pkg/kubelet/dockershim/docker_streaming.go
  119. +1 −0 pkg/kubelet/kuberuntime/BUILD
  120. +43 −0 pkg/kubelet/kuberuntime/kuberuntime_container_windows.go
  121. +82 −0 pkg/kubelet/kuberuntime/kuberuntime_container_windows_test.go
  122. +2 −2 pkg/kubelet/metrics/collectors/volume_stats.go
  123. +1 −0 pkg/kubelet/server/auth.go
  124. +3 −2 pkg/kubelet/server/portforward/constants.go
  125. +1 −1 pkg/kubelet/server/portforward/httpstream.go
  126. +14 −14 pkg/kubelet/server/portforward/httpstream_test.go
  127. +1 −1 pkg/kubelet/server/portforward/portforward.go
  128. +3 −3 pkg/kubelet/server/portforward/websocket.go
  129. +11 −10 pkg/kubelet/server/server.go
  130. +14 −15 pkg/kubelet/server/server_test.go
  131. +10 −12 pkg/kubelet/server/stats/fs_resource_analyzer.go
  132. +9 −8 pkg/kubelet/server/stats/handler.go
  133. +1 −1 pkg/kubelet/server/stats/resource_analyzer.go
  134. +3 −2 pkg/kubelet/server/stats/summary.go
  135. +7 −7 pkg/kubelet/server/stats/volume_stat_calculator.go
  136. +9 −9 pkg/kubelet/server/streaming/errors.go
  137. +12 −12 pkg/kubelet/server/streaming/request_cache.go
  138. +15 −15 pkg/kubelet/server/streaming/request_cache_test.go
  139. +4 −4 pkg/kubelet/server/streaming/server.go
  140. +33 −26 pkg/util/mount/mount_linux_test.go
  141. +10 −7 pkg/volume/azure_dd/attacher.go
  142. +2 −0 pkg/volume/cinder/BUILD
  143. +6 −0 pkg/volume/cinder/cinder.go
  144. +75 −0 pkg/volume/cinder/cinder_test.go
  145. +1 −1 pkg/volume/util/operationexecutor/operation_generator.go
  146. +1 −0 staging/src/k8s.io/api/scheduling/v1alpha1/generated.proto
  147. +1 −0 staging/src/k8s.io/api/scheduling/v1alpha1/types.go
  148. +1 −1 staging/src/k8s.io/api/scheduling/v1alpha1/types_swagger_doc_generated.go
  149. +1 −0 staging/src/k8s.io/api/scheduling/v1beta1/generated.proto
  150. +1 −0 staging/src/k8s.io/api/scheduling/v1beta1/types.go
  151. +1 −1 staging/src/k8s.io/api/scheduling/v1beta1/types_swagger_doc_generated.go
  152. +12 −6 staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
  153. +12 −6 staging/src/k8s.io/apiserver/Godeps/Godeps.json
  154. +10 −5 staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
  155. +10 −5 staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
  156. +1 −1 test/cmd/run.sh
  157. +1 −0 test/conformance/testdata/conformance.txt
  158. +1 −0 test/e2e/BUILD
  159. +6 −5 test/e2e/apimachinery/aggregator.go
  160. +17 −17 test/e2e/apps/job.go
  161. +1 −0 test/e2e/e2e.go
  162. +1 −0 test/e2e/framework/BUILD
  163. +0 −8 test/e2e/framework/ingress/ingress_utils.go
  164. +23 −0 test/e2e/framework/providers/openstack/BUILD
  165. +34 −0 test/e2e/framework/providers/openstack/openstack.go
  166. +1 −1 test/e2e/lifecycle/cluster_upgrade.go
  167. +15 −13 test/e2e/upgrades/apparmor.go
  168. +9 −8 test/e2e/upgrades/apps/daemonsets.go
  169. +23 −22 test/e2e/upgrades/apps/deployments.go
  170. +10 −9 test/e2e/upgrades/apps/job.go
  171. +10 −8 test/e2e/upgrades/apps/replicasets.go
  172. +16 −14 test/e2e/upgrades/apps/statefulset.go
  173. +20 −20 test/e2e/upgrades/cassandra.go
  174. +5 −4 test/e2e/upgrades/configmaps.go
  175. +25 −20 test/e2e/upgrades/etcd.go
  176. +10 −9 test/e2e/upgrades/horizontal_pod_autoscalers.go
  177. +16 −15 test/e2e/upgrades/ingress.go
  178. +18 −16 test/e2e/upgrades/kube_proxy_migration.go
  179. +30 −28 test/e2e/upgrades/mysql.go
  180. +14 −13 test/e2e/upgrades/nvidia-gpu.go
  181. +5 −4 test/e2e/upgrades/secrets.go
  182. +9 −8 test/e2e/upgrades/services.go
  183. +8 −7 test/e2e/upgrades/storage/persistent_volumes.go
  184. +18 −16 test/e2e/upgrades/storage/volume_mode.go
  185. +16 −16 test/e2e/upgrades/sysctl.go
  186. +1 −0 test/e2e/windows/BUILD
  187. +172 −0 test/e2e/windows/volumes.go
  188. +0 −1 test/integration/scheduler_perf/BUILD
  189. +6 −6 test/integration/scheduler_perf/scheduler_test.go
  190. +0 −1 test/integration/scheduler_perf/util.go
  191. +1 −2 test/integration/volume/attach_detach_test.go
  192. +20 −20 test/integration/volume/persistent_volumes_test.go
  193. +7 −2 test/kubemark/common/util.sh
  194. +14 −14 test/kubemark/gce/util.sh
  195. +4 −2 test/kubemark/iks/shutdown.sh
  196. +44 −22 test/kubemark/iks/startup.sh
  197. +46 −30 test/kubemark/iks/util.sh
  198. +4 −4 test/kubemark/master-log-dump.sh
  199. +17 −12 test/kubemark/resources/start-kubemark-master.sh
  200. +11 −9 test/kubemark/run-e2e-tests.sh
  201. +17 −0 test/kubemark/skeleton/util.sh
  202. +11 −8 test/kubemark/start-kubemark.sh
  203. +1 −1 test/kubemark/stop-kubemark.sh
  204. +2 −2 vendor/github.com/prometheus/client_golang/prometheus/desc.go
  205. +9 −3 vendor/github.com/prometheus/client_golang/prometheus/registry.go
  206. +26 −21 vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
  207. +7 −4 vendor/github.com/prometheus/client_golang/prometheus/timer.go
  208. +2 −2 vendor/github.com/prometheus/common/expfmt/decode.go
  209. +1 −1 vendor/github.com/prometheus/common/expfmt/expfmt.go
  210. +261 −96 vendor/github.com/prometheus/common/expfmt/text_create.go
  211. +7 −3 vendor/github.com/prometheus/common/expfmt/text_parse.go
  212. +3 −3 vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
  213. +0 −1 vendor/github.com/prometheus/common/model/metric.go
  214. +2 −2 vendor/github.com/prometheus/common/model/silence.go
  215. +17 −2 vendor/github.com/prometheus/common/model/time.go
  216. +2 −2 vendor/github.com/prometheus/common/model/value.go
  217. 0 vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -33,9 +33,13 @@ function get-node-instance-metadata-from-file {
echo "${metadata}"
}

# $1: template name (required).
# Assumed vars:
# scope_flags
# Parameters:
# $1: template name (required).
function create-linux-node-instance-template {
local template_name="$1"
ensure-gci-metadata-files
# shellcheck disable=2154 # 'scope_flags' is assigned by upstream
create-node-template "${template_name}" "${scope_flags[*]}" "$(get-node-instance-metadata-from-file)" "" "linux"
}
@@ -146,5 +146,20 @@ function MustDownload-File {
}
}

# Returns true if this node is part of a test cluster (see
# cluster/gce/config-test.sh). $KubeEnv is a hash table containing the kube-env
# metadata keys+values.
function Test-IsTestCluster {
param (
[parameter(Mandatory=$true)] [hashtable]$KubeEnv
)

if ($KubeEnv.Contains('TEST_CLUSTER') -and `
($KubeEnv['TEST_CLUSTER'] -eq 'true')) {
return $true
}
return $false
}

# Export all public functions:
Export-ModuleMember -Function *-*
@@ -77,18 +77,6 @@ function FetchAndImport-ModuleFromMetadata {
Import-Module -Force C:\$Filename
}

# Returns true if this node is part of a test cluster (see
# cluster/gce/config-test.sh).
#
# $kube_env must be set before calling this function.
function Test-IsTestCluster {
if ($kube_env.Contains('TEST_CLUSTER') -and `
($kube_env['TEST_CLUSTER'] -eq 'true')) {
return $true
}
return $false
}

try {
# Don't use FetchAndImport-ModuleFromMetadata for common.psm1 - the common
# module includes variables and functions that any other function may depend
@@ -104,8 +92,9 @@ try {

Set-PrerequisiteOptions
$kube_env = Fetch-KubeEnv
Disable-WindowsDefender

if (Test-IsTestCluster) {
if (Test-IsTestCluster $kube_env) {
Log-Output 'Test cluster detected, installing OpenSSH.'
FetchAndImport-ModuleFromMetadata 'install-ssh-psm1' 'install-ssh.psm1'
InstallAndStart-OpenSsh
@@ -117,7 +106,6 @@ try {
Download-HelperScripts

Create-DockerRegistryKey
Create-PauseImage
DownloadAndInstall-KubernetesBinaries
Create-NodePki
Create-KubeletKubeconfig
@@ -45,7 +45,7 @@
# - Document functions using proper syntax:
# https://technet.microsoft.com/en-us/library/hh847834(v=wps.620).aspx

$INFRA_CONTAINER = "kubeletwin/pause"
$INFRA_CONTAINER = "e2eteam/pause:3.1"
$GCE_METADATA_SERVER = "169.254.169.254"
# The "management" interface is used by the kubelet and by Windows pods to talk
# to the rest of the Kubernetes cluster *without NAT*. This interface does not
@@ -221,13 +221,6 @@ function Set-PrerequisiteOptions {
sc.exe config wuauserv start=disabled
sc.exe stop wuauserv

# Windows Defender periodically consumes 100% of the CPU.
# TODO(pjh): this (all of a sudden, ugh) started failing with "The term
# 'Set-MpPreference' is not recognized...". Investigate and fix or remove.
#Log-Output "Disabling Windows Defender service"
#Set-MpPreference -DisableRealtimeMonitoring $true
#Uninstall-WindowsFeature -Name 'Windows-Defender'

# Use TLS 1.2: needed for Invoke-WebRequest downloads from github.com.
[Net.ServicePointManager]::SecurityProtocol = `
[Net.SecurityProtocolType]::Tls12
@@ -237,6 +230,24 @@ function Set-PrerequisiteOptions {
Install-Module -Name powershell-yaml -Force
}

# Disables Windows Defender realtime scanning if this Windows node is part of a
# test cluster.
#
# ${kube_env} must have already been set.
function Disable-WindowsDefender {
# Windows Defender periodically consumes 100% of the CPU, so disable realtime
# scanning. Uninstalling the Windows Feature will prevent the service from
# starting after a reboot.
# TODO(pjh): move this step to image preparation, since we don't want to do a
# full reboot here.
if ((Test-IsTestCluster ${kube_env}) -and
((Get-WindowsFeature -Name 'Windows-Defender').Installed)) {
Log-Output "Disabling Windows Defender service"
Set-MpPreference -DisableRealtimeMonitoring $true
Uninstall-WindowsFeature -Name 'Windows-Defender'
}
}

# Creates directories where other functions in this module will read and write
# data.
function Create-Directories {
@@ -276,41 +287,6 @@ function Get_ContainerVersionLabel {
"version label")
}

# Builds the pause image with name $INFRA_CONTAINER.
function Create-PauseImage {
$win_version = $(Get-InstanceMetadataValue 'win-version')
if ($win_version -match '2019') {
# TODO(pjh): update this function to properly support 2019 vs. 1809 vs.
# future Windows versions. For example, Windows Server 2019 does not
# support the nanoserver container
# (https://blogs.technet.microsoft.com/virtualization/2018/11/13/windows-server-2019-now-available/).
Log_NotImplemented "Need to update Create-PauseImage for WS2019"
}

$version_label = Get_ContainerVersionLabel $win_version
$pause_dir = "${env:K8S_DIR}\pauseimage"
$dockerfile = "$pause_dir\Dockerfile"
mkdir -Force $pause_dir
if (ShouldWrite-File $dockerfile) {
New-Item -Force -ItemType file $dockerfile | Out-Null
Set-Content `
$dockerfile `
("FROM mcr.microsoft.com/windows/nanoserver:${version_label}`n`n" +
"CMD cmd /c ping -t localhost > nul")
}

if (($(docker images -a) -like "*${INFRA_CONTAINER}*") -and
(-not $REDO_STEPS)) {
Log-Output "Skip: ${INFRA_CONTAINER} already built"
return
}
docker build -t ${INFRA_CONTAINER} $pause_dir
if ($LastExitCode -ne 0) {
Log-Output -Fatal `
"docker build -t ${INFRA_CONTAINER} $pause_dir failed"
}
}

# Downloads the Kubernetes binaries from kube-env's NODE_BINARY_TAR_URL and
# puts them in a subdirectory of $env:K8S_DIR.
#
@@ -22,7 +22,7 @@ set -o pipefail

function check_for_ppa() {
local repo="$1"
grep -qsw $repo /etc/apt/sources.list /etc/apt/sources.list.d/*
grep -qsw "${repo}" /etc/apt/sources.list /etc/apt/sources.list.d/*
}

function package_status() {
@@ -31,7 +31,7 @@ function package_status() {
pkgstatus=$(dpkg-query -W --showformat='${Status}\n' "${pkgname}")
if [[ "${pkgstatus}" != "install ok installed" ]]; then
echo "Missing package ${pkgname}"
sudo apt-get --force-yes --yes install ${pkgname}
sudo apt-get --force-yes --yes install "${pkgname}"
fi
}

@@ -20,9 +20,9 @@ set -o nounset
set -o pipefail
#set -o xtrace

UTIL_SCRIPT=$(readlink -m "${BASH_SOURCE}")
JUJU_PATH=$(dirname ${UTIL_SCRIPT})
KUBE_ROOT=$(readlink -m ${JUJU_PATH}/../../)
UTIL_SCRIPT=$(readlink -m "${BASH_SOURCE[0]}")
JUJU_PATH=$(dirname "${UTIL_SCRIPT}")
KUBE_ROOT=$(readlink -m "${JUJU_PATH}/../../")
# Use the config file specified in $KUBE_CONFIG_FILE, or config-default.sh.
source "${JUJU_PATH}/${KUBE_CONFIG_FILE-config-default.sh}"
# This attempts installation of Juju - This really needs to support multiple
@@ -38,14 +38,14 @@ function build-local() {
# This used to build the kubernetes project. Now it rebuilds the charm(s)
# living in `cluster/juju/layers`

charm build ${JUJU_PATH}/layers/kubernetes -o $JUJU_REPOSITORY -r --no-local-layers
charm build "${JUJU_PATH}/layers/kubernetes" -o "$JUJU_REPOSITORY" -r --no-local-layers
}

function detect-master() {
local kubestatus

# Capturing a newline, and my awk-fu was weak - pipe through tr -d
kubestatus=$(juju status --format=oneline kubernetes | grep ${KUBE_MASTER_NAME} | awk '{print $3}' | tr -d "\n")
kubestatus=$(juju status --format=oneline kubernetes | grep "${KUBE_MASTER_NAME}" | awk '{print $3}' | tr -d "\n")
export KUBE_MASTER_IP=${kubestatus}
export KUBE_SERVER=https://${KUBE_MASTER_IP}:6433

@@ -61,7 +61,10 @@ function detect-nodes() {
# ]

# Strip out the IP addresses
export KUBE_NODE_IP_ADDRESSES=($(${JUJU_PATH}/return-node-ips.py "${ipoutput}"))
while IFS=$'\n' read -r ip;
do KUBE_NODE_IP_ADDRESSES+=("$ip");
done < <("${JUJU_PATH}/return-node-ips.py" "${ipoutput}")
export KUBE_NODE_IP_ADDRESSES
# echo "Kubernetes minions: " ${KUBE_NODE_IP_ADDRESSES[@]} 1>&2
export NUM_NODES=${#KUBE_NODE_IP_ADDRESSES[@]}
}
@@ -70,11 +73,11 @@ function kube-up() {
build-local

# Replace the charm directory in the bundle.
sed "s|__CHARM_DIR__|${JUJU_REPOSITORY}|" < ${KUBE_BUNDLE_PATH}.base > ${KUBE_BUNDLE_PATH}
sed "s|__CHARM_DIR__|${JUJU_REPOSITORY}|" < "${KUBE_BUNDLE_PATH}.base" > "${KUBE_BUNDLE_PATH}"

# The juju-deployer command will deploy the bundle and can be run
# multiple times to continue deploying the parts that fail.
juju deploy ${KUBE_BUNDLE_PATH}
juju deploy "${KUBE_BUNDLE_PATH}"

source "${KUBE_ROOT}/cluster/common.sh"

@@ -86,9 +89,9 @@ function kube-up() {
# Copy kubectl, the cert and key to this machine from master.
(
umask 077
mkdir -p ${KUBECTL_DIR}
juju scp ${KUBE_MASTER_NAME}:kubectl_package.tar.gz ${KUBECTL_DIR}
tar xfz ${KUBECTL_DIR}/kubectl_package.tar.gz -C ${KUBECTL_DIR}
mkdir -p "${KUBECTL_DIR}"
juju scp "${KUBE_MASTER_NAME}:kubectl_package.tar.gz" "${KUBECTL_DIR}"
tar xfz "${KUBECTL_DIR}/kubectl_package.tar.gz" -C "${KUBECTL_DIR}"
)
# Export the location of the kubectl configuration file.
export KUBECONFIG="${KUBECTL_DIR}/kubeconfig"
@@ -98,11 +101,11 @@ function kube-down() {
local force="${1-}"
local jujuenv
jujuenv=$(juju switch)
juju destroy-model ${jujuenv} ${force} || true
juju destroy-model "${jujuenv}" "${force}" || true
# Clean up the generated charm files.
rm -rf ${KUBE_ROOT}/cluster/juju/charms
rm -rf "${KUBE_ROOT}/cluster/juju/charms"
# Clean up the kubectl binary and config file.
rm -rf ${KUBECTL_DIR}
rm -rf "${KUBECTL_DIR}"
}

function prepare-e2e() {
@@ -121,7 +124,7 @@ function sleep-status() {
while [[ $i < $maxtime && -z $jujustatus ]]; do
sleep 15
i=$((i + 15))
jujustatus=$(${JUJU_PATH}/identify-leaders.py)
jujustatus=$("${JUJU_PATH}/identify-leaders.py")
export KUBE_MASTER_NAME=${jujustatus}
done

@@ -19,6 +19,8 @@
# gce/util.sh script which assumes config filename), but if some things that
# are enabled by default should not run in hollow clusters, they should be disabled here.

# shellcheck disable=SC2034 # Variables sourced in other scripts.

source "${KUBE_ROOT}/cluster/gce/config-common.sh"

GCLOUD=gcloud
@@ -115,7 +117,7 @@ ENABLE_KUBEMARK_CLUSTER_AUTOSCALER="${ENABLE_KUBEMARK_CLUSTER_AUTOSCALER:-false}
# (e.g. kubemark master, Heapster) enough resources to handle maximum cluster size.
if [[ "${ENABLE_KUBEMARK_CLUSTER_AUTOSCALER}" == "true" ]]; then
NUM_REPLICAS=1
if [[ ! -z "$NUM_NODES" ]]; then
if [[ -n "$NUM_NODES" ]]; then
echo "WARNING: Using Cluster Autoscaler, ignoring NUM_NODES parameter. Set KUBEMARK_AUTOSCALER_MAX_NODES to specify maximum size of the cluster."
fi
fi
@@ -16,6 +16,7 @@

# Cloud information
RANDGEN=$(dd if=/dev/urandom bs=64 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=16 count=1 2>/dev/null | sed 's/[A-Z]//g')
# shellcheck disable=2034 # Variable sourced in other scripts.
KUBE_NAMESPACE="kubemark_${RANDGEN}"
KUBEMARK_IMAGE_TAG="${KUBEMARK_IMAGE_TAG:-2}"
KUBEMARK_IMAGE_LOCATION="${KUBEMARK_IMAGE_LOCATION:-${KUBE_ROOT}/cluster/images/kubemark}"
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source ${KUBE_ROOT}/test/kubemark/cloud-provider-config.sh
source ${KUBE_ROOT}/cluster/${CLOUD_PROVIDER}/util.sh
source ${KUBE_ROOT}/cluster/kubemark/${CLOUD_PROVIDER}/config-default.sh
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
source "${KUBE_ROOT}/test/kubemark/cloud-provider-config.sh"
source "${KUBE_ROOT}/cluster/${CLOUD_PROVIDER}/util.sh"
source "${KUBE_ROOT}/cluster/kubemark/${CLOUD_PROVIDER}/config-default.sh"
Oops, something went wrong.

0 comments on commit 6c7afd1

Please sign in to comment.
You can’t perform that action at this time.