Skip to content

[Q] build tag vs. deployment tag #6804

@CrystalMethod

Description

@CrystalMethod

Even after reading #3269, I am having trouble understanding the relationship between build tag and deployment tag. Maybe my problem has nothing to do with #3269.

I would like to describe my problem: I have a project where an image is to be built using Maven/Jib and deployed to a local minikube (Docker backend). The Helm Chart is referenced remotely. This Helm Chart adds labels to almost all Kubernetes objects. One of the labels is

app.kubernetes.io/version: {{ .Values.image.tag | quote }}

Expected behavior

skaffold deploy should use the tag produced by the given build.tagPolicy

Actual behavior

$ skaffold dev -p local
Listing files to watch...
 - <image>
Generating tags...
 - <image> -> <image>:2021-11-04_23-54-14.141_CET
Checking cache...
 - <image>: Found. Tagging
Tags used in deployment:
 - <image> -> <image>:4a9062ee615b7604427b2c6035e07d6e66b941406142bdc2d0a996a6276e7f1e
Starting deploy...
Helm release <release> not installed. Installing...
Error: INSTALLATION FAILED: ServiceAccount "<name>" is invalid: metadata.labels: Invalid value: "4a9062ee615b7604427b2c6035e07d6e66b941406142bdc2d0a996a6276e7f1e": must be no more than 63 characters
Cleaning up...
release "<release>" uninstalled

Information

  • Skaffold version: v1.34.0
  • Operating system: ArchLinux/WSL2
  • Installed via: skaffold.dev
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta25
kind: Config
metadata:
  name: <..>

build:
  tagPolicy:
    dateTime: {}
  artifacts:
  - image: <..>
    context: .
    jib: {}

deploy:
  helm:
    releases:
      - name: <..>
        remoteChart: <..>
        artifactOverrides:
          image: <..>
        imageStrategy:
          helm: {}

profiles:
  - name: local
    build:
      local:
        push: false
    activation:
      - kubeContext: minikube
  • I know that I could truncate the labels in the Helm template. But these Helm charts are maintained by another party.
  • Several tests to do this with setValues / setValueTemplates also failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions