Skip to content

Commit

Permalink
MGMT-1765: Added environment variable
Browse files Browse the repository at this point in the history
Added variables to makefile, skipper and README.md
  • Loading branch information
RazRegev committed Aug 11, 2020
1 parent dc50454 commit 9add671
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SKIPPER_PARAMS ?= -i
SERVICE_BRANCH := $(or $(SERVICE_BRANCH), "master")
SERVICE_REPO := $(or $(SERVICE_REPO), "https://github.com/openshift/assisted-service")
SERVICE := $(or $(SERVICE), quay.io/ocpmetal/assisted-service:latest)
SERVICE_NAME := $(or $(SERVICE_NAME),assisted-service)

# nodes params
ISO := $(or $(ISO), "") # ISO should point to a file that has the '.iso' extension. Otherwise deploy will fail!
Expand Down Expand Up @@ -53,6 +54,18 @@ DEPLOY_TAG := $(or $(DEPLOY_TAG), "")
IMAGE_NAME=test-infra
IMAGE_REG_NAME=quay.io/itsoiref/$(IMAGE_NAME)

# oc deploy
KUBECONFIG := $(or $(KUBECONFIG),${HOME}/.kube/config)
OC_MODE := $(or $(OC_MODE),)
ifneq ($(OC_MODE),)
OC_USER := $(or $(OC_USER),"")
OC_PASS := $(or $(OC_PASS),"")
OC_TOKEN := $(or $(OC_TOKEN),"")
OC_SERVER := $(or $(OC_SERVER),https://api.ocp.prod.psi.redhat.com:6443)
OC_SCHEME := $(or $(OC_SCHEME),http)
OC_PARAMS = --oc-mode -ocu $(OC_USER) -ocp $(OC_PASS) -oct $(OC_TOKEN) -ocs $(OC_SERVER) --oc-scheme $(OC_SCHEME)
endif

.EXPORT_ALL_VARIABLES:


Expand Down Expand Up @@ -155,7 +168,7 @@ kill_all_port_forwardings:
###########

_install_cluster:
discovery-infra/install_cluster.py -id $(CLUSTER_ID) -ps '$(PULL_SECRET)' -ns $(NAMESPACE)
discovery-infra/install_cluster.py -id $(CLUSTER_ID) -ps '$(PULL_SECRET) --service-name $(SERVICE_NAME) $(OC_PARAMS)' -ns $(NAMESPACE)

install_cluster:
skipper make _install_cluster NAMESPACE=$(NAMESPACE) $(SKIPPER_PARAMS)
Expand All @@ -166,7 +179,7 @@ install_cluster:
#########

_deploy_nodes:
discovery-infra/start_discovery.py -i $(ISO) -n $(NUM_MASTERS) -p $(STORAGE_POOL_PATH) -k '$(SSH_PUB_KEY)' -md $(MASTER_DISK) -wd $(WORKER_DISK) -mm $(MASTER_MEMORY) -wm $(WORKER_MEMORY) -nw $(NUM_WORKERS) -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -vN $(NETWORK_CIDR) -nN $(NETWORK_NAME) -nB $(NETWORK_BRIDGE) -nM $(NETWORK_MTU) -ov $(OPENSHIFT_VERSION) -rv $(RUN_WITH_VIPS) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) $(ADDITIONAL_PARAMS)
discovery-infra/start_discovery.py -i $(ISO) -n $(NUM_MASTERS) -p $(STORAGE_POOL_PATH) -k '$(SSH_PUB_KEY)' -md $(MASTER_DISK) -wd $(WORKER_DISK) -mm $(MASTER_MEMORY) -wm $(WORKER_MEMORY) -nw $(NUM_WORKERS) -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -vN $(NETWORK_CIDR) -nN $(NETWORK_NAME) -nB $(NETWORK_BRIDGE) -nM $(NETWORK_MTU) -ov $(OPENSHIFT_VERSION) -rv $(RUN_WITH_VIPS) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) --service-name $(SERVICE_NAME) $(OC_PARAMS) $(ADDITIONAL_PARAMS)

deploy_nodes_with_install:
skipper make _deploy_nodes NAMESPACE=$(NAMESPACE) ADDITIONAL_PARAMS=-in $(SKIPPER_PARAMS)
Expand All @@ -175,7 +188,7 @@ deploy_nodes:
skipper make _deploy_nodes NAMESPACE=$(NAMESPACE) $(SKIPPER_PARAMS)

destroy_nodes:
skipper run 'discovery-infra/delete_nodes.py -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -ns $(NAMESPACE)' $(SKIPPER_PARAMS)
skipper run 'discovery-infra/delete_nodes.py -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -ns $(NAMESPACE) --service-name $(SERVICE_NAME) $(OC_PARAMS)' $(SKIPPER_PARAMS)

redeploy_nodes: destroy_nodes deploy_nodes

Expand Down Expand Up @@ -203,7 +216,7 @@ delete_all_virsh_resources: destroy_nodes delete_minikube
#######

_download_iso:
discovery-infra/start_discovery.py -k '$(SSH_PUB_KEY)' -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -ov $(OPENSHIFT_VERSION) -pU $(PROXY_URL) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) -iO
discovery-infra/start_discovery.py -k '$(SSH_PUB_KEY)' -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -ov $(OPENSHIFT_VERSION) -pU $(PROXY_URL) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) --service-name $(SERVICE_NAME) $(OC_PARAMS) -iO

download_iso:
skipper make _download_iso NAMESPACE=$(NAMESPACE) $(SKIPPER_PARAMS)
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Check the [Install Guide](GUIDE.md) for installation instructions.
| CLUSTER_ID | cluster id , used for install_cluster command, default: the last spawned cluster |
| NETWORK_NAME | virsh network name for VMs creation, default: test-infra-net |
| NETWORK_BRIDGE | network bridge to use while creating virsh network, default: tt0 |
| OPENSHIFT_VERSION | OpenShift version to install, default: "4.4" |
| OPENSHIFT_VERSION | OpenShift version to install, default: "4.5" |
| PROXY_URL | proxy URL that will be pass to live cd image |
| SERVICE_BASE_URL | update assisted-service config map SERVICE_BASE_URL parameter with given URL, including port and protocol |
| AGENT_DOCKER_IMAGE | agent docker image to use, will update assisted-service config map with given value |
Expand All @@ -82,6 +82,15 @@ Check the [Install Guide](GUIDE.md) for installation instructions.
| CONNECTIVITY_CHECK_IMAGE | connectivity-check image to use, will update assisted-service config map with given value |
| HARDWARE_INFO_IMAGE | hardware-info image to use, will update assisted-service config map with given value |
| INVENTORY_IMAGE | assisted-service image to be updated in assisted-service config map with given value |
| OPENSHIFT_RELEASE_IMAGE | openshift client release image, default: https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.5/linux/oc.tar.gz |
| OC_MODE | if set, use oc instead of minikube |
| OC_USER | username for oc login |
| OC_PASS | password for oc login |
| OC_TOKEN | token for oc login (an alternative for oc-user & oc-pass) |
| OC_SERVER | server for oc login, required if oc-token is provided, default: https://api.ocp.prod.psi.redhat.com:6443 |
| OC_SCHEME | Scheme for assisted-service url on oc, default: http |
| SERVICE_NAME | assisted-service target service name, default: assisted-service |
| KUBECONFIG | kubeconfig file path, default: <home>/.kube/config |

## Instructions

Expand Down
2 changes: 2 additions & 0 deletions skipper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ env:
CONNECTIVITY_CHECK_IMAGE: $CONNECTIVITY_CHECK_IMAGE
HARDWARE_INFO_IMAGE: $HARDWARE_INFO_IMAGE
INVENTORY_IMAGE: $INVENTORY_IMAGE
SERVICE_NAME: $SERVICE_NAME
OC_PARAMS: $OC_PARAMS

0 comments on commit 9add671

Please sign in to comment.