Skip to content

Conversation

@artursarlo
Copy link

Fix Docker Build Failure Due to Deprecated Kubeval Schema URL

Problem

The Docker build for the gprofiler webapp service was failing with a 404 error when attempting to download the Kubernetes DaemonSet JSON schema from kubernetesjsonschema.dev:

=> ERROR [webapp stage-1 27/30] RUN mkdir backend/utils/daemonset_files && \
    curl -f "https://kubernetesjsonschema.dev/master/daemonsetspec.json" -o "backend/utils/daemonset_files/daemonsetspec.json" && \
    curl -Lf "https://raw.githubusercontent.com/intel/gprofiler/master/deploy/k8s/gprofiler.yaml" -o "backend/utils/daemonset_files/daemonset.yml"

curl: (22) The requested URL returned error: 404

Root Cause

The kubeval tool and its associated schema hosting service (kubernetesjsonschema.dev) are no longer maintained. The domain and schema files are no longer available, causing the Docker build to fail during the schema download step.

Solution

Migrated to kubeconform as the replacement validation tool, following the official recommendation from the kubeval repository:

"Kubeval is no longer maintained. For new and existing users we recommend using kubeconform as a replacement."
github.com/instrumenta/kubeval

Changes Made

Updated src/gprofiler/Dockerfile to download the DaemonSet schema from the kubernetes-json-schema repository maintained by the kubeconform project:

Before:

# https://github.com/instrumenta/kubeval use this source to retrieve schema
RUN mkdir backend/utils/daemonset_files && \
    curl -f "https://kubernetesjsonschema.dev/master/daemonsetspec.json" -o "backend/utils/daemonset_files/daemonsetspec.json" && \
    curl -Lf "https://raw.githubusercontent.com/intel/gprofiler/master/deploy/k8s/gprofiler.yaml" -o "backend/utils/daemonset_files/daemonset.yml"

After:

# https://github.com/yannh/kubeconform use this source to retrieve schema
RUN mkdir backend/utils/daemonset_files && \
    curl -f "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.35.0/daemonsetspec.json" -o "backend/utils/daemonset_files/daemonsetspec.json" && \
    curl -Lf "https://raw.githubusercontent.com/intel/gprofiler/master/deploy/k8s/gprofiler.yaml" -o "backend/utils/daemonset_files/daemonset.yml"

Key Changes:

  • Schema Source: Changed from kubernetesjsonschema.dev (deprecated) to raw.githubusercontent.com/yannh/kubernetes-json-schema
  • Version Pinning: Now explicitly using Kubernetes schema version v1.35.0 (latest stable at time of fix)
  • Comment Update: Updated reference from instrumenta/kubeval to yannh/kubeconform

Impact

  • Docker builds now succeed without 404 errors
  • Schema validation continues to work using maintained schemas
  • Future-proof solution - kubeconform is actively maintained
  • No functional changes to validation logic or behavior

References

Testing

After applying this change:

  1. Docker build completes successfully
  2. Schema file is downloaded to backend/utils/daemonset_files/daemonsetspec.json
  3. DaemonSet YAML validation continues to work as expected

Notes

  • The schema version v1.35.0 should be periodically updated to match the target Kubernetes cluster version
  • Alternative workaround mentioned in related issues: using --skip-schema-validation flag, but this approach is not recommended as it disables important validation checks

@artursarlo
Copy link
Author

Hey @mlim19 the build is failing because of a broken external dependency. You can replicate the issue by performing a local build. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants