dybooksit / k8s-aws-book Goto Github PK
View Code? Open in Web Editor NEW동양북스 <AWS를 이용한 쿠버네티스 애플리케이션 배포> 저장소
License: Apache License 2.0
동양북스 <AWS를 이용한 쿠버네티스 애플리케이션 배포> 저장소
License: Apache License 2.0
sudo docker build -t k8sbook/backend-app:1.0.0 --build-arg
JAR_FILE=build/libs/backend-app-1.0.0.jar .
명령어를 입력했을 때 도커 이미지 빌드에 실패하는 경우입니다.
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
책과 동일한 명령어를 입력했음에도 위와 같은 오류를 보게 됩니다.
제 실행 환경은 다음과 같습니다.
OS: Apple M1 Pro, MacOS Ventura 13.2.1
Docker Engine: v20.10.22
이러한 오류는 buildkit과 관련된 오류입니다.
buildkit은 docker에서 legacy builder를 대체하는 발전된 백엔드 빌더입니다.
오류 메시지를 보시면 frontend, LLB와 같은 단어를 볼 수 있는데요.
LLB(Low-Level-Build): LLB는 개발자가 BuildKit을 확장할 수 있는 중간 바이너리 형식이다. LLB는 매우 복잡한 빌드 정의를 구성하는 데 사용할 수 있는 콘텐츠 주소 지정 가능한 종속성 그래프를 정의합니다.
Frontend: 프론트엔드는 사람이 읽을 수 있는 빌드 형식을 사용하여 LLB로 변환하여 BuildKit이 실행할 수 있는 구성 요소입니다. 프론트엔드는 이미지로 배포될 수 있으며, 사용자는 정의에 의해 사용되는 기능에 대해 작동하도록 보장된 특정 버전의 프론트엔드를 타겟팅할 수 있습니다.
이 오류는 buildkit을 이용하는 과정에서 생긴 오류입니다.
따라서 단기적으로는 buildkit을 사용하지 않고 legacy builder를 사용함으로써 해결될 수 있습니다.
buildkit 대신 legacy builder를 사용하는 방법은 다음과 같습니다.
docker engine 설정에 가셔서 buildkit : true 에서 false로 바꿔주시면 됩니다.
그 후 다시 빌드를 시도하면 성공하게 됩니다.
다만 이는 완전한 해결책은 아니며 결국 앞으로 buildkit이 더 널리 쓰일 것이므로 buildkit의 추후 업데이트로 오류가 해결되거나 buildkit에 맞춰 Dockerfile을 수정하는 등의 대책이 필요합니다.
저희는 책을 보고 예제를 따라하는 것이 중요하므로 legacy builder를 이용하여 빌드하고 넘어가도 충분할 것 같습니다.
해결하는데 생각보다 오래 걸려서 다른 분들은 이슈를 보고 빨리 넘어가길 바라는 마음에서 이슈를 올려봅니다.
(저를 포함한) 쿠버네티스 초심자 분들에게 컨테이너의 가호가 함께하길 빌겠습니다.
좋은 하루 되세요!
안녕하세요 독자입니다.
page 90의 2.5 프런트엔드 애플리케이션 빌드와 배포 부터 진행할때 에러가 나오면서 더이상 진행이 되질 않습니다.
mac에서는 되는데 windows에서는 되질 않네요.
$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
[email protected] install C:\Users\minim\k8sbook\src\k8s-aws-book\frontend-app\node_modules\fibers
node build.js || nodejs build.js
C:\Users\minim\k8sbook\src\k8s-aws-book\frontend-app\node_modules\fibers>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild --release ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack at exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:465:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd C:\Users\minim\k8sbook\src\k8s-aws-book\frontend-app\node_modules\fibers
gyp ERR! node -v v14.16.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: sudo apt-get install g++ build-essential
RHEL users please run: yum install gcc-c++
and yum groupinstall 'Development Tools'
Alpine users please run: sudo apk add python make g++
'nodejs' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules@nuxt\components\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules@nuxt\builder\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node build.js || nodejs build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\minim\AppData\Roaming\npm-cache_logs\2022-03-31T16_23_33_380Z-debug.log
$ BASE_URL=http://ac3aedcba5-------------------------------------.ap-northeast-2.elb.amazonaws.com:8080 npm run build
[email protected] build C:\Users\minim\k8sbook\src\k8s-aws-book\frontend-app
nuxt build
WARN [email protected] is installed but ^10.1.1 is expected
WARN mode option is deprecated. Please use ssr: true for universal mode or ssr: false for spa mode and remove mode from nuxt.config
WARN Module @nuxtjs/vuetify not found. Please ensure @nuxtjs/vuetify is in dependencies and installed.
FATAL Cannot find module '@nuxtjs/vuetify'
Require stack:
C:\Users\minim\k8sbook\src\k8s-aws-book\frontend-app\node_modules@nuxt\core\dist\core.js
Require stack:
╭──────────────────────────────────────────────────────────────────────────────╮│ ││ ✖ Nuxt Fatal Error ││ ││ Error: Cannot find module '@nuxtjs/vuetify' ││ Require stack: ││ - ││ C:\Users\minim\k8sbook\src\k8s-aws-book\frontend-app\node_modules@nuxt\ ││ core\dist\core.js ││ │╰──────────────────────────────────────────────────────────────────────────────╯
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: nuxt build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\minim\AppData\Roaming\npm-cache_logs\2022-03-31T16_24_24_569Z-debug.log
node쪽 지식이 없다보니 디버깅이 좀 힘드네요. 확인부탁드립니다.
backend-app 빌드 시 gradle 버전(5.2.1)이 낮아서 문제가 생기는 것 같습니다.
❯ ./gradlew clean build
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
gradle 버전을 7.2로 시도하였을 때 성공하였습니다.
❯ ./gradlew clean build
Welcome to Gradle 7.2!
Here are the highlights of this release:
- Toolchain support for Scala
- More cache hits when Java source files have platform-specific line endings
- More resilient remote HTTP build cache behavior
For more details see https://docs.gradle.org/7.2/release-notes.html
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :test
2024-04-07 15:20:51.280 [SpringContextShutdownHook] INFO o.s.s.c.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor'
2024-04-07 15:20:51.280 [SpringContextShutdownHook] INFO o.s.s.c.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor'
2024-04-07 15:20:51.281 [SpringContextShutdownHook] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
2024-04-07 15:20:51.281 [SpringContextShutdownHook] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1m 4s
14 actionable tasks: 12 executed, 2 up-to-date
그러나 여기서도 Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
경고 메시지가 뜨고 있어서 8버전 이상의 gradle을 사용을 권장하는 것 같습니다.
인스턴스 클래스 타입 db.t2.micro 이 해당 리전에서 더이상 지원하는 engine 버전이 없습니다.
지원하는 가장 작은 클래스 타입이 db.t3.micro 또는 db.t4g.micro인 것으로 확인됩니다.
Resource handler returned message: "RDS does not support creating a DB instance with the following combination: DBInstanceClass=db.t2.micro, Engine=postgres, EngineVersion=11.22, LicenseModel=postgresql-license. For supported combinations of instance class and database engine version, see the documentation. (Service: Rds, Status Code: 400, Request ID: bc7a18af-0f03-4f19-9d99-1b2763d562b1)" (RequestToken: 309d643a-c499-c0a5-bc4e-7580229fe3b2, HandlerErrorCode: InvalidRequest)
안녕하세요. 열심히 AWS 공부하고 있는 직장인 입니다.
교재에 나온 내용을 하나하나 실습해 가며 공부하는 중에 오류가 계속해서 발생해서 문의 드립니다.
제목과 같이 애플리케이션용 데이터베이스 사용자 생성에서 Timeout 이 계속 발생하고 있어서 진도가 나가지 않아 문의 올립니다.
내용 관련하여 앞의 내용을 여러번 봐도 오류가 나는 부분이 해되지 않아 확인 부탁 드립니다.
잘못된 부분이 있다면 어디서 어떻게 확인해 나가야 되는지 답변 달아주시면 수행하도록 하겠습니다.
=======오류=========
sh-4.2$ createuser -d -U eksdbadmin -P -h eks-work-db.c5n9m7l9cl4j.ap-northeast-2.rds.amazonaws.com mywork
Enter password for new role:
Enter it again:
createuser: could not connect to database template1: could not connect to server: Connection timed out
Is the server running on host "eks-work-db.c5n9m7l9cl4j.ap-northeast-2.rds.amazonaws.com" (192.168.4.61) and accepting
TCP/IP connections on port 5432?
sh-4.2$
BASE_URL=http://a74edea2837c1459cb89f563971e43e2-246972610.ap-northeast-2.elb.amazonaws.com:8080 npm run build
[email protected] build
nuxt build
i Production build
i Bundling for server and client side
i Target: server
√ Builder initialized
√ Nuxt files generated
FATAL Rule can only have one resource source (provided resource and test + include + exclude) in {
"use": [
{
"loader": "C:\Temp\k8s-aws-book-master\frontend-app\node_modules\babel-loader\lib\index.js",
"options": {
"configFile": false,
"babelrc": false,
"cacheDirectory": false,
"envName": "client",
"presets": [
[
"C:\Temp\k8s-aws-book-master\frontend-app\node_modules\@nuxt\babel-preset-app\src\index.js",
{}
]
]
},
"ident": "clonedRuleSet-4[0].rules[0].use[0]"
}
]
}
"use": [
{
"loader": "C:\Temp\k8s-aws-book-master\frontend-app\node_modules\babel-loader\lib\index.js",
"options": {
"configFile": false,
"babelrc": false,
"cacheDirectory": false,
"envName": "client",
"presets": [
[
"C:\Temp\k8s-aws-book-master\frontend-app\node_modules\@nuxt\babel-preset-app\src\index.js",
{}
]
]
},
"ident": "clonedRuleSet-4[0].rules[0].use[0]"
}
]
}
at checkResourceSource (node_modules@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:167:11)
at Function.normalizeRule (node_modules@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:198:4)
at node_modules@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:110:20
at Array.map ()
at Function.normalizeRules (node_modules@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:109:17)
at new RuleSet (node_modules@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:104:24)
at new NormalModuleFactory (node_modules@nuxt\webpack\node_modules\webpack\lib\NormalModuleFactory.js:115:18)
at Compiler.createNormalModuleFactory (node_modules@nuxt\webpack\node_modules\webpack\lib\Compiler.js:636:31)
at Compiler.newCompilationParams (node_modules@nuxt\webpack\node_modules\webpack\lib\Compiler.js:653:30)
at Compiler.compile (node_modules@nuxt\webpack\node_modules\webpack\lib\Compiler.js:661:23)
at node_modules@nuxt\webpack\node_modules\webpack\lib\Compiler.js:321:11
at Compiler.readRecords (node_modules@nuxt\webpack\node_modules\webpack\lib\Compiler.js:529:11)
at node_modules@nuxt\webpack\node_modules\webpack\lib\Compiler.js:318:10
at AsyncSeriesHook.eval [as callAsync] (eval at create (node_modules\tapable\lib\HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (node_modules\tapable\lib\Hook.js:154:20)
at node_modules@nuxt\webpack\node_modules\webpack\lib\Compiler.js:315:19
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ Error: Rule can only have one resource source (provided resource and test + │
│ include + exclude) in { │
│ "use": [ │
│ { │
│ "loader": │
│ "C:\Temp\k8s-aws-book-master\frontend-app\node_modules\babel-loader\lib\index.js", │
│ "options": { │
│ "configFile": false, │
│ "babelrc": false, │
│ "cacheDirectory": false, │
│ "envName": "client", │
│ "presets": [ │
│ [ │
│ "C:\Temp\k8s-aws-book-master\frontend-app\node_modules\@nuxt\babel-preset-app\src\index.js", │
│ {} │
│ ] │
│ ] │
│ }, │
│ "ident": "clonedRuleSet-4[0].rules[0].use[0]" │
│ } │
│ ] │
│ } │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NAM@DESKTOP-F3P6LSN MINGW64 /c/Temp/k8s-aws-book-master/frontend-app
안녕하세요. m1 맥북 사용자입니다.
로컬 환경에서 아래 작업 수행 시 에러가 발생합니다.
cd k8s-aws-book/backend-app
sudo chmod 755 ./gradlew
./gradlew clean build
마지막 빌드 수행 시 에러가 발생해서 다음 진행이 불가합니다.
책 214p ~ 216p 에 있는 아래 yaml 파일을 다운받을 수 없네요.
(AccessDenied)
cloudwatch 용 네임스페이스
https://s3.amazonaws.com/cloudwatch-agent-k8s-yamls/kubernetesmonitoring/cloudwatch-namespace.yaml
cloudwatch 용 서비스 계정 생성
https://s3.amazonaws.com/cloudwatch-agent-k8s-yamls/kubernetesmonitoring/cwagent-serviceaccount.yaml
cloudwatch agent 가 사용할 컨피그맵
https://s3.amazonaws.com/cloudwatch-agent-k8s-yamls/kubernetesmonitoring/cwagent-configmap.yaml
cloudwatch agent 를 데몬셋으로 동작
https://s3.amazonaws.com/cloudwatch-agent-k8s-yamls/kubernetesmonitoring/cwagent-demonset.yaml
구글링을 통해 EKS to CloudWatch 모니터링 환경 구성 블로그 글을 봤고,
내용은 유사한 것 같았습니다.
amazon-cloudwatch-container-insights 내 k8s-yaml-templates 를 참고해서 사용하면 될까요?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.