Nov 6, 2019

Kubernetes nslookup on AWS

Hi

I had the following cluster of kubernetes 1.16.
3 Nodes, 1 master and 2 other workers.
Tried to do nslookup from the master to the 'kubernetes'

using the following : 

'kubectl exec -it busybox -- nslookup kubernetes'
(ip doesn't matter)

got this
Server:    10.96.0.10
Address 1: 10.96.0.10

nslookup: can't resolve 'kubernetes'
command terminated with exit code 1

What was it ? 
i was missing UDP rule in the security group of the instances. Allow traffic. Solved it. 


Regards,
Dor

Kubernetes finding the leader

Hi

Following is a good way of finding the leader, usually also the master node.

kubectl get endpoints kube-scheduler -n kube-system -o yaml

Here is my example, taken from a k8s cluster i have created on AWS with 3 nodes, 1 master and 2 workers.

apiVersion: v1
kind: Endpoints
metadata:
  annotations:
    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"ip-172-31-15-105_805a03a9-0065-11ea-9ec9-060d741267c8","leaseDurationSeconds":15,"acquireTime":"2019-11-06T07:18:04Z","renewTime":"2019-11-06T07:38:49Z","leaderTransitions":2}'
  creationTimestamp: 2019-11-04T14:36:03Z
  name: kube-scheduler
  namespace: kube-system
  resourceVersion: "70343"
  selfLink: /api/v1/namespaces/kube-system/endpoints/kube-scheduler
  uid: 6db973fb-ff10-11e9-ab52-060d741267c8


Regards,
Dor