Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1868468

Summary: [Assisted-4.5-M2] assisted-installer namespace seems to be hardcoded
Product: OpenShift Container Platform Reporter: Alexander Chuzhoy <sasha>
Component: assisted-installerAssignee: Michael Filanov <mfilanov>
assisted-installer sub component: assisted-service QA Contact: Yuri Obshansky <yobshans>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: high    
Priority: unspecified CC: aos-bugs, vlaad
Version: 4.5   
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-25 21:23:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Chuzhoy 2020-08-12 18:52:48 UTC
[Assisted-4.5-M2] assisted-installer namespace seems to be hardcoded


Executed:
export NAMESPACE=ocp-edge-qe;
make deploy-all TARGET=oc-ingress APPLY_NAMESPACE=False INGRESS_DOMAIN=edge-qe.apps.ocp.prod.psi.redhat.com NAMESPACE=ocp-edge-qe

Expected the namespace to be ocp-edge-qe.
Yet in the output I see "assisted-installer":

[root@sealusa35 assisted-service]# export NAMESPACE=ocp-edge-qe;  make deploy-all TARGET=oc-ingress APPLY_NAMESPACE=False INGRESS_DOMAIN=edge-qe.apps.ocp.prod.psi.redhat.com NAMESPACE=ocp-edge-qe
mkdir -p /root/assisted-service/build
python3 ./tools/deploy_namespace.py --deploy-namespace False --namespace "ocp-edge-qe"
Not deploying namespace
python3 ./tools/deploy_postgres.py --namespace "ocp-edge-qe"
Deploying /root/assisted-service/build/postgres-secret.yaml
secret/assisted-installer-rds configured

Deploying /root/assisted-service/build/postgres-deployment.yaml
deployment.apps/postgres created
service/postgres created

Error from server (Forbidden): persistentvolumeclaims "postgres-pv-claim" is forbidden: User "achuzhoy" cannot get resource "persistentvolumeclaims" in API group "" in the namespace "assisted-installer"
Using default size 10Gi
Deploying /root/assisted-service/build/postgres-storage.yaml
persistentvolumeclaim/postgres-pv-claim unchanged

python3 ./tools/deploy_s3.py --namespace "ocp-edge-qe"
Deploying /root/assisted-service/build/scality-deployment.yaml
deployment.apps/scality created
service/cloudserver-front created

Deploying /root/assisted-service/build/scality-storage.yaml
persistentvolumeclaim/scality-pv-claim unchanged

sleep 5;  # wait for service to get an address
make deploy-s3-secret
make[1]: Entering directory '/root/assisted-service'
python3 ./tools/deploy_scality_configmap.py --namespace "ocp-edge-qe"
Deploying /root/assisted-service/build/scality-secret.yaml
secret/assisted-installer-s3 configured

make[1]: Leaving directory '/root/assisted-service'
python3 ./tools/deploy_route53.py --secret "" --namespace "ocp-edge-qe"
python3 ./tools/deploy_inventory_service.py --target "oc-ingress" --domain "edge-qe.apps.ocp.prod.psi.redhat.com" --namespace "ocp-edge-qe"
Deploying /root/assisted-service/build/assisted-service-service.yaml
service/assisted-service created

Deploying /root/assisted-service/build/assisted-installer-ingress.yaml
ingress.networking.k8s.io/assisted-installer configured

sleep 5;  # wait for service to get an address
python3 ./tools/deploy_assisted_installer_configmap.py --target "oc-ingress" --domain "edge-qe.apps.ocp.prod.psi.redhat.com" --base-dns-domains "" --namespace "ocp-edge-qe"  --enable-auth "False"
Deploying /root/assisted-service/build/assisted-service-configmap.yaml
installer-image-build image for deployment: quay.io/ocpmetal/installer-image-build:latest
assisted-ignition-generator image for deployment: quay.io/ocpmetal/assisted-ignition-generator:latest
ignition-manifests-and-kubeconfig-generate image for deployment: quay.io/ocpmetal/ignition-manifests-and-kubeconfig-generate:latest
assisted-installer image for deployment: quay.io/ocpmetal/assisted-installer:latest
assisted-installer-controller image for deployment: quay.io/ocpmetal/assisted-installer-controller:latest
assisted-installer-agent image for deployment: quay.io/ocpmetal/assisted-installer-agent:latest
assisted-installer-agent image for deployment: quay.io/ocpmetal/assisted-installer-agent:latest
assisted-installer-agent image for deployment: quay.io/ocpmetal/assisted-installer-agent:latest
assisted-service image for deployment: quay.io/ocpmetal/assisted-service:latest
configmap/assisted-service-config configured

python3 ./tools/deploy_role.py --namespace "ocp-edge-qe"
Deploying /root/assisted-service/build/default_role.yaml
serviceaccount/default unchanged
role.rbac.authorization.k8s.io/default unchanged
rolebinding.rbac.authorization.k8s.io/default unchanged

python3 ./tools/deploy_assisted_installer.py  --namespace "ocp-edge-qe" 
assisted-service image for deployment: quay.io/ocpmetal/assisted-service:latest
Deploying /root/assisted-service/build/assisted-service.yaml
deployment.apps/assisted-service created

python3 ./tools/wait_for_assisted_service.py --target oc-ingress --namespace "ocp-edge-qe"
I0812 14:49:40.806589    9409 request.go:621] Throttling request took 1.147323204s, request: GET:https://api.ocp.prod.psi.redhat.com:6443/apis/serving.knative.dev/v1?timeout=32s
Error from server (Forbidden): ingresscontrollers.operator.openshift.io is forbidden: User "achuzhoy" cannot list resource "ingresscontrollers" in API group "operator.openshift.io" in the namespace "openshift-ingress-operator"
Traceback (most recent call last):
  File "./tools/wait_for_assisted_service.py", line 44, in <module>
    main()
  File "./tools/wait_for_assisted_service.py", line 33, in main
    service_url = utils.get_service_url(SERVICE, deploy_options.target, deploy_options.domain, deploy_options.namespace)
  File "/root/assisted-service/tools/utils.py", line 44, in get_service_url
    service_host = f"{service}.{get_domain(domain)}"
  File "/root/assisted-service/tools/utils.py", line 60, in get_domain
    return check_output(cmd).split()[-1]
  File "/root/assisted-service/tools/utils.py", line 15, in check_output
    return subprocess.check_output(cmd, shell=True).decode("utf-8")
  File "/usr/lib64/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'kubectl -n assisted-installer get ingresscontrollers.operator.openshift.io -n openshift-ingress-operator -o custom-columns=:.status.domain' returned non-zero exit status 1.
make: *** [Makefile:138: deploy-service] Error 1

The failure was reported in another bug.
This one is just for the hardcoded namespace.

Comment 1 Michael Filanov 2020-08-12 19:07:09 UTC
https://github.com/openshift/assisted-service/pull/117

Comment 2 Yuri Obshansky 2020-08-19 21:03:24 UTC
Verified on master August 19, 2020