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 […]
Kubernetes
How to schedule master node running pod/service as a worker node
Question: How can I schedule master node running pod/service as worker node? By deafult, only worker node could run the pod, master only response for the scheduler/configuration. $ kubectl get nodes -o json | jq .items[].spec.taints [ { “effect”: “NoSchedule”, “key”: “node-role.kubernetes.io/master” } ] $ kubectl get nodes -o json | grep master “node-role.kubernetes.io/master”: “” […]
Endpoint is not Created for Service in Kubernetes
The Problem Endpoints shows ‘none’: $ kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.yy.0.1 <none> 443/TCP 9d test ClusterIP 10.xx.97.97 <none> 6379/TCP 21s $ kubectl describe svc test Name: test Namespace: default Labels: <none> Annotations: kubectl.kubernetes.io/last-applied-configuration: {“apiVersion”:”v1″,”kind”:”Service”,”metadata”:{“annotations”:{},”name”:”test”,”namespace”:”default”},”spec”:{“clusterIP”:”10.xx.97.97″,”… Selector: app=test Type: ClusterIP IP: 10.xx.97.97 Port: <unset> 6379/TCP TargetPort: 6379/TCP Endpoints: <none> Session […]
Troubleshooting kubectl Error: The connection to the server x.x.x.x:6443 was refused – did you specify the right host or port?
This document describes steps to troubleshoot kubectl error: The connection to the server x.x.x.x:6443 was refused – did you specify the right host or port? 1. The kubectl should be executed on the Master Node. 2. Current user must have Kubernetes cluster configuration environment variable (Details of how to are listed under section Preparing to […]