"Tilt를 사용한 클러스터 API 개발"의 두 판 사이의 차이

56번째 줄: 56번째 줄:


====== Goland / IntelliJ ======
====== Goland / IntelliJ ======
위의 예시를 활용하면 포트 30000을 가리키는 [https://www.jetbrains.com/help/go/attach-to-running-go-processes-with-debugger.html#step-3-create-the-remote-run-debug-configuration-on-the-client-computer Go Remote 실행/디버그 설정]을 설정할 수 있습니다.
=== kind 클러스터 생성하고 Tilt 실행! ===
=== kind 클러스터 생성하고 Tilt 실행! ===
=== 워크로드 클러스터 배포 ===
=== 워크로드 클러스터 배포 ===

2024년 4월 18일 (목) 14:55 판

1 개요

Developing Cluster API with Tilt
Tilt를 사용한 클러스터 API 개발

이 문서에서는 간편한 배포와 빠른 반복 빌드를 제공하는 단순화된 워크플로우를 위해 kindTilt를 사용하는 방법을 설명합니다 .

2 전제조건

  1. Docker: v19.03 이상
  2. kind: v0.22.0 이상
  3. Tilt: v0.30.8 이상
  4. kustomize: make kustomize를 통해 제공
  5. envsubst: make envsubst를 통해 제공
  6. helm: v3.7.1 이상
  7. Cluster API 저장소를 로컬로 클론
  8. 로컬로 배포하려는 제공자도 클론

3 시작하기

3.1 kind 클러스터 생성

로컬 Docker 레지스트리와 함께 KIND 클러스터를 생성하는 스크립트 및 CAPD를 실행하기 위한 올바른 마운트가 hack/ 폴더에 포함되어 있습니다.

사전설정된 클러스터를 생성하려면 다음을 실행하세요:

./hack/kind-install-for-capd.sh

다음을 사용하여 클러스터의 상태를 확인할 수 있습니다:

kubectl cluster-info --context kind-capi-test

3.2 tilt-settings 파일 생성

3.2.1 tilt-settings 필드

3.2.1.1 디버거 연결
3.2.1.1.1 Visual Studio

위의 예제를 사용할 때, 다음 시작 설정을 사용하여 Visual Studio Code에서 core CAPI controller를 디버깅할 수 있습니다.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Core CAPI Controller",
      "type": "go",
      "request": "attach",
      "mode": "remote",
      "remotePath": "",
      "port": 30000,
      "host": "127.0.0.1",
      "showLog": true,
      "trace": "log",
      "logOutput": "rpc"
    }
  ]
}
3.2.1.1.2 Goland / IntelliJ

위의 예시를 활용하면 포트 30000을 가리키는 Go Remote 실행/디버그 설정을 설정할 수 있습니다.

3.3 kind 클러스터 생성하고 Tilt 실행!

3.4 워크로드 클러스터 배포

3.5 kind 클러스터와 개발환경 클린업

4 clusterctl 사용

5 사용가능 제공자

5.1 tilt-provider 설정

5.1.1 설정 필드

6 Tilt 커스터마이징

7 Under the covers, a.k.a “the real work”

8 Tiltfile IDE 지원

9 Podman 사용

10 Tilt 트러블슈팅

10.1 Tilt is stuck

10.2 Errors running tilt-prepare

10.2.1 failed to get current context from the KubeConfig file

10.2.2 Cannot connect to the Docker daemon

10.3 Errors pulling/pushing to the registry

10.3.1 connection refused / denied / not found

default_registry 필드가 이미지를 가져오고 푸시할 수 있는 유효한 레지스트리인지 확인하십시오 .

10.3.2 server gave HTTP response to HTTPS client

기본적으로 localhost:5000을 제외한 모든 레지스트리는 HTTPS를 통해 액세스됩니다.

HTTP 레지스트리를 실행하는 경우 docker/podman에서 레지스트리를 설정해야 할 수도 있습니다.

예를 들어, podman에서는 localhost:5001 레지스트리 설정을 다음 내용으로 /etc/containers/registries.conf.d 내에 선언해야 합니다.

[[registry]]
location = "localhost:5001"
insecure = true

주의: macOS에서는 이 설정을, podman machine ssh <machine>를 실행하여, podman 머신 내에서 수행해야 합니다.

10.4 Errors loading images in kind

다음을 실행하여 kind에 이미지를 수동으로 로드할 수 있습니다.

kind load docker-image --name=<kind_cluster> <image>

10.4.1 image: "..." not present locally

Podman을 구동 중인 경우, 다음 버그가 있을 수 있습니다: https://github.com/kubernetes-sigs/kind/issues/2760

워크어라운드는 podman 실행파일에 대한 docker 심링크를 만들고 이미지를 다시 로드하는 것입니다.

11 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}