Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raz/mgmt 1765 deploy oc #84

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MGMT-1765: Added OC environment variables
Added variables to makefile, skipper and README.md
  • Loading branch information
RazRegev committed Aug 13, 2020
commit f819387376b98bf1d8fea6f70760a36bfbd0d931
18 changes: 14 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 @@ -49,6 +50,15 @@ 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)
ifneq ($(or $(OC_MODE),),)
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 -oct $(OC_TOKEN) -ocs $(OC_SERVER) --oc-scheme $(OC_SCHEME)
endif

.EXPORT_ALL_VARIABLES:


Expand Down Expand Up @@ -151,7 +161,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 @@ -162,7 +172,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 @@ -171,7 +181,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 @@ -199,7 +209,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
8 changes: 7 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,12 @@ 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 |
| OC_MODE | if set, use oc instead of minikube |
| 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