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: metadata.name – name: MY_POD_NAMESPACE valueFrom: fieldRef: … 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

Get error “unknown field “serviceName” in io.k8s.api.networking.v1.IngressBackend” when switch from v1beta1 to v1 in Kubernetes Ingress

I think that this PR contains the change you’re asking about. `Ingress` and `IngressClass` resources have graduated to `networking.k8s.io/v1`. Ingress and IngressClass types in the `extensions/v1beta1` and `networking.k8s.io/v1beta1` API versions are deprecated and will no longer be served in 1.22+. Persisted objects can be accessed via the `networking.k8s.io/v1` API. Notable changes in v1 Ingress objects … Read more

How do I access the Kubernetes api from within a pod container?

In the official documentation I found this: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod Apparently I was missing a security token that I didn’t need in a previous version of Kubernetes. From that, I devised what I think is a simpler solution than running a proxy or installing golang on my container. See this example that gets the information, from the … Read more

What is the difference between persistent volume (PV) and persistent volume claim (PVC) in simple terms?

From the docs PVs are resources in the cluster. PVCs are requests for those resources and also act as claim checks to the resource. So a persistent volume (PV) is the “physical” volume on the host machine that stores your persistent data. A persistent volume claim (PVC) is a request for the platform to create … 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

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