davidB / kubectl-view-allocations

kubectl plugin to list allocations (cpu, memory, gpu,... X utilization, requested, limit, allocatable,...)

Home Page:https://crates.io/crates/kubectl-view-allocations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error trying to connect: The certificate was not trusted

low-on-mana opened this issue · comments

$  kubectl-view-allocations -g resource
[2019-12-18T17:03:06Z ERROR kubectl_view_allocations] failed
    cli: CliOpts { namespace: None, show_zero: false, resource_name: [], group_by: [resource] }
    error: ReqwestError: error sending request for url (https://***************/api/v1/nodes?): error trying to connect: The certificate was not trusted.

    Caused by:
        0: error sending request for url (https://***************/api/v1/nodes?): error trying to connect: The certificate was not trusted.
        1: error trying to connect: The certificate was not trusted.
        2: The certificate was not trusted.

Get pods is working with my kubeconfig though. Also noticed a typo in above error.

$ kubectl get pods
NAME                                                     READY   STATUS    RESTARTS   AGE
***************-586b47d996-58wmz                       1/1     Running   0          5h21m

Sorry for the issue, it seems related to kube-rs/kube#89.

Can you share after some obfuscation what look like your $HOME/.kube/config (I mainly need the key to have an idea of what kind of config I should reproduce, to be able to fix) ?

Thanks for give a try and reporting the bug

apiVersion: v1
clusters:
- cluster:
    certificate-authority: /Users/anoop/.minikube/ca.crt
    server: https://192.168.64.2:8443
  name: minikube
- cluster:
    certificate-authority-data: ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
    server: https://************************.in
  name: ********************.in
- cluster:
    certificate-authority-data: ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
    server: https://**********************.in
  name: ******************.in
contexts:
- context:
    cluster: minikube
    user: minikube
  name: minikube
- context:
    cluster: ********************.in
    namespace: dev
    user: ********************.in
  name: non-prod
- context:
    cluster: ******************.in
    namespace: default
    user: ******************.in
  name: spike
current-context: non-prod
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: /Users/anoop/.minikube/client.crt
    client-key: /Users/anoop/.minikube/client.key
- name: ********************.in
  user:
    client-certificate-data: *******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************=
    client-key-data: **************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************==
    password: ********************************
    username: *****
- name: **********************************
  user:
    password: ********************************
    username: *****
- name: ******************.in
  user:
    client-certificate-data: *******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************=
    client-key-data: **************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************==
    password: ********************************
    username: admin
- name: ********************************
  user:
    password: ********************************
    username: *****

Had to * everything

Non minikube is in aws. Yes I am having error with all except minikube.

Are you on mac OSX Catalina ?

Are you on mac OSX Catalina ?

Yes @davidB

Thanks for your help.

FYI I provide the result of my investigation in the ticket of kube-rs linked above, and will discuss the workaround on it.

Can you try the version 0.6.1 (also available via krew) ?

v0.6.1 works with no errors.
I was unable to install it with cargo though.

    Replaced package `kubectl-view-allocations v0.6.0` with `kubectl-view-allocations v0.6.0` (executable `kubectl-view-allocations`)
error: could not find `v0.6.1` in registry `https://github.com/rust-lang/crates.io-index`
     Summary Successfully installed kubectl-view-allocations! Failed to install v0.6.1 (see error(s) above).

Had to install it with krew finally.