Closed webmakaka closed 2 years ago
Hello and thanks for reporting this problem!
My first guess is that you have run into some problems with the symbolic links that makes the config-repo
available in the components' Helm charts. For Chapter 17, this is explained on page 503, with a reference to the explanation in Chapter 16 on page 475.
For the product microservice, see:
Can you run the following command to see if this might be the problem?
ls -l $BOOK_HOME/Chapter17/kubernetes/helm/components/product/config-repo
It should respons with something similar to:
... application.yml -> ../../../../../config-repo/application.yml
... product.yml -> ../../../../../config-repo/product.yml
Regards, Magnus.
Hi, @magnus-larsson!
Your answer helped me to solve my issue!
Thanks!
==========================
My solution!
Previously, I download sources as zip. Symbolic links are lost.
To solve the issue.
I made "config-repo" for each microservice.
then
// auth-server
$ cd kubernetes/helm/components/auth-server/config-repo/
$ {
ln -s ../../../../../config-repo/application.yml application.yml
ln -s ../../../../../config-repo/auth-server.yml auth-server.yml
}
// product-composite
$ cd kubernetes/helm/components/product-composite/config-repo/
$ {
ln -s ../../../../../config-repo/application.yml application.yml
ln -s ../../../../../config-repo/product-composite.yml product-composite.yml
}
// product
$ cd kubernetes/helm/components/product/config-repo/
$ {
ln -s ../../../../../config-repo/application.yml application.yml
ln -s ../../../../../config-repo/product.yml product.yml
}
// recommendation
$ cd kubernetes/helm/components/recommendation/config-repo/
$ {
ln -s ../../../../../config-repo/application.yml application.yml
ln -s ../../../../../config-repo/recommendation.yml recommendation.yml
}
// review
$ cd kubernetes/helm/components/review/config-repo/
$ {
ln -s ../../../../../config-repo/application.yml application.yml
ln -s ../../../../../config-repo/review.yml review.yml
}
and the result is
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
auth-server-6b7cf86b66-f896w 1/1 Running 0 74s
product-7bb8dd5dbb-2ctsn 1/1 Running 0 74s
product-composite-85fc98c8bf-qjghd 1/1 Running 1 74s
recommendation-7c9bbd76f8-xrgsx 1/1 Running 0 74s
review-7b48469995-zq6fv 1/1 Running 0 74s
zipkin-server-6b9b4d988f-g9tzg 1/1 Running 0 74s
$ HOST=minikube.me PORT=443 USE_K8S=true ./test-em-all.bash
Start Tests: Mon 13 Jun 2022 07:35:19 PM MSK
HOST=minikube.me
PORT=443
USE_K8S=true
SKIP_CB_TESTS=false
Wait for: curl -k https://minikube.me:443/actuator/health... DONE, continues...
ACCESS_TOKEN=eyJraWQiOiI5NzY5NmRmMi1jYmEwLTQ5YWEtOTY4OS05ZWE3ZDM4YzQ0MjUiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ3cml0ZXIiLCJhdWQiOiJ3cml0ZXIiLCJuYmYiOjE2NTUxMzgxMTksInNjb3BlIjpbInByb2R1Y3Q6d3JpdGUiLCJvcGVuaWQiLCJwcm9kdWN0OnJlYWQiXSwiaXNzIjoiaHR0cDpcL1wvYXV0aC1zZXJ2ZXIiLCJleHAiOjE2NTUxNDE3MTksImlhdCI6MTY1NTEzODExOSwianRpIjoiNjViMTk4MzEtMmEzOS00MzAzLTg3NWMtYmJhNmJkZTJhOWQzIn0.1XRhG0YpBYLSZU_6KPXxyWQ7ATcnSrIrmhV3HoqybsvSLy_dGCbIDl2L9y3iutuFX9m1BLSaYtnLmpi0x3WKrY0KVtPhfSVIuUSk3rEkyQiS3jOJ17wv_CKDVtDhlGya9e4ALeae-o4rF6L_4Fw-UBQuEHi-EUOEH8KbQvb7VknqNMHhc2QPn-0mYnclcxwV0e49nLpidXuqOhfEsBTinhHygUs_s-gJJRWoxwLBfu-wNSSbYe9ayLAfTSzd5UCdSdC9HUlL9zxyXV3oz7wFh0JFP6K6XcOYdFsRSolbo-50kqwTxWBDzx0GjYpOSzDP1VvtmlHIX8Ie5cuzIsLiMQ
Test OK (HTTP Code: 202, )
Test OK (actual value: 202)
Test OK (HTTP Code: 202, )
Test OK (actual value: 202)
Test OK (HTTP Code: 202, )
Test OK (actual value: 202)
Wait for messages to be processed...
Test OK (HTTP Code: 200)
Test OK (actual value: 1)
Test OK (actual value: 3)
Test OK (actual value: 3)
All messages are now processed!
Test OK (HTTP Code: 200)
Test OK (actual value: 1)
Test OK (actual value: 3)
Test OK (actual value: 3)
Test OK (HTTP Code: 404, {"timestamp":"2022-06-13T16:35:23.190627979Z","path":"/product-composite/13","message":"No product found for productId: 13","status":404,"error":"Not Found"})
Test OK (actual value: No product found for productId: 13)
Test OK (HTTP Code: 200)
Test OK (actual value: 113)
Test OK (actual value: 0)
Test OK (actual value: 3)
Test OK (HTTP Code: 200)
Test OK (actual value: 213)
Test OK (actual value: 3)
Test OK (actual value: 0)
Test OK (HTTP Code: 422, {"timestamp":"2022-06-13T16:35:23.640115193Z","path":"/product-composite/-1","message":"Invalid productId: -1","status":422,"error":"Unprocessable Entity"})
Test OK (actual value: "Invalid productId: -1")
Test OK (HTTP Code: 400, {"timestamp":"2022-06-13T16:35:23.713+00:00","path":"/product-composite/invalidProductId","status":400,"error":"Bad Request","message":"Type mismatch.","requestId":"55307164-3"})
Test OK (actual value: "Type mismatch.")
Test OK (HTTP Code: 401, )
READER_ACCESS_TOKEN=eyJraWQiOiI5NzY5NmRmMi1jYmEwLTQ5YWEtOTY4OS05ZWE3ZDM4YzQ0MjUiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJyZWFkZXIiLCJhdWQiOiJyZWFkZXIiLCJuYmYiOjE2NTUxMzgxMjMsInNjb3BlIjpbIm9wZW5pZCIsInByb2R1Y3Q6cmVhZCJdLCJpc3MiOiJodHRwOlwvXC9hdXRoLXNlcnZlciIsImV4cCI6MTY1NTE0MTcyMywiaWF0IjoxNjU1MTM4MTIzLCJqdGkiOiI3OTAyY2NjMC1iYTZiLTQzNjItOTE4ZS0zMTkwZGE4ODAxZWIifQ.KP6Gv8KofI-0N3wXflaidSV2ckZBVQhEuz8WX8aPZ_5YUXRwwp5n-8Zu1aRutrDUpUjgN1z-TohLBbYcDTac8buQBl25aMw5ZlZnXTEnQjWVC56FC-dWOLXE6mG7yUGtRk9kZI-OQAcQSudoqEHV7GmFWN6W5OkEn8G4VzlBzQqc4HJwHWOuP6aaIVs6C2TqGiclsOFysHTdqOr3LGOnp7bCN6LvEriuSZIV20COem-GjnVycHHfYBEIJ2EPkC4pVXwoWT1N0I2G7KUYYV4e_v46PJoMCceOnvdfXr1Yw2UYdDUyu0kiYToQ4MsG10rRivnxdk4PFo4TNuFX_kz49w
Test OK (HTTP Code: 200)
Test OK (HTTP Code: 403, )
Swagger/OpenAPI tests
Test OK (HTTP Code: 302, )
Test OK (HTTP Code: 200)
Test OK (HTTP Code: 200)
Test OK (HTTP Code: 200)
Test OK (actual value: 3.0.1)
Test OK (HTTP Code: 200)
Start Circuit Breaker tests!
Test OK (actual value: CLOSED)
Test OK (HTTP Code: 500, {"timestamp":"2022-06-13T16:35:26.936+00:00","path":"/product-composite/1","status":500,"error":"Internal Server Error","message":"Did not observe any item or terminal signal within 2000ms in 'onErrorResume' (and no fallback has been configured)","requestId":"b701ee1e-6"})
Test OK (actual value: Did not observe any item or terminal signal within 2000ms)
Test OK (HTTP Code: 500, {"timestamp":"2022-06-13T16:35:29.008+00:00","path":"/product-composite/1","status":500,"error":"Internal Server Error","message":"Did not observe any item or terminal signal within 2000ms in 'onErrorResume' (and no fallback has been configured)","requestId":"445c4b92-6"})
Test OK (actual value: Did not observe any item or terminal signal within 2000ms)
Test OK (HTTP Code: 500, {"timestamp":"2022-06-13T16:35:31.091+00:00","path":"/product-composite/1","status":500,"error":"Internal Server Error","message":"Did not observe any item or terminal signal within 2000ms in 'onErrorResume' (and no fallback has been configured)","requestId":"9ae530f7-8"})
Test OK (actual value: Did not observe any item or terminal signal within 2000ms)
Test OK (actual value: OPEN)
Test OK (HTTP Code: 200)
Test OK (actual value: Fallback product1)
Test OK (HTTP Code: 200)
Test OK (actual value: Fallback product1)
Test OK (HTTP Code: 404, {"timestamp":"2022-06-13T16:35:31.58276681Z","path":"/product-composite/13","message":"Product Id: 13 not found in fallback cache!","status":404,"error":"Not Found"})
Test OK (actual value: Product Id: 13 not found in fallback cache!)
Will sleep for 10 sec waiting for the CB to go Half Open...
Test OK (actual value: HALF_OPEN)
Test OK (HTTP Code: 200)
Test OK (actual value: product name C)
Test OK (HTTP Code: 200)
Test OK (actual value: product name C)
Test OK (HTTP Code: 200)
Test OK (actual value: product name C)
Test OK (actual value: CLOSED)
Test OK (actual value: CLOSED_TO_OPEN)
Test OK (actual value: OPEN_TO_HALF_OPEN)
Test OK (actual value: HALF_OPEN_TO_CLOSED)
End, all tests OK: Mon 13 Jun 2022 07:35:42 PM MSK
Thanks again!
Hello!
I am trying to create deployment for production and receiving an error:
I see that container just has no file. Did I miss some step?
Do not want to manually update book sources.
===========================================
My Steps
Install the cert-manager
=================
Environment
I updated gradle to work with JDK17