Description
- Installed Openshift 3.9
Output of oc version command shows that the kubernetes version is 1.9:
[root@ip-172-31-28-231 couchbase-operator]# oc version |
oc v3.9.14 |
kubernetes v1.9.1+a0ce1bc657 |
features: Basic-Auth GSSAPI Kerberos SPNEGO
|
|
Server https://54.219.186.129.nip.io |
openshift v3.9.14 |
kubernetes v1.9.1+a0ce1bc657 |
[root@ip-172-31-28-231 couchbase-operator]# |
- kubectl version command does not display the Server or Client Minor / Major version.
[root@ip-172-31-28-231 couchbase-operator]# kubectl version |
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v1.9.1+a0ce1bc657", GitCommit:"a0ce1bc", GitTreeState:"clean", BuildDate:"2018-03-22T21:27:02Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"} |
Server Version: version.Info{Major:"", Minor:"", GitVersion:"v1.9.1+a0ce1bc657", GitCommit:"a0ce1bc", GitTreeState:"clean", BuildDate:"2018-03-22T21:27:02Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"} |
- The deployment fails with the following errors. It seems to be getting the version as "unknown".
time="2018-04-08T23:07:18Z" level=warning msg="Unable to get server version due to %v, skipping validation registrationUnable to get version from Kubernetes API response" |
time="2018-04-08T23:07:18Z" level=error msg="Initialization failed: kubernetes version unknown is too old, 1.8 is minimum supported version " module=controller |
time="2018-04-08T23:07:18Z" level=info msg="Retry initialization in 30s..." module=controller |
time="2018-04-08T23:07:48Z" level=warning msg="Unable to get server version due to %v, skipping validation registrationUnable to get version from Kubernetes API response" |
time="2018-04-08T23:07:48Z" level=error msg="Initialization failed: kubernetes version unknown is too old, 1.8 is minimum supported version " module=controller |
time="2018-04-08T23:07:48Z" level=info msg="Retry initialization in 30s..." module=controller |
time="2018-04-08T23:05:48Z" level=error msg="Initialization failed: kubernetes version unknown is too old, 1.8 is minimum supported version " module=controller |
- I notice that there is code to handle the scenario, where if the server Major/Minor version are not populated, the operator tries to obtain the version information from the GitVersion:
// Sometimes the Major and Minor values are not set so we need to parse them
|
// from the GitVersion field.
|
|
|
if version.Major == "" || version.Minor == "" { |
rx := regexp.MustCompile("^v[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}$") |
if !rx.MatchString(version.GitVersion) { |
err := fmt.Errorf("Unable to get version from Kubernetes API response") |
return constants.KubernetesVersionUnknown, err |
}
|
parts := strings.Split(version.GitVersion[1:], ".") |
version.Major = parts[0] |
version.Minor = parts[1] |
}
|
- However this does not seem to be working as expected since the operator deployment is failing with the errors :
kubernetes version unknown is too old, 1.8 is minimum supported version " module=controller |
Let me know if you need more information.