IT/Knowledge

kubernetes. Skaffold

성준하이 2022. 12. 7. 11:08
반응형

Skaffold란?

코드 수정 → 쿠버네티스 클러스터까지 적용을 단순화해준 프레임워크

  • Code change
  • Docker container build
  • Kubernetes resources deploy
  • Debugging on k8s cluster

공식 문서

https://skaffold.dev/docs/

 

Skaffold 2.0 Documentation

Easy and Repeatable Container & Kubernetes Development

skaffold.dev

 

 

설치 방법은 다음과 같다.(mac brew 기준)

$ brew install skaffold

$ skaffold version

 

다음 프로젝트에서 skaffold 파일을 생성한다.

Run / Debug Configuration

skaffold.yaml

active profile 지정해주는 간단한 작업 진행합니다.

apiVersion: skaffold/v2beta21
kind: Config
metadata:
  name: story-rest-server
requires:
  - configs: []
    activeProfiles:
      - name: default
        activatedBy: []
build:
  tagPolicy:
    customTemplate:
      template: "skaffold"
  artifacts:
  - image: story-test
    context: .
    docker:
      dockerfile: Dockerfile
deploy:
  kubectl:
    manifests:
    - k8s-manifests/develop/configmap.yaml
    - k8s-manifests/develop/deployment.yaml
    - k8s-manifests/develop/ingress.yaml
    - k8s-manifests/develop/service.yaml

 

실행

이후 Run Configuration을 통하여 실행하면 됩니다.

`Run` → `Edit Configurations...` → `Cloud code: Kubernetes` 클릭​
반응형