GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
14.93k stars 1.62k forks source link

Skaffold apply fails: <manifest.yaml> is not a valid Kubernetes manifest #8247

Open ttruong-dexcom opened 1 year ago

ttruong-dexcom commented 1 year ago

Is there a way to bypass validation when doing a skaffold apply? Skaffold deploy works but doing a skaffold render then apply fails here with terse message.

Expected behavior

skaffold apply deploys the manifest.yaml

Actual behavior

<manifest.yaml> is not a valid Kubernetes manifest error

Information

apiVersion: skaffold/v2beta29
kind: Config
deploy:
  helm:
    releases:
      - name: clouddeploy-email
        namespace: tt-email
        remoteChart: oci://path/to/chart
        #repo: my-repo
        version: 2.2.6
        valuesFiles:
          - ./environments/common.yaml
          - ./environments/dev/dev.yaml
    flags:
      upgrade:
        - --install
aaron-prindle commented 1 year ago

Sorry for the delayed response here, @ttruong-dexcom currently there is no way to bypass this validation. This error is coming from here: https://github.com/GoogleContainerTools/skaffold/blob/7ca9a2d8629cb6b1329e118c706ee030cf711385/cmd/skaffold/app/cmd/apply.go#L77-L79

This check IsKubernetesManifest attempts to verify the yaml's present have all the required fields here: https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields

If possible can you post some or all of the following:

aaron-prindle commented 1 year ago

This has caused some issues for users in the past as well where essentially our checks seems to stricter (or incorrect) when compared to kubectl. If you could add some repro information or debug logs it would be much appreciated, thanks

aaron-prindle commented 1 year ago

Ignore: Making triage-bot happy

renzodavid9 commented 1 year ago

Hey @ttruong-dexcom, just following on previous comment, any extra information mentioned would be really helpful.

Also, in the latest skaffold version (v2.3.1), you will now have more details in the error message returned when a manifest fails the validation mentioned in previous comment. Hopefully with more details in the error it will be faster to tackle the problem.

Thanks a lot!