0

Openshift provides update way which updates the whole platform in a live way. while i (perhaps others also)have needs to just update some specific components.

It's ok to update component such as console, openshift-apiserver with new container image by managing operator and setting image correspondingly. For example, to update openshift-apiservercomponent, the following steps do work:

  1. disable the management of openshift apiserver operator

#oc patch openshiftapiservers.operator.openshift.io cluster --patch '{ "spec": { "managementState": "Unmanaged" } }' --type=merge

  1. set a new conainer image for openshift apiserver deployment

#oc set image deploy apiserver openshift-apiserver=registry.somecorp.com:5000/ocp4/openshift4:openshfit-apiserver-4.4.4-t1 -n openshift-apiserverb

  1. check and wait for the rollout status

#oc rollout status -w deploy/apiserver -n openshift-apiserver

While for the base kube-apiserver component, things are different. Firstly, The way to disable related operator does not work, it seems kubeapiserver operator does not support the "Unmanaged" feature.

#oc patch kubeapiserver.operator.openshift.io cluster --patch '{ "spec": b { "managementState": "Unmanaged" } }' --type=merge The KubeAPIServer "cluster" is invalid: spec.managementState: Invalid value: "": spec.managementState in body should match '^(Managed|Force)$'

Secondly, instead of deployment, it seems just pods are used for kube-apiserver. while there is way to set image for a specific pod/container, i don't figure out how to apply the setting.

#oc set image pod kube-apiserver-master-0 kube-apiserver=registry.somecorp.com:5000/ocp4/openshift4:hyperkube-t1 -n openshift-kube-apiserver b pod/kube-apiserver-master-0 image updated

Is there someone who could help me figure out an approach to manually update kube-apiserver in a openshift system? Thanks for any information.

1 Answers1

1

Using option A described here(https://github.com/openshift/enhancements/blob/master/enhancements/operator-dev-doc.md), kube-apiserver component can be really updated for a running cluster.