๋กœ์ผ“๐Ÿพ
article thumbnail

 

 

๋“ค์–ด๊ฐ€๊ธฐ ์•ž์„œ ์ €๋Š” Windows ๋ฅผ ๋งŽ์ด ๋‹ค๋ค„๋ณด์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ถ€์กฑํ•˜๊ฑฐ๋‚˜ ํ‹€๋ฆฐ ๋ถ€๋ถ„์ด ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!

 

์ฟ ๋ฒ„๋„คํ‹ฐ์Šค๋Š” v1.23 ๋ฒ„์ „, Karpenter ๋Š” v0.31 ๋ฒ„์ „์ž…๋‹ˆ๋‹ค.

 

์ฟ ๋ฒ„๋„คํ‹ฐ์Šค(EKS) ํ™˜๊ฒฝ์— ์œˆ๋„์šฐ์™€ Karpenter ๋ฅผ ํ™œ์„ฑํ™” ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„  ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

Karpenter ์— ๋Œ€ํ•ด ๊ถ๊ธˆํ•˜๋‹ค๋ฉด ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

 

๊ทธ๋Ÿผ ๋ ›์ธ ๋‘๋”์ฝ”๋“œ~

 

 

์šฐ๋ฆฌ๊ฐ€ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋ฐ”๋กœ ์˜ค์ผ€์ŠคํŠธ๋ ˆ์ด์…˜์„ ์œ„ํ•จ์ด์ฃ .

ํ•˜๋‚˜์˜ ๋งˆ์Šคํ„ฐ ํ”Œ๋ ˆ์ธ์œผ๋กœ ์—ฌ๋Ÿฌ ๋…ธ๋“œ์˜ ์—ฌ๋Ÿฌ ํŒŒ๋“œ๋ฅผ ์ข€ ๋” ์‰ฝ๊ฒŒ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด์„œ์ž…๋‹ˆ๋‹ค.

 

Action Runner ์—ญ์‹œ ์˜ˆ์™ธ๋Š” ์•„๋‹ˆ์ฃ .

Action Runner Controller ๋ฅผ ์ด์šฉํ•˜๋ฉด ์‰ฝ๊ฒŒ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ํ™˜๊ฒฝ์—์„œ ํŒŒ๋“œ ๋‹จ์œ„์˜ Runner ๋ฐฐํฌ๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

๋งจ ์ฒ˜์Œ Action Runner Controller ๋ฅผ ์ ‘ํ–ˆ์„ ๋• Official ํ•˜์ง€ ์•Š์•˜๋Š”๋ฐ, ํ˜„์žฌ๋Š” Github Docs ์—๋„ ๊ฐ€์ด๋“œํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

 

๋ฆฌ๋ˆ…์Šค ๊ธฐ๋ฐ˜์˜ ๋…ธ๋“œ๋ผ๋ฉด ์–ด๋ ต์ง€ ์•Š์•„์š”. ์ œ๊ณต๋˜๋Š” Action Runner Controller ์ด๋ฏธ์ง€๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ์œˆ๋„์šฐ๋Š” ์–˜๊ธฐ๊ฐ€ ์ข€ ๋‹ค๋ฆ…๋‹ˆ๋‹ค.

 

 

๋„ค.. ๊ณต์‹์ ์œผ๋กœ ์ง€์›์„ ์•ˆํ•ด์ค๋‹ˆ๋‹ค.. ๋”ฐ๋ผ์„œ ์ด๋ฏธ์ง€๋ฅผ ์ง์ ‘ ๋งŒ๋“ค์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

๋‹คํ–‰ํžˆ ์™„์ „ํžˆ ์œˆ๋„์šฐ๋ฅผ ๋ฐฐ์ œํ•œ ๊ฒƒ์€ ์•„๋‹ˆ์—์š”.

์—ฌ๊ธฐ๋ฅผ ๋ณด๋ฉด ์ด๋ ‡๊ฒŒ ์œˆ๋„์šฐ์— ๋Œ€ํ•ด์„œ ๊ฐ€์ด๋“œํ•˜๊ณ  ์žˆ์ฃ .

 

๋ฌธ์„œ๋ฅผ ๋ณด๋ฉด Dockerfile ์ด ์ œ๊ณต๋˜๋Š”๋ฐ ์ €๋Š” ์กฐ๊ธˆ~ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

FROM mcr.microsoft.com/windows/servercore:ltsc2019

ENV chocolateyVersion=1.4.0

WORKDIR /actions-runner

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]

RUN Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v2.292.0/actions-runner-win-x64-2.292.0.zip -OutFile actions-runner-win-x64-2.292.0.zip

RUN if((Get-FileHash -Path actions-runner-win-x64-2.292.0.zip -Algorithm SHA256).Hash.ToUpper() -ne 'f27dae1413263e43f7416d719e0baf338c8d80a366fed849ecf5fffcec1e941f'.ToUpper()){ throw 'Computed checksum did not match' }

RUN Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory('actions-runner-win-x64-2.292.0.zip', $PWD)

RUN Invoke-WebRequest -Uri 'https://aka.ms/install-powershell.ps1' -OutFile install-powershell.ps1; ./install-powershell.ps1 -AddToPath

RUN powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

RUN powershell choco install git.install --params "'/GitAndUnixToolsOnPath'" -y

RUN powershell choco feature enable -n allowGlobalConfirmation

CMD [ "pwsh", "-c", "./config.cmd --name $env:RUNNER_NAME --url https://github.com/$env:RUNNER_ORG --runnergroup $env:RUNNER_GROUP --token $env:RUNNER_TOKEN --labels $env:RUNNER_LABELS --unattended --replace --ephemeral; ./run.cmd"]

 

๋งŒ์•ฝ 2022 ๋ฒ„์ „์˜ Karpenter ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด 2019 ๊ฐ€ ์•„๋‹Œ 2022 ๋ฒ„์ „์˜ ์œˆ๋„์šฐ ์ด๋ฏธ์ง€๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

์ž ์ด์ œ ์ด Dockerfile ์„ ๋นŒ๋“œํ•ด์•ผ ํ•˜๋Š”๋ฐ ๋ฌธ์ œ๋Š” ์ €๋Š” ์œˆ๋„์šฐ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค..

๊ทธ๋ž˜์„œ Terraform ์„ ์ด์šฉํ•ด์„œ ๊ฐ„๋‹จํ•˜๊ฒŒ Windows ๊ธฐ๋ฐ˜์˜ EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•ด์„œ ๊ทธ ์•ˆ์—์„œ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.

 

์‚ฌ์šฉํ•œ AMI ๋Š” Karpenter ์—์„œ ์‚ฌ์šฉํ•˜๋Š” AMI ์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

๋˜ ๋‹ค๋ฅธ ๋ฌธ์ œ๋Š” ๋ฆฌ๋ˆ…์Šค ๊ธฐ๋ฐ˜์ฒ˜๋Ÿผ SSH ๋กœ ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€๋Šฅํ•ด์„œ ์•„๋ž˜์™€ ๊ฐ™์€ ํ”„๋กœ๊ทธ๋žจ์„ ๋‹ค์šด๋ฐ›์•„์„œ ์ ‘์†์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

 

 

์ž ๊ทธ๋Ÿผ ๋„์šด ์œˆ๋„์šฐ์—์„  ๋นŒ๋“œ๋ฅผ ์ง„ํ–‰ํ•ด๋ณด์ฃ !

 

.NET Framework 4.8 was installed, but a reboot is required. Please reboot the system and try to install/upgrade Chocolatey again.

๋นŒ๋“œ ํ•˜๋‹ค ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”.
๊นƒํ—™ ๋ฌธ์„œ์— ์žˆ๋Š” Dockerfile ์„ ๊ทธ๋Œ€๋กœ ์“ฐ๋ฉด ๋ฐœ์ƒํ•  ๊ฒ๋‹ˆ๋‹ค.

 

์„ฑ๊ณต์ ์œผ๋กœ ๋นŒ๋“œ๊ฐ€ ๋์Šต๋‹ˆ๋‹ค.

์ด๋ฏธ์ง€๊ฐ€ ์ƒ๋‹นํžˆ ํฐ๋ฐ.. ์œˆ๋„์šฐ ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€ ํฌ๊ธฐ ์ž์ฒด๊ฐ€ ์ปค์„œ ์–ด์ฉ” ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค ใ…œใ…œ

Dockerfile ์—์„œ Layer ๋ฅผ ์ค„์ด๊ธฐ ์œ„ํ•ด Run ์„ ํ•œ์ค„๋กœ ์“ฐ๋ฉด ์†Œํญ์œผ๋กœ ์ค„์ผ ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š”?

 

์ดํ›„ ์œˆ๋„์šฐ ๊ธฐ๋ฐ˜์˜ ๋…ธ๋“œ๋ฅผ Karpenter ๋กœ ํ”„๋กœ๋น„์ €๋‹ํ•œ ํ›„ ํŒŒ๋“œ๋กœ ๋ฐฐํฌํ•˜๋ฉด ์„ฑ๊ณต์ ์œผ๋กœ ๋ฐฐํฌ๋˜๋Š” ๊ฑธ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๋งŒ์•ฝ ์•„๋ž˜์™€ ๊ฐ™์ด No such host is Known ์ด๋ผ๋Š” ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ  ํ•ด์ฃผ์„ธ์š”.

EKS ์—์„œ ์œˆ๋„์šฐ ๊ธฐ๋ฐ˜์˜ ์›Œ์ปค ๋…ธ๋“œ ๊ด€๋ จํ•œ ์„ค์ •์ด ๋˜์ง€ ์•Š์•„์„œ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค.
์›Œ์ปค ๋…ธ๋“œ๋Š” Join ํ–ˆ์ง€๋งŒ ํŒŒ๋“œ๊ฐ€ CoreDNS ์— ์ ‘๊ทผ์„ ๋ชปํ•ด์„œ DNS ๋ฅผ ์ฐพ์ง€๋ชปํ•ด ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ์ฃ .

 

 

์˜ค๋Š˜์€ ์ด๋ ‡๊ฒŒ Windows ๊ธฐ๋ฐ˜์˜ ์›Œ์ปค ๋…ธ๋“œ์— Runner ์ด๋ฏธ์ง€๋ฅผ ์ง์ ‘ ๋นŒ๋“œํ•˜์—ฌ ํŒŒ๋“œ๋กœ ๋ฐฐํฌํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์•˜์Šต๋‹ˆ๋‹ค.

๊ธ€๋กœ๋Š” ๊ทธ๋ ‡๊ฒŒ ๊ธธ์ง€ ์•Š์ง€๋งŒ... ์ •๋ง ๋ป˜์ง“์ด ๋งŽ์•˜๋˜ ์ž‘์—…์ด์˜€๋„ค์š”..

 

๊ทธ๋Ÿผ ์˜ค๋Š˜์€ ์—ฌ๊ธฐ๊นŒ์ง€~!

 

profile on loading

Loading...