forked from outscale/cluster-api-provider-outscale
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6358b33
commit 4eae2ee
Showing
3 changed files
with
46 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,46 @@ | ||
settings = { | ||
"trigger_mode": "manual", | ||
"capi_version": "v1.2.1", | ||
} | ||
|
||
trigger_mode(TRIGGER_MODE_MANUAL) | ||
settings.update(read_json( | ||
"tilt-settings.json", | ||
default = {}, | ||
)) | ||
envsubst_cmd = "./bin/envsubst" | ||
update_settings(k8s_upsert_timeout_secs=60) | ||
if settings.get("trigger_mode") == "manual": | ||
trigger_mode(TRIGGER_MODE_MANUAL) | ||
|
||
docker_build(os.getenv('CONTROLLER_IMAGE', ''), '.') | ||
if "allowed_contexts" in settings: | ||
allow_k8s_contexts(settings.get("allowed_contexts")) | ||
else: | ||
allow_k8s_contexts(os.getenv('K8S_CONTEXT', 'phandalin')) | ||
|
||
if "controller_image" in settings: | ||
docker_build(settings.get("controller_image"), '.') | ||
capo_cmd = "img=" + settings.get("controller_image") + ":latest make create-capm" | ||
else: | ||
docker_build(os.getenv('CONTROLLER_IMAGE', ''), '.') | ||
capo_cmd = "IMG=" + os.getenv('CONTROLLER_IMAGE','') + ":latest make create-capm" | ||
|
||
allow_k8s_contexts(os.getenv('K8S_CONTEXT', 'phandalin')) | ||
|
||
def deploy_capi(): | ||
version = settings.get("capi_version") | ||
capi = local('kubectl get deployment -n capi-system capi-controller-manager --ignore-not-found') | ||
if not capi: | ||
capi_cmd = "MINIMUM_CLUSTERCTL_VERSION=${version} make deploy-clusterapi" | ||
local(capi_cmd) | ||
|
||
def create_capm(): | ||
capo_secret = local('kubectl get secret -n cluster-api-provider-outscale-system cluster-api-provider-outscale --ignore-not-found') | ||
if not capo_secret: | ||
if os.getenv('OSC_ACCESS_KEY', "none") == "none": | ||
print("No AK/SK secret for capo") | ||
fail("Need to have OSC_SECRET_KEY and OSC_ACCESS_KEY environement variable") | ||
else: | ||
cred_cmd = "make credential" | ||
local(cred_cmd) | ||
local(capo_cmd) | ||
deploy_capi() | ||
create_capm() | ||
k8s_yaml('capm.yaml') |
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,3 @@ | ||
{ | ||
"name": "outscale", | ||
} |