Commit graph

62 commits

Author SHA1 Message Date
Megan O'Keefe
90f9287f3a
Adds option to disable Stackdriver Export (#293) 2020-02-20 15:26:44 -05:00
Megan O'Keefe
04b2084779
[WIP] Fixes emailservice CrashLoop when Workload Identity is enabled (#280)
* Adds explicit PROJECT_ID for stackdriver exporter

* save work

* cleanup
2019-12-17 13:41:59 -05:00
Megan O'Keefe
8cfb88bf2f
Standardizes loadgen behavior for Istio mTLS=STRICT (#279)
* Adds liveness probe annotation, moves loadgen initcontainer into main

* cleanup

* cleanup

* updated wrong manifests

* respond to comments
2019-12-16 09:30:23 -05:00
Megan O'Keefe
c052e69716
Adds cartservice timeout to all manifests (#241) 2019-08-19 15:21:56 -04:00
Abhilash Gnan
55f5061532 Use env in service manifests for PORT (#212)
* fix shipping service ports

* fix product catalog servicde ports

* fix paymentservice ports

* fix currenservice ports

* fix checkoutservice ports

* fix emailservice ports

* fix frontend app ports

* fix recommendationservice ports

* fix indentation in service yaml files
2019-05-08 19:39:14 -07:00
Kalyana Chadalavada
86fb1662a3 Add Stackdriver Profiler Python agent (#176)
* Add Stackdriver Profiler Python agent to EmailService and
RecommendationService

* Update recommendation_server.py

* Moved Profiler init to a function

* Moved Profiler init to a function

* Delete key.json

* Delete key.json

* Delete key.json
2019-05-03 10:29:34 -07:00
Ahmet Alp Balkan
342318a9ae
hack: remove redundant license headers in release (#171)
* remove per-yaml license headers in release manifests
* manually insert a license header in release manifests
* add README.md to /kubernetes-manifests indicating they're not ready to use
  (and refer to /release instead).
* regenerate manifests

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-03-07 09:54:56 -08:00
Mehdi El Gueddari
d5db024763 kubernetes: use apps/v1 for Deployment (#166)
In certain situations (see details below), the deployment to Kubernetes fails with:

> "The Deployment [DEPLOYMENT_OBJECT] is invalid: [...] `selector` does not match template `labels`".

This is caused by the K8S Deployment manifests missing an explicit `selector` value.

This commit:
* adds explicit `selector` values for all Deployment objects.
* bumps the K8S API from the deprecated `extensions/v1beta1` version to the stable `apps/v1` version. This version made the `selector` property of the Deployment a required value, preventing any issues with missing selectors in the future.

This change is backwards compatible with existing deployments of the microservices demo app. I.e. you should be able to pull this change and run `skaffold run` against an existing deployment of the app without issues.

This will not however resolve the issue for existing deployments. Selectors are immutable and will therefore retain their current defaulted value. You should run `skaffold delete` followed by `skaffold run` after having pulled this change to do a clean re-deployment of the app, which will resolve the issue.

**The nitty-gritty details**

In the `extensions/v1beta1` version of K8S API (the version that was used by this project), the `selector` property of a Deployment object is optional and is defaulted to the labels used in the pod template. This can cause subtle issues leading to deployment failures. This project, where Deployment selectors were omitted, is a good example of what can go wrong with defaulted selectors.

Consider this:

1. Run `skaffold run` to build locally with Docker and deploy.

Since the Deployment specs don't have explict selectors, they will be defaulted to the pod template labels. And since skaffold adds additional labels to the pod template like `skaffold-builder` and `skaffold-deployer`, the end-result will be a selector that looks like this:

> app=cartservice,cleanup=true,docker-api-version=1.39,skaffold-builder=local,skaffold-deployer=kubectl,skaffold-tag-policy=git-commit,tail=true

So far, so good.

2. Now run `skaffold run -p gcb --default-repo=your-gcr-repo` to build on Google Cloud Build instead of building locally.

This will blow up when attempting to deploy to Kubernetes with an error similar to:

> The Deployment "cartservice" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"skaffold-builder":"google-cloud-build", "profiles"="gcb", "skaffold-deployer":"kubectl", "skaffold-tag-policy":"git-commit", "docker-api-version":"1.39", "tail":"true", "app":"cartservice", "cleanup":"true"}: `selector` does not match template `labels`

(and the same error for every other deployment object)

This is because the skaffold labels that were automatically added to the pod template have changed to include references to Google Cloud Build. That normally shouldn't be an issue.

But without explicit Deployment selectors, this results in the defaulted selectors for our Deployment objects to have also changed. Which means that the new version of our Deployment objects are now managing different sets of Pods. Which is thankfully caught by kubectl before the deployment happens (otherwise this would have resulted in orphaned pods).

In this commit, we explicitely set the `selector` value of all Deployment objects, which fixes this issue. We also bump the K8S API version to the stable `apps/v1`, which makes the `selector` property a required value and will avoid accidently forgetting selectors in the future.

More details if you're curious:

* Why defaulted Deployment selectors cause problems: https://github.com/kubernetes/kubernetes/issues/26202
* Why Deployment selectors should be (and were made) immutable: https://github.com/kubernetes/kubernetes/issues/50808
2019-03-04 10:52:55 -08:00
Ahmet Alp Balkan
3b4c04fe65
loadgenerator: check curl install (#153)
without &&, load generator startup was failing intermittently when it fails
to install curl from apk-add.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-02-18 15:54:01 -08:00
rghetia
54f0a8d058 add jaeger support for productcatalog and shipping. (#126) 2019-01-22 09:56:39 -08:00
rghetia
2b074f7ff3
Add jaeger export to checkoutservice. (#116)
* Add jaeger export to checkoutservice.

* fix review comments.
2019-01-10 10:25:07 -08:00
rghetia
33ca3b63d8
Unify jaeger enabling method for adservice. (#115) 2019-01-09 05:42:54 -08:00
rghetia
85c7131d43 Add jaeger support for frontend. (#113) 2019-01-08 11:08:20 -08:00
rghetia
d944092100 Add Jaeger support for Adservice. (#111)
This is the first service that exports to jaeger. Others to follow.
Requires jaeger to be instantiated using 

- helm install --name jaeger stable/jaeger-operator
- kubectl apply -f jaeger.yaml

=== jaeger.yaml Content ===
apiVersion: io.jaegertracing/v1alpha1
kind: Jaeger
metadata:
  name: jaeger

Above steps will be added to README in subsequent PR.
2019-01-03 12:56:06 -08:00
Dave Stanke
8dabe7ff94 remove gcr repo name from images (#98)
This removes hardcoded GCP project name from images and requires an explicit repository flag to skaffold. Also updating the cloudbuild.yaml for staging with the gcr.io/k8s-skaffold/skaffold image.

Fixes #17.
2018-12-03 14:19:12 -08:00
Ahmet Alp Balkan
2771a03727
k8s: start using grpc health check for cartservice (#63) 2018-10-01 23:20:42 -07:00
Ahmet Alp Balkan
1bab006af1
grpc: implement health check in go services (#27)
Also locked grpc-go to =1.14 exact version.
See grpc/grpc-go#2314 and grpc/grpc-go#2313 for reference
2018-09-20 10:31:31 -07:00
Ace Nassri
6c37a96f3a Add health checks to Node.js services (#26)
* Move Node healthchecks to gRPC

* gitignore proto files

* Switch to standard health RPC

* Fix lint

* Update client.js

* Add protos back + update them

* node services: fix & run genproto.sh

this gets currencyservice to work but paymentservice is still crashing
in the docker container.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

* Fix docker breaking

* update dockerfiles with released health probe

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-09-19 12:35:22 -07:00
Ahmet Alp Balkan
360d983512
adservice: use grpc health checks (#29)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-09-19 12:35:07 -07:00
Ahmet Alp Balkan
880ee16be2
grpc: add health checks to python services (#28)
also converted line endings for recommendationservice/requirements.txt from
dos to unix.
2018-09-19 12:34:56 -07:00
Ahmet Alp Balkan
0f23d6bbf9
frontend: add simple /healthz endpoint
Decouple frontend health checks from GET /, which relies on other services to
be reachable. See #34.

Closes #34.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-09-04 22:44:05 -07:00
Ahmet Alp Balkan
b9a978e84f
k8s/adservice: bump memory limits for adservice (#33)
adservice has beeing OOMkill'ed over the weekend. it looks like the memory
goes up to ~130MiB and then gets killed.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-27 11:30:47 -07:00
rghetia
f35fdbcac3 Initial commit for Ads Service. (#21)
* Initial commit for Ads Service.

* update comments for AdsService and AdsServiceClient

* Refactor Ads to Ad
Move building AdService to Docker
Use default setting for Stackdriver Exporter.
Add license text.

* Revert the projectId

- also remove commented code from frontend/rpc.go

* Add adservie to skaffold.yaml

* Remove skaffold-adservice.yaml

* Replace personal projectId with demo projectId.

* Fix the crash in adservice when ran in locally.

* Ignore .skaffold*yaml file and .kubernetes-manifests-*/ dir for easy ProjectID switch.

* Fixed review comments.
1. Changed Ad redirect urls to products.
2. Removed leftovers from Dockerfile/kub*manifests*yaml
3. Added retry for StackDriver.
4. Added log for Ad request.
5. Added comment for gradle caching.
6. Added README.md to src/adservice.

* Added GRPC Health service to Ad Service
Also added
1. timeout to getAd RPC call in frontend.
2. Async thread for stackdriver init.
2018-08-22 17:02:46 -07:00
Ahmet Alp Balkan
3e90b73464
frontend: add integration for adservice
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-16 18:01:52 -07:00
Ahmet Alp Balkan
db40889ad0
Change gcr projectID in images
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-04 11:23:35 -07:00
Ahmet Alp Balkan
3493cc1cb4
Add more license headers
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-25 21:25:27 -07:00
Matthew DeLio
1bc817a013 add named port for frontend-external so that istio metrics aren't blocked 2018-07-19 09:53:28 -07:00
Ahmet Alp Balkan
2c8681d324 k8s: bump recommendationservice memory limit
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 22:49:23 -07:00
Ahmet Alp Balkan
b486251773 Revert "frontend: use LISTEN_ADDR, refactor Listen code"
This reverts commit 894c0e2a8dbcc76623c7d3ddf589e30e6b9985a9.
2018-07-16 11:01:58 -07:00
Ahmet Alp Balkan
ab2b15723c frontend: use LISTEN_ADDR, refactor Listen code
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-16 10:21:41 -07:00
Ahmet Alp Balkan
021660bb95 loadgenerator: exit faster on SIGTERM
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-15 16:34:41 -07:00
Ahmet Alp Balkan
ba5bf6d4eb loadgenerator: kill periodically to prevent lockup
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-15 11:14:35 -07:00
Ahmet Alp Balkan
5c57fc6112 add users
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-09 12:57:14 -07:00
Ahmet Alp Balkan
0be5e7b1e2 cartservice: rm initContainer, fix probe query ip
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-09 12:56:54 -07:00
Ahmet Alp Balkan
03182151ee Add gcr.io/istio-next to image names
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-07 17:14:52 -07:00
Ahmet Alp Balkan
375e2d35dd k8s: add exec probes to cartservice
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-07 17:10:52 -07:00
Ahmet Alp Balkan
5cc013952e remove trailing lines
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 13:03:37 -07:00
Ahmet Alp Balkan
3416aee7d5 k8s/cartservice: add init container to wait redis
otherwise nullpointerexception persists

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 12:41:33 -07:00
Ahmet Alp Balkan
e27dcc3883 Add README.md with installation instructions
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 10:24:11 -07:00
Ahmet Alp Balkan
b57cbd2c2c k8s: add termination period to loadgen to some svc
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-30 13:14:20 -07:00
Ahmet Alp Balkan
257cbdf98b loadgenerator: complete implementation
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 17:10:28 -07:00
Ahmet Alp Balkan
8c3d36d81e loadgenerator prototype
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 16:37:01 -07:00
Ahmet Alp Balkan
ab045ae6e7 currencyservice: change port to 7000
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 13:45:03 -07:00
Ahmet Alp Balkan
ca3ace3f65 frontend: use pkg/errors, show full stacktrace
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-28 22:03:39 -07:00
Ahmet Alp Balkan
7e252c7d8f k8s: add termination grace to recommendationservice
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-28 20:10:06 -07:00
Ahmet Alp Balkan
59063ff44a k8s: add terminationGracePeriodSeconds to some
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-28 18:34:48 -07:00
Ahmet Alp Balkan
1ae5e7737a frontend: add liveness/readiness probes
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-28 18:15:05 -07:00
Ahmet Alp Balkan
ecba29655a k8s: add liveness/readiness probes
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-28 17:55:51 -07:00
Ahmet Alp Balkan
92eb76c1db k8s: add frontend dockerfile + skaffold
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-28 16:53:56 -07:00
Ahmet Alp Balkan
39fd019343 k8s: fix emailservice port mapping
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-28 01:05:12 -07:00