istioctl command is giving me error "/home/ubuntu/.kube/config" does not exist

2/15/2018

I am following up the examples which are part of istio documentation at IstioSetup I am able to install istio as in the documentation but when I try to run istioctl command example istioctl kube-inject -f samples/bookinfo/kube/bookinfo.yaml I get an error as follows

**Error: kubernetes configuration file "/home/ubuntu/.kube/config" does not exist**

I have installed the kubernetes cluster using kismatic install and have installed it multiple using different version at the end installing Kubernetes 1.9 and with and without ingress . I have tried the same in clustered version and non clustered version giving same error.

-- R-JANA
istio
kubernetes

1 Answer

2/16/2018

Kismatic generates the kubconfig file at generated/kubeconfig required for kubectl.

Either copy this file to ~/.kube/config, or

use the --kubeconfig flag to specify the location of the configuration file when using kubectl by doing:

kubectl --kubeconfig generated/kubeconfig
-- Vikram Hosakote
Source: StackOverflow