Add explicit cluster_url with oc login #150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue I've hit recently when trying to deploy latest 3.7 origin builds with our ec2 scripts which replace the cluster cert with letsencrypt signed certificates. I think the replacement of the CA may be causing issues.
I changed these variables in my_vars.yml
origin_image_tag: latest
openshift_client_version: latest
./run_setup_environment.sh
...
...
TASK [openshift_setup : Login as admin] *******************************************************************************
fatal: [34.233.221.91]: FAILED! => {"changed": true, "cmd": "/usr/bin/oc login -u admin -p admin", "delta": "0:00:00.177283", "end": "2017-10-01 13:56:55.907736", "failed": true, "rc": 1, "start": "2017-10-01 13:56:55.730453", "stderr": "error: x509: certificate signed by unknown authority", "stderr_lines": ["error: x509: certificate signed by unknown authority"], "stdout": "", "stdout_lines": []}
If I log into the instance I see same error trying to execute "oc login":
[ec2-user@ip-10-0-0-70 ~]$ sudo su -
[root@ip-10-0-0-70 ~]# oc login
error: x509: certificate signed by unknown authority
Part of the problem was that the default context specified the 127.0.0.1 entry in ~/.kube/config, so I added an explicit cluster_url.
Have tested this with both ec2 and local/linux deployments.