String operation on env variables on Kubernetes

You can do something like – name: MY_POD_NAME valueFrom: fieldRef: fieldPath: metadata.name – name: MY_POD_URI value: “uri://$(MY_POD_NAME):9099/” We are using that since K8s 1.4 $() is processed by k8s itself, does not work everywhere, but works for env variables. If your container contains bash, you can also leverage bash variable expansion “command”: [“/bin/bash”], “args”: [ … Read more

Minikube with ingress example not working

Here’s what worked for me: minikube start minikube addons enable ingress minikube addons enable ingress-dns Wait until you see the ingress-nginx-controller-XXXX is up and running using Kubectl get pods -n ingress-nginx Create an ingress using the K8s example yaml file Update the service section to point to the NodePort Service that you already created Append … Read more

Kubernetes pod distribution amongst nodes

Here I leverage Anirudh’s answer adding example code. My initial kubernetes yaml looked like this: apiVersion: extensions/v1beta1 kind: Deployment metadata: name: say-deployment spec: replicas: 6 template: metadata: labels: app: say spec: containers: – name: say image: gcr.io/hazel-champion-200108/say ports: – containerPort: 8080 — kind: Service apiVersion: v1 metadata: name: say-service spec: selector: app: say ports: – … Read more

WaitForFirstConsumer PersistentVolumeClaim waiting for first consumer to be created before binding

The app is waiting for the Pod, while the Pod is waiting for a PersistentVolume by a PersistentVolumeClaim. However, the PersistentVolume should be prepared by the user before using. My previous YAMLs are lack of a PersistentVolume like this: kind: PersistentVolume apiVersion: v1 metadata: name: postgres-data labels: type: local spec: storageClassName: local-storage capacity: storage: 1Gi … Read more

How to list kubernetes services in k9s?

It’s documented here: Key Bindings K9s uses aliases to navigate most K8s resources. :alias View a Kubernetes resource aliases So you have to type: :svc EDIT: Hotkeys You can also configure custom hotkeys. Here’s my config file ~/.k9s/hotkey.yml or ~/Library/Application Support/k9s/hotkey.yml hotKey: f1: shortCut: F1 description: View pods command: pods f2: shortCut: F2 description: View … Read more

Which API Group in k8s

To get API resources – supported by your Kubernetes cluster: kubectl api-resources -o wide example: NAME SHORTNAMES APIGROUP NAMESPACED KIND VERBS deployments deploy apps true Deployment [create delete deletecollection get list patch update watch] deployments deploy extensions true Deployment [create delete deletecollection get list patch update watch] To get API versions – supported by your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)