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 pass environment variable in kubectl deployment?

I used envsubst (https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html) for this. Create a deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: $NAME labels: app: nginx spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: – name: nginx image: nginx:1.7.9 ports: – containerPort: 80 Then: export NAME=my-test-nginx envsubst < deployment.yaml | kubectl apply -f – Not sure … Read more

Kubernetes – wait for other pod to be ready

You can use initContainers. Following is an example of how you can do in your YAML file initContainers: – name: wait-for-other-pod image: docker.some.image args: – /bin/sh – -c – > set -x; while [ $(curl -sw ‘%{http_code}’ “http://www.<your_pod_health_check_end_point>.com” -o /dev/null) -ne 200 ]; do sleep 15; done I have used curl to hit the health … Read more

How to schedule pods restart

Use a cronjob, but not to run your pods, but to schedule a Kubernetes API command that will restart the deployment everyday (kubectl rollout restart). That way if something goes wrong, the old pods will not be down or removed. Rollouts create new ReplicaSets, and wait for them to be up, before killing off old … Read more

Nginx Ingress Controller – Failed Calling Webhook

Another option you have is to remove the Validating Webhook entirely: kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission I found I had to do that on another issue, but the workaround/solution works here as well. This isn’t the best answer; the best answer is to figure out why this doesn’t work. But at some point, you live … Read more

How to rolling restart pods without changing deployment yaml in kubernetes?

Before kubernetes 1.15 the answer is no. But there is a workaround of patching deployment spec with a dummy annotation: kubectl patch deployment web -p \ “{\”spec\”:{\”template\”:{\”metadata\”:{\”annotations\”:{\”date\”:\”`date +’%s’`\”}}}}}” As of kubernetes 1.15 you can use: kubectl rollout restart deployment your_deployment_name CLI Improvements Created a new kubectl rollout restart command that does a rolling restart of … Read more

no matches for kind “Deployment” in version “extensions/v1beta1”

In Kubernetes 1.16 some apis have been changed. You can check which apis support current Kubernetes object using $ kubectl api-resources | grep deployment deployments deploy apps true Deployment This means that only apiVersion with apps is correct for Deployments (extensions is not supporting Deployment). The same situation with StatefulSet. You need to change Deployment … Read more

Is it possible to Autoscale Akka

If you consider a project like hseeberger/constructr and its issue 179, a native Akka solution should be based on akka/akka-management: This repository contains interfaces to inspect, interact and manage various Parts of Akka, primarily Akka Cluster. Future additions may extend these concepts to other parts of Akka. There is a demo for kubernetes.

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 https://github.com/kubernetes-incubator/metrics-server.git 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 clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created [root@ip-10-0-1-91 1.8+]# kubectl apply -f auth-reader.yaml rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created [root@ip-10-0-1-91 1.8+]# kubectl … Read more