Error installing kubectl on self hosted gitlab on ubuntu

1/2/2019

I have installed Gitlab on a Ubuntu 16.04 machine. Gitlab is working fine. Now, I am trying to install kubectl on the same machine. But getting an issue on command:

$ kubectl cluster-info dump

error: serializer for text/html; charset=utf-8 doesn't exist
-- Mihir Shah
gitlab
kubectl
kubernetes

1 Answer

1/2/2019

Looks like kubectl is talking to something else that is not your kube-apiserver. Make sure your ~/.kube/config file looks something like this and points to the right kube-apiserver:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <REDACTED>
    server: https://10.10.10.1:6443 <== This needs to point to the right kube-apiserver address
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    namespace: default
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: <REDACTED>
    client-key-data: <REDACTED>
-- Rico
Source: StackOverflow