Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Krane deploy error with prune whitelist - error: no matches for kind "Job" in version "batch/v2alpha1" #687

Closed
1 task
sco11morgan opened this issue Feb 10, 2020 · 8 comments
Labels
🪲 bug Something isn't working

Comments

@sco11morgan
Copy link
Contributor

Bug report

During a deploy an error occurs because of the values in the generated prune whitelist. This started happening after we updated our cluster to Kubernetes 1.16

error: no matches for kind "Job" in version "batch/v2alpha1"

List contained

--prune --all --prune-whitelist\=/v1/configmap --prune-whitelist\=/v1/endpoints --prune-whitelist\=/v1/event --prune-whitelist\=/v1/limitrange --prune-whitelist\=/v1/persistentvolumeclaim --prune-whitelist\=/v1/pod --prune-whitelist\=/v1/podtemplate --prune-whitelist\=/v1/replicationcontroller --prune-whitelist\=/v1/resourcequota --prune-whitelist\=/v1/secret --prune-whitelist\=/v1/serviceaccount --prune-whitelist\=/v1/service --prune-whitelist\=apps/v1/daemonset --prune-whitelist\=apps/v1/deployment --prune-whitelist\=apps/v1/replicaset --prune-whitelist\=apps/v1/statefulset --prune-whitelist\=ark.heptio.com/v1/backup --prune-whitelist\=ark.heptio.com/v1/backupstoragelocation --prune-whitelist\=ark.heptio.com/v1/config --prune-whitelist\=ark.heptio.com/v1/deletebackuprequest --prune-whitelist\=ark.heptio.com/v1/downloadrequest --prune-whitelist\=ark.heptio.com/v1/podvolumebackup --prune-whitelist\=ark.heptio.com/v1/podvolumerestore --prune-whitelist\=ark.heptio.com/v1/resticrepository --prune-whitelist\=ark.heptio.com/v1/restore --prune-whitelist\=ark.heptio.com/v1/schedule --prune-whitelist\=autoscaling/v2beta2/horizontalpodautoscaler --prune-whitelist\=batch/v1beta1/cronjob --prune-whitelist\=batch/v2alpha1/job

Expected behavior: Expected pruning to perform normally.

Actual behavior: Error with supplied list of items to be pruned.

Version(s) affected: 1.1.1

Feature request

  • If the maintainers agree with the feature as described here, I intend to submit a Pull Request myself.1

Proposal: [provide details on the behaviour you'd like to see and why it would be useful]

1 This is the quickest way to get a new feature! We reserve the right to close feature requests, even ones we like, if the proposer does not intend to contribute to the feature and it doesn't fit in our current roadmap.

@sco11morgan
Copy link
Contributor Author

$ kubectl explain Job
KIND:     Job
VERSION:  batch/v1

@dturn dturn added the 🪲 bug Something isn't working label Feb 12, 2020
@dturn
Copy link
Contributor

dturn commented Feb 12, 2020

Thanks for the bug report, looks like we're going to have to put in an override for job https://github.com/Shopify/krane/blob/master/lib/krane/cluster_resource_discovery.rb#L87

@dturn
Copy link
Contributor

dturn commented Feb 13, 2020

@sco11morgan would you be interested in PRing this fix, I'm happy to provide guidance.

@sco11morgan
Copy link
Contributor Author

@dturn sure. Just add an override of "Job" => "v1"?

@dturn
Copy link
Contributor

dturn commented Feb 18, 2020

Just add an override of "Job" => "v1"?

That's the small fix. The other idea might be update the code in that function not to use alpha versions unless there are not other choices.

@sco11morgan
Copy link
Contributor Author

I already had the PR up for the small fix. I can look at a more general solution but won't be able to get to it for a couple of days.

@airhorns
Copy link
Contributor

I'm getting the same error on GKE 1.17.9-gke.6300 for FrontendConfig:

error: no matches for kind "FrontendConfig" in version "networking.gke.io/v1"

Failed command:

Command failed: apply -f /tmp/d20201022-168-14b244a --prune --all --prune-whitelist\=/v1/configmap --prune-whitelist\=/v1/endpoints --prune-whitelist\=/v1/event --prune-whitelist\=/v1/limitrange --prune-whitelist\=/v1/persistentvolumeclaim --prune-whitelist\=/v1/pod --prune-whitelist\=/v1/podtemplate --prune-whitelist\=/v1/replicationcontroller --prune-whitelist\=/v1/resourcequota --prune-whitelist\=/v1/secret --prune-whitelist\=/v1/serviceaccount --prune-whitelist\=/v1/service --prune-whitelist\=acme.cert-manager.io/v1/challenge --prune-whitelist\=acme.cert-manager.io/v1/order --prune-whitelist\=apm.k8s.elastic.co/v1/apmserver --prune-whitelist\=apps/v1/daemonset --prune-whitelist\=apps/v1/deployment --prune-whitelist\=apps/v1/replicaset --prune-whitelist\=apps/v1/statefulset --prune-whitelist\=autoscaling/v2beta2/horizontalpodautoscaler --prune-whitelist\=batch/v1beta1/cronjob --prune-whitelist\=batch/v1/job --prune-whitelist\=beat.k8s.elastic.co/v1beta1/beat --prune-whitelist\=cert-manager.io/v1/certificaterequest --prune-whitelist\=cert-manager.io/v1/certificate --prune-whitelist\=cert-manager.io/v1/issuer --prune-whitelist\=cloud.google.com/v1/backendconfig --prune-whitelist\=coordination.k8s.io/v1/lease --prune-whitelist\=discovery.k8s.io/v1beta1/endpointslice --prune-whitelist\=elasticsearch.k8s.elastic.co/v1/elasticsearch --prune-whitelist\=enterprisesearch.k8s.elastic.co/v1beta1/enterprisesearch --prune-whitelist\=extensions/v1beta1/ingress --prune-whitelist\=fission.io/v1/canaryconfig --prune-whitelist\=fission.io/v1/environment --prune-whitelist\=fission.io/v1/function --prune-whitelist\=fission.io/v1/httptrigger --prune-whitelist\=fission.io/v1/kuberneteswatchtrigger --prune-whitelist\=fission.io/v1/messagequeuetrigger --prune-whitelist\=fission.io/v1/package --prune-whitelist\=fission.io/v1/timetrigger --prune-whitelist\=internal.autoscaling.k8s.io/v1alpha1/capacityrequest --prune-whitelist\=jaegertracing.io/v1/jaeger --prune-whitelist\=kibana.k8s.elastic.co/v1/kibana --prune-whitelist\=networking.gke.io/v1/frontendconfig --prune-whitelist\=networking.gke.io/v1/managedcertificate --prune-whitelist\=networking.k8s.io/v1/networkpolicy --prune-whitelist\=nodemanagement.gke.io/v1alpha1/updateinfo --prune-whitelist\=policy/v1beta1/poddisruptionbudget --prune-whitelist\=rbac.authorization.k8s.io/v1/rolebinding --prune-whitelist\=rbac.authorization.k8s.io/v1/role --prune-whitelist\=scalingpolicy.kope.io/v1alpha1/scalingpolicy --prune-whitelist\=snapshot.storage.k8s.io/v1beta1/volumesnapshot

Explain:

kamloop ~/C/gadget (main*) ➜  kubectl explain FrontendConfig
KIND:     FrontendConfig
VERSION:  networking.gke.io/v1beta1

DESCRIPTION:
     <empty>

FIELDS:
   apiVersion	<string>
     APIVersion defines the versioned schema of this representation of an
     object. Servers should convert recognized schemas to the latest internal
     value, and may reject unrecognized values. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

   kind	<string>
     Kind is a string value representing the REST resource this object
     represents. Servers may infer this from the endpoint the client submits
     requests to. Cannot be updated. In CamelCase. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

   metadata	<Object>
     Standard object's metadata. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

   spec	<Object>
     FrontendConfigSpec is the spec for a FrontendConfig resource

   status	<map[string]>

Could you folks explain more about the general fix for this? I don't quite understand, and am happy to PR the small fix again for this resource but I wonder what a more sustainable version looks like.

airhorns added a commit to airhorns/krane that referenced this issue Oct 24, 2020
Fixes

```
error: no matches for kind "FrontendConfig" in version "networking.gke.io/v1"
```

when pruning resources on GKE clusters >= 1.17.9-gke.6300

See Shopify#687 for more details
@dturn
Copy link
Contributor

dturn commented Feb 12, 2021

This should be resolved for ever by #778

@dturn dturn closed this as completed Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants