I have used container registry to build & Kubernettes cluster for the deployment of the node frontend application.It is successfully passed but I am unable to access the app URL.I have exposed the port 3000 & passed it through Dockerfile. Can you please suggest where I am going wrong.
Related
I am new to Kubernetes and have a limited understanding of the Kubernetes networking part.
problem context:
Minikube installed on VM (RHEL 8) [minikube start --driver=docker]
under minikube node have a deployment with the service (type: nodePort) with port mapping as 8008:30000
(refer to screenshot)
so now the confusion is I am able to access the application (in deployment) using curl < node-ip>:< node-port> inside the VM (x.y.z.w), but while trying to access from my external network, using URL as x.y.z.w:30000, I am not able to, what am I missing here?
or do I need to use ingress (with Nginx) here?
I have an application with Spring backend and Angular frontend. I am using docker-compose and it is creating 2 containers.
I have bridge network, so locally I am able to test.
Now I want to deploy to Google Cloud.
Question: (1) Do I need to create any gcp specific yaml file?
The cluster I created seems not good enough, Using GKE in this case
Does not have minimum availability
I haven't seen any examples where spring and angular are deployed using CloudRun individually. But is this possible?
I desperately need to deploy my containers. IS there a way?
Edit:
The backend spring is able to talk to CloudSQL (answered in another post)
The angular app is not running because it doesnt know upstream host
nginx-py-sha256-2
2021/07/14 15:21:13 [emerg] 1#1: host not found in upstream "appserver:2623" in /etc/nginx/conf.d/default.conf:2
In my docker compose -
services:
# App backend service
appserver:
container_name: appserver
image: appserver
pui:
container_name: nginx-py
image: nginx-py
and my nginx.conf refers as appserver
The image I push is
docker push eu.gcr.io/myapp/appserver
what name should I use in nginx.conf so that it can identify host upstream? nice If I can disable prefix
GCP Kubernetes workload "Does not have minimum availability" is unanswered. so not a duplicate
You have a container for the backend and a front end with static file. the best pattern for that is:
Use Cloud Run for your backend
Use Cloud Storage for the frontend (static files) (make the bucket publicly accessible)
Use a load balancer where you route the static request to the bucket backend, and the backend request to Cloud Run
And, of course, forgot Docker Compose.
Note: if you have a container for your frontend, with a webserver (Angular server, NGINX or something else) you can deploy it on Cloud Run also, but you will pay processing for nothing. Cloud Storage is a better solution.
In both cases, a load balancer is recommended to avoid CORS issue. And in addition, you will be able to add CDN on the load balancer if you need it in your business
Using K8S deployment, our project is based on springcloud. I want to know that in K8S, because the multi-node deployment passes the default host name of the registry, the gateway is deployed in A, and the config is deployed in B. They can't access each other through eureka before. I changed to eureka.instance.prefer-ip-address: true, but I found that they can only access each other on the same host. He is not using cluster-ip of K8S. I want to know how to access each other between services in K8S.
In version 7-201712-EA of Activiti Cloud we provided an example using services running the netflix libraries in kubernetes - the stable github tags and docker images are available to refer to. We approached it by creating Kubernetes Services for each component and getting the component to register with eureka using the k8s service name.
To make sure the component declared the correct service name to eureka we set the eureka.instance.hostname in the component, which can be set in the Deployment yaml by specifying an environment variable or using the default environment variable EUREKA_INSTANCE_HOSTNAME. We also kept thing simple by using the same port for the java app in the Pod and for the Service. Again this can be set to match by setting the port in the Pod spec and passing the SERVER_PORT environment variable to the spring boot app.
Check the spring-cloud-kubernetes project
I created an ACS (Azure Container Service) using Kubernetes by following this link : https://learn.microsoft.com/en-us/azure/container-service/container-service-kubernetes-windows-walkthrough & I deployed my .net 4.5 app by following this link : https://learn.microsoft.com/en-us/azure/container-service/container-service-kubernetes-ui . My app needs to access Azure SQL and other resources that are part of some other resource groups in my account, but my container is not able to make any outbound calls to network - both inside azure and to internet. I opened some ports to allow outbound connections, that is not helping either.
When I create an ACS does it come with a gateway or should I create one ? How can I configure ACS so that it allows outbound network calls ?
Thanks,
Ashok.
Outbound internet access works from an Azure Container Service (ACS) Kubernetes Windows cluster if you are connecting to IP Addresses other than the range 10.0.0.0/16 (that is you are not connecting to another service on your VNET).
Before Feb 22,2017 there was a bug where Internet access was not available.
Please try the latest deployment from ACS-Engine: https://github.com/Azure/acs-engine/blob/master/docs/kubernetes.windows.md., and open an issue there if you still see this, and we (Azure Container Service) can help you debug.
For the communication with service running inside the cluster, you can use the Kube-dns which allows you to access service by its name. You can find more details at https://kubernetes.io/docs/admin/dns/
For the external communication (internet), there is no need to create any gateway etc. By default your containers inside a pod can make outbound connections. To verify this, you can run powershell in one of your containers and try to run
wget http://www.google.com -OutFile testping.txt
Get-Contents testping.txt
and see if it works.
To run powershell, ssh to your master node - instructions here
kubectl exec -it <pod_name> -- powershell
I've built a Container that leverages a CF app that's bound to a service, Cloudant to be specific.
When I run the container locally I can connect to my Cloudant service.
When I build and run my image in the Bluemix container service I can no longer connect to my Cloudant service. I did use --bind to bind my app to the container. I have verified that the VCAP_Services info is propagating to my container successfully.
To narrow the problem down further, I tried just doing an
ice -run --name NAME IMAGE_NAME ping CLOUDANT_HOST
and I found I was getting an unknown host.
So I then tried to just ping the IP, and got Network is unreachable.
If we can not resolve bluemix services over the network, how can we leverage them? Is there just a temporary problem, or perhaps I'm missing something?
Again, runs fine locally but fails when hosted in the container service.
It has been my experience that networking is not reliable in IBM Containers for about 5 seconds at startup. Try adding a "sleep 10" to your CMD or ENTRYPOINT. Or set it up to retry for X seconds before giving up.
Once the networking comes up it has been reliable for me. But the first few seconds of a containers life have had troubles with DNS, binding, and outgoing traffic.
looking at your problem it could be related to a network error on container when on Bluemix.
Try to access your container through shell when on Bluemix (using cf ic console or docker one) and check if the network has been rised correctly and then if its network interface(s) has an IP to use.