Bug 1798048

Summary: Revision suffix in control plane static pods makes it hard to debug
Product: OpenShift Container Platform Reporter: Michal Fojtik <mfojtik>
Component: kube-apiserverAssignee: Michal Fojtik <mfojtik>
Status: CLOSED ERRATA QA Contact: Ke Wang <kewang>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.4CC: aos-bugs, mfojtik, xxia
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: The static pod containers in control plane components should have deterministic name, so kubectl logs works for them without need of knowing the revision suffix. Reason: The revision suffix makes it hard to debug. Result: The revision suffix was removed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-04 11:33:07 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 Michal Fojtik 2020-02-04 13:29:12 UTC
Description of problem:

The revision number in kube apiserver and controller manager pods make it harder to get logs from these pods as one have to know the current revision.

The revision was initially added them because we were failing in ways that required getting on hosts without kube-apiserver access and figuring out which revision was available. We fixed it later by adding information in the static pod on disk.


Actual results:

$ oc logs kube-apiserver-ip-10-0-128-147.ec2.internal -n openshift-kube-apiserver
error: a container name must be specified for pod kube-apiserver-ip-10-0-128-147.ec2.internal, choose one of: [kube-apiserver-11 kube-apiserver-cert-syncer-11 kube-apiserver-cert-regeneration-controller-11 kube-apiserver-insecure-readyz-11] or one of the init containers: [setup]


Expected results:

$ oc logs kube-apiserver-ip-10-0-128-147.ec2.internal -n openshift-kube-apiserver
error: a container name must be specified for pod kube-apiserver-ip-10-0-128-147.ec2.internal, choose one of: [kube-apiserver kube-apiserver-cert-syncer kube-apiserver-cert-regeneration-controller kube-apiserver-insecure-readyz] or one of the init containers: [setup]

Eventually:

$ oc logs kube-apiserver-ip-10-0-128-147.ec2.internal -n openshift-kube-apiserver -c kube-apiserver

Additional info:

Comment 2 Xingxing Xia 2020-02-07 10:58:13 UTC
First, thx for Dev report the bug following the pre-filled sections with clear enough steps. We didn't often see this :) and therefore sometimes Dev reported non-simple bugs are a bit too short in description for us to quickly verifyt :)

> ... one have to know the current revision ...
> oc logs kube-apiserver-ip-10-0-128-147.ec2.internal -n openshift-kube-apiserver
> error: a container name ... choose one of: [kube-apiserver-11
Since once fails, it prompts the revision, so I thought not hard to debug, though :)

> ... We fixed it later by adding information in the static pod
Ke Wang, also check the revision info in pod yaml when verifying above cmd's failure gone

Comment 3 Xingxing Xia 2020-02-11 02:56:33 UTC
Verified kas, ks, kcm static pods in latest 4.4 nightly build 4.4.0-0.nightly-2020-02-10-035806 as per comment 2, container name is "kube-apiserver" without the changing revision, revision info is in static pod yaml as before

Comment 5 errata-xmlrpc 2020-05-04 11:33:07 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:0581