microservices-demo | Demo application to go with Blog on spring.io | Learning library
kandi X-RAY | microservices-demo Summary
kandi X-RAY | microservices-demo Summary
Demo application to go with Blog on spring.io
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Runs the Eureka server
- Prints application usage information to console
- Runs the Spring Boot application
- The main application
- Search for an account
- Displays a user account
- Validates the email
- Search for users
- Create a web account controller
- The account service
- Starts the downloader
- Downloads a file from an URL
- Fetch an account by number
- Returns all accounts with the given name
- Gets account by number
- Display a search form
- Checks if the account number is valid
- Set the balance
- Updates the given amount
- Get the balance balance
- Called to withdraw the amount
- Returns a string representation of the account number
- Inits the web data binder
- Start the demo
- Create an in - memory database
microservices-demo Key Features
microservices-demo Examples and Code Snippets
Community Discussions
Trending Discussions on microservices-demo
QUESTION
That is my server.go
file where I define my server
struct and its methods.
ANSWER
Answered 2021-May-16 at 18:51This line:
QUESTION
Dear StackOverflow community!
I am trying to run the https://github.com/GoogleCloudPlatform/microservices-demo locally on minikube, so I am following their development guide: https://github.com/GoogleCloudPlatform/microservices-demo/blob/master/docs/development-guide.md
After I successfully set up minikube (using virtualbox driver, but I tried also hyperkit, however the results were the same) and execute skaffold run
, after some time it will end up with following error:
ANSWER
Answered 2021-May-14 at 11:16Tried it with docker driver, i.e. minikube start --driver=docker
, and it works. Thanks Brian!
QUESTION
I am trying to build and deploy microservices images to a single-node Kubernetes cluster running on my development machine using minikube. I am using the cloud-native microservices demo application Online Boutique by Google to understand the use of technologies like Kubernetes, Istio etc.
Link to github repo: microservices-demo
While following the installation process, and on running command skaffold run
to build and deploy my application, I get some errors:
ANSWER
Answered 2020-Jun-22 at 09:07There are a few reasons why you encounter these errors:
There might be an issue with the existing cache and/or disc space. In order to fix it you need to clear the APT cache by executing:
sudo apt-get clean
andsudo apt-get update
.The same goes with existing docker images. Execute:
docker image prune -f
anddocker container prune -f
in order to remove unused data and free disc space.If you don't care about the security risks, you can try to run the
apt-get
command with the--allow-unauthenticated
or--allow-insecure-repositories
flag. According to the docs:
Ignore if packages can't be authenticated and don't prompt about it. This can be useful while working with local repositories, but is a huge security risk if data authenticity isn't ensured in another way by the user itself.
Please let me know if that helped.
QUESTION
I have been working on extending the GCP Online Boutique microservices example, and I would like to add Istio AuthorizationPolicy resources to the system.
Concretely, I want an AuthorizationPolicy
to block all not-whitelisted traffic to cartservice
, and I want to whitelist traffic from frontend
to cartservice
.
Currently, I am able to block traffic with an AuthorizationPolicy
, but I cannot whitelist traffic by principal or namespace.
For context, here is my system setup. (Anything not explicitly stated here is the default from the demo linked above)
Istio Version:
...ANSWER
Answered 2020-Aug-01 at 15:14For reference, after debugging in person with OP, we discovered that the cluster was underspecified in terms of CPU usage. On resizing the cluster to have additional CPU (1 vCPU -> 4 vCPUs), we were able to get authz
policies working and respected.
Our hypothesis is that istiod
was failing to respond to requests because of this issue. We do not know why.
QUESTION
I am trying to build and deploy microservices images to a single-node Kubernetes cluster running on my development machine using minikube. I am using the cloud-native microservices demo application Online Boutique by Google to understand the use of technologies like Kubernetes, Istio etc.
Link to github repo: microservices-demo
I have followed all the installation process to locally build and deploy the microservices, and am able to access the web frontend through my browser. However, when I click on any of the product images say, I see this error page.
HTTP Status: 500 Internal Server Error
On doing a check using kubectl get pods
I realize that one of my pods( Recommendation service) has status CrashLoopBackOff.
Running kubectl describe pods recommendationservice-55b4d6c477-kxv8r
:
ANSWER
Answered 2020-Jul-25 at 20:26The timeout of the Readiness Probe (1 second) was too short.
More InfoThe relevant Readiness Probe is defined such that /bin/grpc_health_probe -addr=:8080
is run inside the server
container.
You would expect a 1 second timeout to be sufficient for such a probe but this is running on Minikube so that could be impacting the timeout of the probe.
QUESTION
I have two applications, nginx and redis, where nginx uses redis to cache some data so the redis address must be configured in nginx.
On the one hand, I could first apply the redis deployment and get its IP and then apply the nginx deployment to set up the two application in my minikube.
But on the other, to simplify installation in the Kubernetes Dashboard for QA, I want to create a single Kubernetes YAML file (like GoogleCloudPlatform/microservices-demo/kubernetes-manifests.yaml) to deploy these two applications on two diverse Pods. However, if I do it by means of Environment Variables, I cannot get the redis address.
So how do I achieve it?
...ANSWER
Answered 2020-Jul-08 at 11:25Hardcoding IP-address is not a good practice. Instead you can create a service for redis as well and configure the service dns name in your nginx deployment using the kubernetes dns config like this my-svc.my-namespace.svc.cluster-domain.example
. Your nginx will then communicate to the redis container through this service.
QUESTION
I took this example https://github.com/paulc4/microservices-demo and I created 3 docker images from it, with the following Dockerfiles:
springdocker-registration:
...ANSWER
Answered 2018-Jun-10 at 07:29Since its running in docker, don't use localhost
. Docker compose lets you refer to container names.
QUESTION
When i deploy this Deployment for sock-shop Yaml for sock-shop
but it does not give me write permission in the container so i cannot even write in it
...ANSWER
Answered 2020-Apr-14 at 09:20You need to run the pod as root to be able to get that permission.Edit the yaml and add below in the carts
deployment
QUESTION
this is the error i'm getting:
Error: Reference to undeclared resource
on outputs.tf line 2, in output "api-gateway-codedeploy-app-name":
2: value = "${api-gateway-codedeploy.app-name}"A managed resource "api-gateway-codedeploy" "app-name" has not been declared in the root module.
my terraform relevant folder structure is
...ANSWER
Answered 2020-Apr-09 at 19:44You are going to have more similar errors. But to fix the one you mentioned fix the following:
QUESTION
Given a following scheme of services and their dependencies I would like to engineer a set of Helm charts.
API Gateway
callsService A
andService C
Service A
callsService B
Service B
callsDatabase
Service C
callsService B
andService D
At the moment I see two alternatives:
Each of the 6 components in a diagram below is a single chart and each arrow in a diagram is a single dependency.
There's an
Umbrella
chart that has a dependency on all other charts. TheDatabase
chart is a dependency ofService B
chart.
Helm documentation suggest going with option 2. I am however more keen towards option 1 due to an ease of local development and CI/CD pipeline.
Example scenario: developer is refactoring Service C
and he wants to run the code he changed and test it.
- Option 1. Developer installs a
Service C
chart only. - Option 2: Developer would have to either:
- install an
Umbrella
chart which leads to waste of a CPU and memory resources because of running unneeded services likeService A
orAPI Gateway
, which doesn't scale well with the complexity of the system; - install
Service C
, thenService B
and thenService D
, which also doesn't scale well with the complexity of the system because it requires to perform many manual actions and also require from developer to be faimiliar with the architecture of the system in order to know what charts needs to be installed.
- install an
I would like to make an educated decision on which alternative to take. I am more keen towards option 1, but Helm docs and also few examples I was able to find on the Internet (link) are also going with option 2, so I think I might be missing something.
...ANSWER
Answered 2019-Mar-10 at 20:08I would recommend one chart per service, with the additional simplification of making the "service B" chart depend on its database. I would make these charts independent: none of the services depend on any other.
The place where Helm dependencies work well is where you have a service that embeds/hides specific single other parts. The database behind B is an implementation detail, for example, and nothing outside B needs to know about it. So B can depend on stable/postgres
or some such, and this works well in Helm.
There's one specific mechanical problem that causes problems for the umbrella-chart approach. Say service D also depended on a database, and it was the same "kind" of database (both use PostgreSQL, say). Operationally you want these two databases to be separate. Helm will see the two paths umbrella > B > database
and umbrella > D > database
, and only install one copy of the database chart, so you'll wind up with the two services sharing a database. You probably don't want that.
The other mechanical issue you'll encounter using Helm dependencies here is that most resources are named some variant of {{ .Release.Name }}-{{ .Chart.Name }}
. In your option 1, say you do just install service C; you'd wind up with Deployments like service-C-C
, service-C-B
, service-C-database
. If you then wanted to deploy service A alongside it, that would introduce its own service-A-B
and service-A-database
, which again isn't what you want.
I'm not aware of a great high-level open-source solution to this problem. A Make-based solution is hacky, but can work:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install microservices-demo
You can use microservices-demo like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the microservices-demo component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page