Commit 21627f5b authored by Elson O Rodriguez's avatar Elson O Rodriguez Committed by Lukasz Zajaczkowski

Made it so that existing Openstack environment variables are used.

If someone has an openrc as part of their profile, this will make kube-up work automatically. The only things that have to be modified are in config-default.sh, either by editing the file or setting environment variables.
parent 126b6c09
...@@ -15,10 +15,11 @@ ...@@ -15,10 +15,11 @@
# limitations under the License. # limitations under the License.
## Enviroment variables for the OpenStack command-line client ## Enviroment variables for the OpenStack command-line client
## Values set via an openrc will override these defaults.
export OS_IDENTITY_API_VERSION=2.0 export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-2.0}
export OS_USERNAME=admin export OS_USERNAME=${OS_USERNAME:-admin}
export OS_PASSWORD=secretsecret export OS_PASSWORD=${OS_PASSWORD:-secretsecret}
export OS_AUTH_URL=http://192.168.123.100:5000/v2.0 export OS_AUTH_URL=${OS_AUTH_URL:-http://192.168.123.100:5000/v2.0}
export OS_TENANT_NAME=admin export OS_TENANT_NAME=${OS_TENANT_NAME:-admin}
export OS_TENANT_ID=ed51b98b40944d89a449592eb67431eb export OS_TENANT_ID=${OS_TENANT_ID:-ed51b98b40944d89a449592eb67431eb}
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
# limitations under the License. # limitations under the License.
## Enviroment variables for the OpenStack Swift command-line client. This is required for CityCloud ## Enviroment variables for the OpenStack Swift command-line client. This is required for CityCloud
## provider where Swift has different credentials. When Swift is part of your OpenStack use the same ## provider where Swift has different credentials. When Swift is part of your OpenStack do not
## settings as in openrc-default.sh ## modify these settings.
export OS_IDENTITY_API_VERSION=2.0 export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-2.0}
export OS_USERNAME=admin export OS_USERNAME=${OS_USERNAME:-admin}
export OS_PASSWORD=secretsecret export OS_PASSWORD=${OS_PASSWORD:-secretsecret}
export OS_AUTH_URL=http://192.168.123.100:5000/v2.0 export OS_AUTH_URL=${OS_AUTH_URL:-http://192.168.123.100:5000/v2.0}
export OS_TENANT_NAME=admin export OS_TENANT_NAME=${OS_TENANT_NAME:-admin}
export OS_TENANT_ID=ed51b98b40944d89a449592eb67431eb export OS_TENANT_ID=${OS_TENANT_ID:-ed51b98b40944d89a449592eb67431eb}
...@@ -91,7 +91,7 @@ function create-stack() { ...@@ -91,7 +91,7 @@ function create-stack() {
echo "[INFO] Execute commands to create Kubernetes cluster" echo "[INFO] Execute commands to create Kubernetes cluster"
# It is required for some cloud provider like CityCloud where swift client has different credentials # It is required for some cloud provider like CityCloud where swift client has different credentials
source "${ROOT}/openrc-swift.sh" source "${ROOT}/openrc-swift.sh"
if [[ -z "${OS_PROJECT_ID}" ]]; then if [[ -z ${OS_PROJECT_ID+x} ]]; then
SWIFT_PROJECT_ID="${OS_TENANT_ID}" SWIFT_PROJECT_ID="${OS_TENANT_ID}"
else else
SWIFT_PROJECT_ID="${OS_PROJECT_ID}" SWIFT_PROJECT_ID="${OS_PROJECT_ID}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment