skaffold init

1 개요[ | ]

skaffold init
  • 애플리케이션을 배포하기 위한 설정을 생성하는 skaffold 명령어
testuser@loclahost:/workspaces/venti$ skaffold init
? Which builders would you like to create kubernetes resources for?  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ]  Buildpacks (go.mod)
  [ ]  Buildpacks (web/package.json)
  [x]  Docker (Dockerfile)
one or more valid Kubernetes manifests are required to run skaffold
testuser@loclahost:/workspaces/venti$ skaffold init --generate-manifests
? Which builders would you like to create kubernetes resources for?  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ]  Buildpacks (go.mod)
  [ ]  Buildpacks (web/package.json)
  [x]  Docker (Dockerfile)
? Select port to forward for dockerfile-image (leave blank for none): 8080
apiVersion: skaffold/v3
kind: Config
metadata:
  name: venti
build:
  artifacts:
  - image: dockerfile-image
    docker:
      dockerfile: Dockerfile
manifests:
  rawYaml:
  - deployment.yaml
portForward:
- resourceType: service
  resourceName: dockerfile-image
  port: 8080

deployment.yaml - apiVersion: v1
kind: Service
metadata:
  name: dockerfile-image
  labels:
    app: dockerfile-image
spec:
  ports:
  - port: 8080
    protocol: TCP
  clusterIP: None
  selector:
    app: dockerfile-image
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dockerfile-image
  labels:
    app: dockerfile-image
spec:
  replicas: 1
  selector:
    matchLabels:
      app: dockerfile-image
  template:
    metadata:
      labels:
        app: dockerfile-image
    spec:
      containers:
      - name: dockerfile-image
        image: dockerfile-image

? Do you want to write this configuration, along with the generated k8s manifests, to skaffold.yaml? (y/N) y
Generated manifest deployment.yaml was written
Configuration skaffold.yaml was written
You can now run [skaffold build] to build the artifacts
or [skaffold run] to build and deploy
or [skaffold dev] to enter development mode, with auto-redeploy
testuser@loclahost:/workspaces/venti$ ls *.yaml
deployment.yaml  skaffold.yaml
testuser@loclahost:/workspaces/venti$ cat skaffold.yaml 
apiVersion: skaffold/v3
kind: Config
metadata:
  name: venti
build:
  artifacts:
  - image: dockerfile-image
    docker:
      dockerfile: Dockerfile
manifests:
  rawYaml:
  - deployment.yaml
portForward:
- resourceType: service
  resourceName: dockerfile-image
  port: 8080

2 같이 보기[ | ]

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