spinnaker icon indicating copy to clipboard operation
spinnaker copied to clipboard

'List' based Kubernetes Manifests Not Supported

Open PsychoSid opened this issue 5 years ago • 38 comments

Issue Summary:

Missing required field 'metadata' on manifest reported for k8s '*List' manifests.

Cloud Provider(s):

GKE (Kubernetes v2)

Environment:

Any

Feature Area:

Pipelines

Description:

Using a helm chart which produces resources such as "ConfigMapList", "RoleList". "RoleBindingList" etc and try to deploy baked images will result in "Missing required field 'metadata' on manifest" error which is not part of the Spec for these resources.

Steps to Reproduce:

Try to deploy a baked chart with these resources. i.e.

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBindingList
items:
- apiVersion: rbac.authorization.k8s.io/v1
  kind: RoleBinding
  metadata:
    name: prometheus-operator-prometheus
    labels:
      app: prometheus-operator-prometheus
...

Additional Details:

https://github.com/spinnaker/spinnaker/issues/4534 is the same issue but it's closed as a workaround was performed. This doesn't address the issue that Spinnaker cannot determine these resources do not require metadata fields.


Please delete the instructions below this line prior to submitting

Instructions:

Descriptions:

  • Issue Summary: A brief description of what you're seeing.
  • Cloud Provider: AWS, GCP, Kubernetes, Azure, Cloud Foundry, etc. Please assign a label from the right so your issue can be properly sorted.
  • Environment: As much information about your Spinnaker environment and configuration that might be relevant to the issue. For example: "I am running Spinnaker using the Amazon images to deploy into AWS and GCP."
  • Feature Area: Notifications, Pipelines, UI, Jenkins, etc. Please assign a label from the right so your issue can be properly sorted.
  • Description: The behavior you expect to see, and the actual behavior.
  • Steps to reproduce: Ideally, an isolated way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem). If not possible, as much information as possible to see this behavior.
  • Additional Details: Additional information such as screenshots and exception logs.

PsychoSid avatar Oct 28 '19 13:10 PsychoSid

What version of spinnaker are you using? Perhaps 1.15.x fixes this via https://github.com/spinnaker/clouddriver/pull/3716?

dbyron0 avatar Oct 28 '19 15:10 dbyron0

Version 1.16.4

PsychoSid avatar Oct 28 '19 15:10 PsychoSid

Also that commit is for "List" not "*List" as the failure is for those in the OP.

PsychoSid avatar Oct 28 '19 16:10 PsychoSid

Aaah, thanks for pointing that out.

dbyron0 avatar Oct 28 '19 16:10 dbyron0

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Dec 14 '19 14:12 spinnakerbot

@spinnakerbot remove-label stale

PsychoSid avatar Dec 16 '19 08:12 PsychoSid

We have just hit this on 1.17.6 with a NetworkPolicy list:

---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicyList
items:
- apiVersion: networking.k8s.io/v1
  kind: NetworkPolicy
  metadata:
    labels:
<snip>

We also have some Endpoint lists.

We are going to try change some to kind: List per this PR: https://github.com/spinnaker/clouddriver/pull/3716.

karlskewes avatar Jan 20 '20 03:01 karlskewes

It looks like Spinnaker treats metadata as a required field in Kubernetes v2 here: https://github.com/spinnaker/clouddriver/blob/master/clouddriver-kubernetes-v2/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/v2/description/manifest/KubernetesManifest.java#L102

Kubernetes spec says for Lists:

Every list or simple kind SHOULD have the following metadata https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds

Contrast with Objects:

Every object kind MUST have the following metadata https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata

We have been applying a *List without a metadata field via kubectl apply -f mylist.yaml for some time and are trying to move this job into Spinnaker.

karlskewes avatar Jan 20 '20 03:01 karlskewes

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Mar 05 '20 03:03 spinnakerbot

@spinnakerbot remove-label stale

karlskewes avatar Mar 07 '20 18:03 karlskewes

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Apr 21 '20 18:04 spinnakerbot

@spinnakerbot remove-label stale

dbyron0 avatar Apr 21 '20 18:04 dbyron0

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Jun 05 '20 18:06 spinnakerbot

@spinnakerbot remove-label stale

karlskewes avatar Jun 05 '20 19:06 karlskewes

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Jul 20 '20 19:07 spinnakerbot

@spinnakerbot remove-label stale

karlskewes avatar Jul 20 '20 19:07 karlskewes

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Sep 03 '20 19:09 spinnakerbot

@spinnakerbot remove-label stale

dbyron0 avatar Sep 03 '20 19:09 dbyron0

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Oct 18 '20 19:10 spinnakerbot

@spinnakerbot remove-label stale

karlskewes avatar Oct 18 '20 19:10 karlskewes

This issue hasn't been updated in 46 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Dec 03 '20 21:12 spinnakerbot

@spinnakerbot remove-label stale

dbyron0 avatar Dec 03 '20 22:12 dbyron0

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Jan 18 '21 00:01 spinnakerbot

@spinnakerbot remove-label stale

karlskewes avatar Jan 18 '21 00:01 karlskewes

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Mar 04 '21 00:03 spinnakerbot

@spinnakerbot remove-label stale

dbyron0 avatar Mar 04 '21 00:03 dbyron0

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Apr 18 '21 00:04 spinnakerbot

@spinnakerbot remove-label stale

dbyron-sf avatar Apr 18 '21 02:04 dbyron-sf

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

spinnakerbot avatar Jun 02 '21 02:06 spinnakerbot

@spinnakerbot remove-label stale

dbyron-sf avatar Jun 02 '21 02:06 dbyron-sf