How to configure this external service for kubernetes? How to configure this external service for kubernetes? kubernetes kubernetes

How to configure this external service for kubernetes?


You can create External IP or External Name service with db host IP and call that service from POD.

Also other options is to deploy db as pod on k8 cluster with headless service.

Just out of curiosity, why you are deploying db as container using docker if you have k8 cluster?


I do not have OSX to test it, but that statement seems to be not true - that there is no way to persist data on Kubernetes for OSX. To do that you can just create a Persistent Volume which will be a resource in the cluster and then add PersistentVolumeClaim :

PV is is a resource in the cluster just like a node is a clusterresource. PVs are volume plugins like Volumes, but have a lifecycleindependent of any individual pod that uses the PV.

PVC is a request for storage by a user. It is similar to a pod. Podsconsume node resources and PVCs consume PV resources. Pods can requestspecific levels of resources (CPU and Memory). Claims can requestspecific size and access modes (e.g., can be mounted once read/writeor many times read-only).

You can find explanation here. And how to here with step by step configuration of mySQL and in this case Wordpress.

About your setup, first try to follow the official documentation about running mySQL inside of the cluster (assuming you are using minikube, but if not there should't be much differences) if you do not succeed we will continue. I already started trying to connect from the inside of the cluster to mysql container outside (my setup is Ubuntu 18.04 with minikube).

Also you are right you won't be able to access it on localhost, because docker is actually using 172.17 (if I remember correctly) so you one of the options would be building new image and put host machine IP with exposed port.