I am trying to deploy the below container on gcloud:
Then, I do below steps:
I created a namespace on gcloud
kubectl create ns qa
I created a folder "clinic_tai" contains yaml files:
mysql-deployment.yaml mysql-service.yaml mysql-pvc.yaml petclinic-deployment.yaml petclinic-service.yaml
I build these services
kubectl --namespace=qa apply -f ~/spring-boot-docker/examples/kubernetes-1.10/clinic_tai/
I get detail of services `kubectl --namespace=qa get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mysql ClusterIP 10.47.254.97 <none> 3306/TCP 25m
petclinic-service LoadBalancer 10.47.243.216 104.196.116.129 8081:31781/TCP 25m
But, I can't access the application by using the url: 104.196.116.129:8081
Please check my yaml files https://drive.google.com/open?id=1yLCwr8Lvm3fyxoGVc5DQpKFBdDq2CxZv
Do you know what's wrong ?
Unfortunately I cannot access your yaml files but:
The problem can be in matching labels of the selectors in the pod.
If your pod has "app=egg" tag, but Service selector had "name=egg". Matching them fixed the access problem.
Just changed "name: egg" on the service selector, to "app: egg". If you set the matchLabels on deployment.
I hope it helps.