How to deploy a specific images using skaffold buildpacks?

9/1/2021

I would like to deploy a specific image in Kubernetes using skaffold buildpack. Everything is fine for doing the build but the deployment in Kubernetes failed because skaffold didn't use my dockerhub id as prefix, only skaffold-buidpacks is passed to silent kubectl command.

apiVersion: skaffold/v2beta21
kind: Config
build:
  artifacts:
  - image: systemdevformations/skaffold-buildpacks
    buildpacks:
      builder: "gcr.io/buildpacks/builder:v1"
      trustBuilder: true
      env:
      - GOPROXY={{.GOPROXY}}
profiles:
- name: gcb
  build:
    googleCloudBuild: {}
-- system-dev
buildpack
kubernetes
skaffold

1 Answer

9/3/2021
DEBU[0027] Running command: [kubectl --context kubernetes-admin@kubernetes create --dry-run=client -oyaml -f /home/ubuntu/skaffold/examples/buildpacks/k8s/web.yaml]  subtask=-1 task=DevLoop
DEBU[0027] Command output: [apiVersion: v1
kind: Service
metadata:
  name: web
  namespace: default
spec:
  ports:
  - name: http
    port: 8080
  selector:
    app: web
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
  namespace: default
spec:
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - image: skaffold-buildpacks
        name: web
        ports:
        - containerPort: 8080

Kubernetes auto-generated script doesn't use docker hub image prefix

-- system-dev
Source: StackOverflow