• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

New User Failed Run Kubectl with Error “The connection to the server xxx.xxx.xxx was refused – did you specify the right host or port?”

by admin

The Problem

When run kubectl from a new created user, failed with error:

The connection to the server xxx.xxx.xxx was refused - did you specify the right host or port?

The Solution

A newly created user has no KUBECONFIG configured. Setup kubernetes configuration for the new user:

# mkdir -p $HOME/.kube
# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
# sudo chown $(id -u):$(id -g) $HOME/.kube/config

Filed Under: DevOps, Kubernetes

Some more articles you might also be interested in …

  1. Understanding Variables in Bash Shell Under Linux
  2. Beginners Guide to Using “trap” to Catch Signals and Handle Errors in Shell Script
  3. How to find docker storage device and its size (device mapper storage driver)
  4. How to install docker on CentOS / RHEL / Fedora
  5. Unable to run NGINX Docker due to “13: Permission denied”
  6. Introduction to sed (Stream Editor) : Useful sed Command Examples
  7. How to Install awscli
  8. How to configure docker to use proxy
  9. How to check the status and space used by images and containers
  10. Install AzCopy on Linux – Fastest way to copy in Azure

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright