Skip to content

Commit

Permalink
kola/tests/kubernetes: Use correct GCE variable
Browse files Browse the repository at this point in the history
Use the private IP because the default firewall
rules do not allow incoming traffic on 2379 for
the public IP.
Also, there are no FLATCAR_*_IP* variables set up in
/etc/environment for machines running in
Google Compute Engine because (as with afterburn)
the prefix is still COREOS_.
  • Loading branch information
pothos committed Mar 6, 2020
1 parent d2af3d8 commit b68e0fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions kola/tests/kubernetes/controllerInstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package kubernetes

// https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic.
// The only change besides paramaterizing the env vars was:
// s/FLATCAR_PUBLIC_IP/FLATCAR_PRIVATE so this works on GCE.
// s/COREOS_PUBLIC_IP/COREOS_PRIVATE_IPV4 so this works on GCE.
const controllerInstallScript = `#!/bin/bash
set -e
Expand Down Expand Up @@ -54,7 +54,7 @@ function init_config {
fi
if [ -z $ADVERTISE_IP ]; then
export ADVERTISE_IP=$(awk -F= '/FLATCAR_PRIVATE_IPV4/ {print $2}' /etc/environment)
export ADVERTISE_IP=$(awk -F= '/COREOS_PRIVATE_IPV4/ {print $2}' /run/metadata/flatcar)
fi
for REQ in "${REQUIRED[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion kola/tests/kubernetes/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func runInstallScript(c cluster.TestCluster, m platform.Machine, script string,
var (
etcdConfig = conf.ContainerLinuxConfig(`
etcd:
advertise_client_urls: http://{PUBLIC_IPV4}:2379
advertise_client_urls: http://{PRIVATE_IPV4}:2379
listen_client_urls: http://0.0.0.0:2379
systemd:
units:
Expand Down
4 changes: 2 additions & 2 deletions kola/tests/kubernetes/workerInstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package kubernetes

// https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic.
// The only change besides paramaterizing the env vars was:
// s/FLATCAR_PUBLIC_IP/FLATCAR_PRIVATE so this works on GCE.
// s/COREOS_PUBLIC_IP/COREOS_PRIVATE_IPV4 so this works on GCE.
const workerInstallScript = `#!/bin/bash
set -e
Expand Down Expand Up @@ -43,7 +43,7 @@ function init_config {
fi
if [ -z $ADVERTISE_IP ]; then
export ADVERTISE_IP=$(awk -F= '/FLATCAR_PRIVATE_IPV4/ {print $2}' /etc/environment)
export ADVERTISE_IP=$(awk -F= '/COREOS_PRIVATE_IPV4/ {print $2}' /run/metadata/flatcar)
fi
for REQ in "${REQUIRED[@]}"; do
Expand Down

0 comments on commit b68e0fd

Please sign in to comment.