kubernetesgoogle-kubernetes-engine

Kubernetes engine error with apiVersion and kind


I'm getting an error

This apiVersion and/or kind does not reference a schema known by Cloud Code. Please ensure you are using a valid apiVersion and kind.

on both manifest.yaml and nordered-service.yaml.

manifest.yaml =

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nodered-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nodered
  template:
    metadata:
      labels:
        app: nodered
    spec:
      containers:
        - name: nodered
          image: nodered/node-red
          ports:
            - containerPort: 1880

nordered-service.yaml =

apiVersion: v1
kind: Service
metadata:
  name: nodered-service
spec:
  type: LoadBalancer
  selector:
    app: nodered
  ports:
    - name: http
      port: 80
      targetPort: 1880

I'm getting the same errors on both files with apiVersion and kind.


Solution

  • The error message you're seeing is related to the Cloud Code extension (such as VS Code, IntelliJ, or another IDE with Kubernetes integration), rather than an issue with the Kubernetes API server itself, as your apiVersion and kind appear to be standard and correct. This likely indicates that Cloud Code's internal validation system either doesn't recognize or isn't properly syncing with the latest Kubernetes API schema, or there could be a caching problem.

    You can try the following workarounds:

    I also suggest filling a bug or issue for more thorough resolution.