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

Bug 1452092

Summary: no kind "AdmissionConfiguration" is registered for version "apiserver.k8s.io/v1alpha1"
Product: OpenShift Container Platform Reporter: DeShuai Ma <dma>
Component: NodeAssignee: Stefan Schimanski <sttts>
Status: CLOSED ERRATA QA Contact: DeShuai Ma <dma>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, jokerman, mmccomas, smunilla, wmeng
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/openshift/origin/pull/14272
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-10 05:24:06 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 DeShuai Ma 2017-05-18 10:41:21 UTC
Description of problem:
In ocp35 we can configure PodNodeSelector admission controller in master-config.yaml like below:
admissionConfig:
  pluginConfig:
    PodNodeSelector:
      location: admission-control-config-file.cfg
# cat admission-control-config-file.cfg
podNodeSelectorPluginConfig:
 clusterDefaultNodeSelector: region=west

But now in ocp36(v3.6.74), this failed with error: "start_master.go:112] Object 'Kind' is missing in '{"podNodeSelectorPluginConfig":{"clusterDefaultNodeSelector":"region=west"}}'"
I notice there is a pr to support versioned configuration: https://github.com/kubernetes/kubernetes/pull/39109

According to the new file type, I try to configure like:
apiVersion: apiserver.k8s.io/v1alpha1
kind: AdmissionConfiguration
plugins:
- name: "PodNodeSelector:"
  configuration:
    apiVersion: podnodeselector.admission.k8s.io/v1alpha1
    kind: Configuration
    podNodeSelectorPluginConfig:
      clusterDefaultNodeSelector: region=west

or

apiVersion: apiserver.k8s.io/v1alpha1
kind: AdmissionConfiguration
plugins:
- name: "PodNodeSelector:"
  configuration:
    apiVersion: podnodeselector.admission.k8s.io/v1alpha1
    kind: Configuration
    clusterDefaultNodeSelector: region=west

But both I get another error: start_master.go:112] no kind "AdmissionConfiguration" is registered for version "apiserver.k8s.io/v1alpha1"

Version-Release number of selected component (if applicable):
openshift v3.6.74
kubernetes v1.6.1+5115d708d7
etcd 3.1.0

How reproducible:
Always


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Stefan Schimanski 2017-05-22 11:56:32 UTC
The old format is actually supposed to work, but doesn't due to a bug. Here is a PR to allow legacy admission plugin config without a Kind: https://github.com/openshift/origin/pull/14272

Comment 3 Stefan Schimanski 2017-05-29 08:49:27 UTC
Fixed on origin master.

Comment 5 DeShuai Ma 2017-06-14 06:09:09 UTC
Verified on openshift v3.6.106

1. Configure PodNodeSelector admission controller like below and it works well.
admissionConfig:
  pluginConfig:
    PodNodeSelector:
      location: admission-control-config-file.cfg
# cat admission-control-config-file.cfg
podNodeSelectorPluginConfig:
 clusterDefaultNodeSelector: region=west

2. If admission-control-config-file.cfg contain AdmissionConfiguration restart master service, no error
admissionConfig:
  pluginConfig:
    PodNodeSelector:
      location: admission-control-config-file.cfg
# cat admission-control-config-file.cfg 
apiVersion: apiserver.k8s.io/v1alpha1
kind: AdmissionConfiguration
plugins:
- name: "PodNodeSelector"
  configuration:
    apiVersion: podnodeselector.admission.k8s.io/v1alpha1
    kind: Configuration
    podNodeSelectorPluginConfig:
      clusterDefaultNodeSelector: region=west

Comment 7 errata-xmlrpc 2017-08-10 05:24:06 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/RHEA-2017:1716