Renew kubernetes pki after expired

So the solution was to (first a backup) $ cd /etc/kubernetes/pki/ $ mv {apiserver.crt,apiserver-etcd-client.key,apiserver-kubelet-client.crt,front-proxy-ca.crt,front-proxy-client.crt,front-proxy-client.key,front-proxy-ca.key,apiserver-kubelet-client.key,apiserver.key,apiserver-etcd-client.crt} ~/ $ kubeadm init phase certs all –apiserver-advertise-address <IP> $ cd /etc/kubernetes/ $ mv {admin.conf,controller-manager.conf,kubelet.conf,scheduler.conf} ~/ $ kubeadm init phase kubeconfig all $ reboot then $ cp -i /etc/kubernetes/admin.conf $HOME/.kube/config that did the job for me and thanks for your hints … Read more

How to know a Pod’s own IP address from inside a container in the Pod?

The simplest answer is to ensure that your pod or replication controller yaml/json files add the pod IP as an environment variable by adding the config block defined below. (the block below additionally makes the name and namespace available to the pod) env: – name: MY_POD_NAME valueFrom: fieldRef: fieldPath: – name: MY_POD_NAMESPACE valueFrom: fieldRef: … Read more

How to Enable KubeAPI server for HPA Autoscaling Metrics

I am able to implement HPA using metrics-server as heapster is depreciated. I have followed the following steps: Clone the metrics-server github repo: git clone Go into directory cd deploy/1.8+ and run following yaml files: [root@ip-10-0-1-91 1.8+]# kubectl apply -f aggregated-metrics-reader.yaml created [root@ip-10-0-1-91 1.8+]# kubectl apply -f auth-reader.yaml created [root@ip-10-0-1-91 1.8+]# kubectl … Read more

Listing all resources in a namespace

Based on this comment , the supported way to list all resources is to iterate through all the api versions listed by kubectl api-resources: kubectl api-resources enumerates the resource types available in your cluster. this means you can combine it with kubectl get to actually list every instance of every resource type in a namespace: … Read more

Kubernetes: Routing non HTTP Request via Ingress to Container

This is not well supported via the ingress mechanism and is an open issue. There is a work around for tcp or udp traffic using nginx-ingress which will map an exposed port to a kubernetes service using a configmap. See this doc. Start the ingress controller with the tcp-services-configmap (and/or udp-services-configmap) argument. args: – “/nginx-ingress-controller” … Read more