Bug 1780982

Summary: Authentication and Authorization options are not exposed for OpenShift API server
Product: OpenShift Container Platform Reporter: Cesar Wong <cewong>
Component: openshift-apiserverAssignee: Cesar Wong <cewong>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: aos-bugs, mfojtik
Target Milestone: ---   
Target Release: 4.3.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-23 11:18:15 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 Cesar Wong 2019-12-09 01:39:45 UTC
Description of problem:
For hosted deployments, the Kubernetes API server that the OpenShift API server communicates with is not the in-cluster server, but rather an explicit kubeconfig must be specified. Recent changes in the OpenShift APIserver code only allow for the in-cluster connection to the Kube API server. CLI flags need to be exposed to allow specifying a different kubeconfig to communicate with an external Kube API server.

Version-Release number of selected component (if applicable):
4.3

How reproducible:
Always

Steps to Reproduce:
1. Start OpenShift APIServer in hosted mode (on management Kube APIserver)

Actual results:
OpenShift APIServer fails to start because it cannot communicate with a Kube APIServer

Expected results:
OpenShift APIServer starts and communicates with peer Kube APIServer.

Additional info:
To verify this, simply run the openshift-apiserver command with --help. There should be flags to allow specifying the authentication and authorization kube apiserver.

Comment 2 Xingxing Xia 2019-12-12 03:18:29 UTC
Per above hint and https://github.com/openshift/openshift-apiserver/pull/54/files#diff-3f6215a8bff8638652a2886ff35d2b5bR88 `o.Authentication.AddFlags(flags)`, and openshift/openshift-apiserver/vendor/k8s.io/apiserver/pkg/server/options/{authentication,authorization}.go def of `AddFlags`, confirmed the verification in 4.3.0-0.nightly-2019-12-10-235659 by:
oc rsh -n openshift-apiserver ds/apiserver
sh-4.2# openshift-apiserver start --help
Start an apiserver that contains the OpenShift resources
...
Flags:
      --authentication-kubeconfig string                        kubeconfig file pointing at the 'core' kubernetes server with enough rights to create tokenaccessreviews.authentication.k8s.io.
...
      --authorization-kubeconfig string                         kubeconfig file pointing at the 'core' kubernetes server with enough rights to create subjectaccessreviews.authorization.k8s.io.

Comment 4 errata-xmlrpc 2020-01-23 11:18:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0062