-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes API Version detection unauthorized #5574
Comments
If you need any additional information please let me know & i will update / amend the issue |
I suspect you're running into the same issue I posted here: #5388 (comment) |
@shanemcd you have any ideas here? |
This is more difficult than it should be because OpenShift seems to have decided against adding support for I was attempting to identify a solution that is k8s-variant agnostic, but that may not be possible unless there is another way I'm not aware of. For the vanilla Kubernetes side, I think we should use
I worry that this formatting will change between versions of Once we identify how to get the bits we need, we'll want to remove these lines and add the variant-specific tasks to kubernetes.yml and openshift.yml. |
It is annoying the I cannot commit any time to a formal solution but the work-around, for those working with Kubernetes who are having a problem, is to replace the following three tasks (from
With (for Kubernetes v1.9 or later): -
Or (for kubernetes v1.8 or earlier): -
The logic block is just trying to define the |
I just put up #5597. Would appreciate some extra eyes / test runs. |
this issue is resolved by the changes in the above PR |
ISSUE TYPE
SUMMARY
The Kubernetes installer changes for detecting API version fail for authenticated clusters
(e68d576#diff-497ab200c9d7364c4f7d16bb0dccea4a)
ENVIRONMENT
STEPS TO REPRODUCE
Run an install against a kubernetes cluster with a secured (authenticated) api
(I'm running a cis-hardened Rancher (rke) install w/ kube version 1.14.x)
EXPECTED RESULTS
Version is obtained correctly
ACTUAL RESULTS
the task: "Get kube version from api server"
in kubernetes/tasks/main.yml
failed with a 401 due to the uri not providing credentials.
ADDITIONAL INFORMATION
A potential fix is to fall back to the old method:
block:
name: Attempt URI Version
uri:
url: "{{ kube_server | trim }}/version"
validate_certs: false
register: kube_version
name: Extract server version from command output
set_fact:
kube_api_version: "{{ kube_version.json.gitVersion[1:] }}"
rescue:
name: Get Kubernetes Config
command: |
{{ kubectl_or_oc }} version -o json
register: kube_version
name: Extract server version from command output
set_fact:
kube_api_version: "{{ (kube_version.stdout | from_json).serverVersion.gitVersion[1:] }}"
or to somehow provide auth with the uri task
The text was updated successfully, but these errors were encountered: