Kaustubh Dhokte 144f6fc9c5 Update certs spec to work with version v1
The change https://review.opendev.org/c/starlingx/config/+/838594
updated certificate api-version from cert-manager.io/v1alpha2 to
cert-manager.io/v1. But did not make necessary changes to certificates
specs to work with the new version.
This change makes only the required changes to certificates specs to
work with the new version: cert-manager.io/v1

The spec organization[] should now be subject:organizations[]
See the difference here,
https://cert-manager.io/v0.13-docs/reference/api-docs/#cert-manager.io/v1alpha2.Certificate
 and https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.CertificateSpec

The organization 'system:masters' in the admin.conf certificate is
required to authorize the access for kubernetes-admin to cluster objects.
This authorization is specified in the 'cluster-admin'
clusterrolebinding. Without this change, all kubectl commands fail.

In v1, unlike in v1alpha2, CN is ignored by TLS clients during
authorization (https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.CertificateSpec)
if any subject alt name is set. My initial understanding here was that
the CN field value is being ignored due to
subject:organizations:['system:masters'] (in v1), as all the deployment
and daemonset pods were failing after "system kube-rootca-pods-update
--phase=trust-new-ca" (during rootCA update) with an authorization error
for the user 'kube-apiserver-kubelet-client'.
This forces the removal of organizations from the apiserver kubelet
client certificate as all deployments and daemonset pods authenticate
and authorize with the 'kube-apiserver-kubelet-client' user.

Without 'system:nodes' in the kubelet client certificate,
kube-scheduler and kube-controller-manager fail to authorize.
More Info: https://kubernetes.io/docs/reference/access-authn-authz/node/

Test Plan:
On CentOS AIO-SX:
PASS: Manual kubernetes RootCA update successful
PASS: Orchestrated kubernetes RootCA update successful.
PASS: All deployments, daemonsets and pods running as expected after
      RootCA update.

Closes-Bug: 1978365

Signed-off-by: Kaustubh Dhokte <kaustubh.dhokte@windriver.com>
Change-Id: I767a70a07ab540510e4eb734cb4e282c9918840c
2022-06-14 18:02:24 +00:00
2022-05-31 13:56:30 +00:00
2019-04-19 19:52:42 +00:00
2022-03-25 20:32:09 +00:00
2021-08-27 08:39:06 -04:00
2021-07-22 08:29:23 -04:00
2021-07-22 08:29:23 -04:00
2018-05-31 07:35:52 -07:00

stx-config

StarlingX Configuration Management

Description
StarlingX System Configuration Management
Readme 89 MiB
Languages
Python 97.6%
Shell 2%
CSS 0.2%