-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kfctl: existing_arrikto: initial e2e test
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
- Loading branch information
1 parent
2f15d8d
commit 4f92110
Showing
8 changed files
with
141 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export PROJECT="kubeflow-ci" | ||
export GCP_ZONE="us-central1-a" | ||
export GCP_USER="$(gcloud config list account --format "value(core.account)" )" | ||
export GCP_PROJECT="$(gcloud config list project --format "value(core.project)" )" | ||
export CLUSTER_NAME="kfctl-existing-arrikto-cluster" | ||
export CLUSTER_VERSION="$(gcloud container get-server-config --zone=${GCP_ZONE} --format="value(validMasterVersions[0])" )" | ||
|
||
############################ | ||
# Create and setup cluster # | ||
############################ | ||
|
||
gcloud container clusters create "${CLUSTER_NAME}" \ | ||
--project "${GCP_PROJECT}" \ | ||
--zone "${GCP_ZONE}" \ | ||
--username "admin" \ | ||
--cluster-version "${CLUSTER_VERSION}" \ | ||
--machine-type "n1-standard-4" --num-nodes "1" \ | ||
--image-type "UBUNTU" \ | ||
--local-ssd-count=4 \ | ||
--disk-type "pd-ssd" --disk-size "50" \ | ||
--no-enable-cloud-logging --no-enable-cloud-monitoring \ | ||
--no-enable-ip-alias \ | ||
--enable-network-policy \ | ||
--enable-autoupgrade --enable-autorepair | ||
|
||
echo "Getting credentials for newly created cluster..." | ||
gcloud container clusters get-credentials "${CLUSTER_NAME}" --zone="${GCP_ZONE}" | ||
|
||
echo "Setting up GKE RBAC..." | ||
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user="${GCP_USER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
import os | ||
import pytest | ||
|
||
from kubeflow.testing import util | ||
|
||
|
||
def test_create_existing_cluster(cluster_creation_script): | ||
if not cluster_creation_script: | ||
logging.fatal("--script to create cluster was not provided.") | ||
|
||
# Need to activate account for scopes. | ||
if os.getenv("GOOGLE_APPLICATION_CREDENTIALS"): | ||
util.run([ | ||
"gcloud", "auth", "activate-service-account", | ||
"--key-file=" + os.environ["GOOGLE_APPLICATION_CREDENTIALS"] | ||
]) | ||
|
||
logging.info("Deleting existing cluster...") | ||
util.run(["gcloud", "container", "clusters", "delete", | ||
"kfctl-existing-arrikto-cluster", "--zone", "us-central1-a"]) | ||
|
||
|
||
if __name__ == "__main__": | ||
logging.basicConfig( | ||
level=logging.INFO, | ||
format=("%(levelname)s|%(asctime)s" | ||
"|%(pathname)s|%(lineno)d| %(message)s"), | ||
datefmt="%Y-%m-%dT%H:%M:%S", | ||
) | ||
logging.getLogger().setLevel(logging.INFO) | ||
pytest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters